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

Unable to use I18n backend #5

Open
viveks1422 opened this issue Jan 23, 2016 · 2 comments
Open

Unable to use I18n backend #5

viveks1422 opened this issue Jan 23, 2016 · 2 comments

Comments

@viveks1422
Copy link

Hi @berk ,

I am unable to use I18n backend ymls, like when I am trying to use I18n.backend = I18n::Backend::Tml.new and use this method
=number_to_currency(1000,:locale=>:fr)
It's fallback to :en and I am getting only $ is my currency unit.

Please help me ASAP

Many Thanks

@berk
Copy link
Member

berk commented Jan 24, 2016

@viveks1422, to change the currency unit, you actually have to specify the unit yourself:
<%= number_to_currency(1000, unit: '€') %>
or use the i18n files to overload it for the locale. We currently fallback on to the default i18n system for numbers, distances, etc...

https://github.com/translationexchange/tml-rails/blob/master/lib/i18n/backend/tml.rb#L63

@berk berk closed this as completed Feb 2, 2016
@lysenko
Copy link

lysenko commented Mar 8, 2017

Hello @berk,
We're having similar issue with tml_rails and I18n.
We have a ton of locales with the same language, e.g. es_MX and es_ES; or en_* for the locales/languages we don't have translations yet; etc.
What I'm trying to say, locale != language. We want to use good old I18n for locales and tml_rails for translations. This is why we need them to work together without interference.
This is why I think this commit aba17d9 has a bug.

The I18n.backend.class.name == 'I18n::Backend::Tml' check was removed and now tml is trying to reset I18n locale, even if we don't use I18n::Backend::Tml backend.

I want tml to be a nice guy and touch I18n.locale only when I allow it by using I18n::Backend::Tml backend.

I monkey patched it, do you think my monkey patch can cause some problems? Do you plan to put if I18n.backend.class.name == 'I18n::Backend::Tml' back in place?

Regards,
Anatoliy

@berk berk reopened this Mar 10, 2017
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

3 participants