Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix I18n translation for attributes in has_many collections #594

Merged
merged 1 commit into from
Jul 4, 2017
Merged

Fix I18n translation for attributes in has_many collections #594

merged 1 commit into from
Jul 4, 2017

Conversation

hughfm
Copy link
Contributor

@hughfm hughfm commented May 25, 2016

Problem:

Following on from changes in #492...

When collection partials are rendered in the context of a has_many field, translations for the attribute labels are currently being looked up under the parent model's scope. For example, label for shipped_at attribute on Order model is looking in en: helpers: label: customer: shipped_at:, rather than en: helpers: label: order: shipped_at:

Solution:

Use collection_presenter.resource_name, which is scoped to the field being rendered, instead of resource_name.

edit: 'Edit',
destroy: 'Destroy',
confirm: 'Are you sure?'
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a comma after the last item of a multiline hash.

@BenMorganIO
Copy link
Collaborator

Thanks @hughfm don't forget to fix the hound warnings :)

@hughfm
Copy link
Contributor Author

hughfm commented May 25, 2016

Thanks @BenMorganIO I'm still a bit new to this :) I've just fixed those up, should I just push an extra commit onto this branch?

@BenMorganIO
Copy link
Collaborator

Cool. Can you rebase and squish them into a single commit? I'll get them merged on in after :)

@hughfm
Copy link
Contributor Author

hughfm commented May 25, 2016

thanks @BenMorganIO that's all done, but not sure why CI has failed now - let me know if there's an issue, cheers.

@BenMorganIO
Copy link
Collaborator

@hughfm just an old cache that needs to get expired due to #591.

@BenMorganIO BenMorganIO added the i18n translations and language support label Mar 23, 2017
@marcusg
Copy link

marcusg commented Jun 27, 2017

Hi guys, any updates here? It seems to be still an issue in current master. Thanks!

@nickcharlton
Copy link
Member

Hi @hughfm, @marcusg! This is looking good and has no conflicts so I'm going to go ahead and merge. Thanks!

@nickcharlton nickcharlton merged commit 2418f05 into thoughtbot:master Jul 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n translations and language support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants