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

locale_accessors & fallbacks #85

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

locale_accessors & fallbacks #85

pwim opened this issue Sep 8, 2017 · 3 comments

Comments

@pwim
Copy link
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
Copy link
Owner

shioyama commented Sep 8, 2017

@shioyama
Copy link
Owner

shioyama commented Sep 8, 2017

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

@shioyama
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants