fallback method not working in i18n-js with rails 2.3


fallback method not working in i18n-js with rails 2.3



I am integrating I18n-js in a Rails application. The integration is working fine along with the translations.But the problem I am facing is that when the required translation is not present in a particular language , say for example I selected Afrikaans as my language then in that case the fallback method should execute showing me the translation present in the default language.But its not happening and I get the error



[missing "af.credential_requests.add" translation]



This surely means that the fallbacks method is not working.
Though I have


I18n.fallbacks = true;



in my I18n-js. Please help.
I have my default locale set to "en"




2 Answers
2



Make sure that you set I18n.defaultLocale correctly


I18n.defaultLocale





The I18n.defaultLocale is set correctly.
– Anirudh Rautela
Nov 19 '13 at 6:19



I'm having the same issue using this gem at version 3.0.9 and Rails 5.2.




I18n.currentLocale()
"en-AU"
I18n.defaultLocale
"en"



I18n.currentLocale()
"en-AU"
I18n.defaultLocale
"en"



and in the config/i18n-js.yml I've tried these options but none of them worked:



fallbacks: true


fallbacks: true



fallbacks:["en-AU", "en"]


fallbacks:["en-AU", "en"]



fallbacks:
"en-AU": "en"


fallbacks:
"en-AU": "en"



Any suggestions?






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Opening a url is failing in Swift

Export result set on Dbeaver to CSV