You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Adding locales to the the load path affects I18n.available_locales #20
That is undesired behavior as some application dynamically figure out the available locales. Providing translations for DateValidator doesn't mean that the rest of the application is translated. None of the common gems are that intrusive and they provide at most english translation.
You can provide the locale files in the gem but do not load them all.
If a translation isn't available in a locale, Rails will fallback to another one.
Another solution would be to only autoload (or provide) en locale file, which would be a little more reliable than importing locale files in the app, which isn't DRY at all.
Rails itself autoloads en translations...as is, the gem doesn't work out of the box.
Activity
txus commentedon Sep 14, 2012
Agree. @klobuczek any thoughts on what would be the best way to make this less intrusive?
migol commentedon May 4, 2013
I think idea here is to actually not load any translations at all because Rails thinks it supports languages it doesn't support.
If a new translation is needed, then developer should pull it from repo or gem and merge into his/hers translation file.
dolzenko commentedon Mar 13, 2014
Can somebody clarify why autoloading en locale was removed? It leads to issues like #44 and makes people copy translations into their own locale files. Checking other gems suggests loading en locale by default is perfectly fine, e.g. https://github.com/mislav/will_paginate/blob/master/lib/will_paginate/railtie.rb#L35
gdlx commentedon Aug 29, 2014
I aggree with @dolzenko and #44: I think this commit should be reverted since Rails now handles i18n fallbacks (https://github.com/svenfuchs/i18n/wiki/Fallbacks#custom-fallback-rules).
If a translation isn't available in a locale, Rails will fallback to another one.
Another solution would be to only autoload (or provide)
enlocale file, which would be a little more reliable than importing locale files in the app, which isn't DRY at all.Rails itself autoloads
entranslations...as is, the gem doesn't work out of the box.kmayer commentedon Nov 29, 2014
+1 to reverse this
Uepsilon commentedon Jan 6, 2015
+1
Don't autoload all locale files. Closes codegram#20