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

locale_accessors & fallbacks #85

Closed
pwim opened this Issue Sep 8, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@pwim
Collaborator

pwim commented Sep 8, 2017

When using locale_accessors, the locale specific accessors also use the fallbacks. e.g.,

Event.new(title_en: "foo").title_ja 
#=> "foo" instead of nil

I'm using the locale accessors to generate a form that provides the ability to edit an events title in Japanese and English (in two different form fields). With globalize, the locale specific accessors would return nil. This made it obvious which fields have not been translated. It also meant translations only got written when the user entered them. With mobility's current behaviour, if a user edits an event with an untranslated title and then saves it, the untranslated title will become the original title.

@shioyama

This comment has been minimized.

Show comment
Hide comment
@shioyama

This comment has been minimized.

Show comment
Hide comment
@shioyama

shioyama Sep 8, 2017

Owner

I guess your point is slightly different, i.e. that fallbacks should be disabled for locale accessors.

Owner

shioyama commented Sep 8, 2017

I guess your point is slightly different, i.e. that fallbacks should be disabled for locale accessors.

@shioyama

This comment has been minimized.

Show comment
Hide comment
@shioyama

shioyama Sep 8, 2017

Owner

I thought about it and you're right of course, locale accessors should not fallback by default. See #86, which I think should do it.

Owner

shioyama commented Sep 8, 2017

I thought about it and you're right of course, locale accessors should not fallback by default. See #86, which I think should do it.

@shioyama shioyama closed this in #86 Sep 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment