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 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 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 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.