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

:scope is not handled properly for inline translations #95

Open
Silex opened this issue Jul 2, 2018 · 0 comments
Open

:scope is not handled properly for inline translations #95

Silex opened this issue Jul 2, 2018 · 0 comments

Comments

@Silex
Copy link
Contributor

Silex commented Jul 2, 2018

This uses the wrong key when doing inline translations:

s = 'person'
t('first_name', scope: s)`

Looking at https://github.com/svenfuchs/i18n/blob/master/lib/i18n/backend/simple.rb#L78, I guess there's a way to use normalize_keys or something else to figure out the scope properly.

Right now I do this workaround:

s = 'person'
t(format('%s.first_name', s))`

Another options could be to handle :scope in https://github.com/prograils/lit/blob/master/lib/lit/i18n_backend.rb#L19, but I'm afraid of breaking many things if I simply go key = format('%s.%s', key, options[:scope] if options[:scope].present?

@Silex Silex changed the title :scope is not handled properly :scope is not handled properly for inline translations Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants