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

Invalid rails locale translation #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Invalid rails locale translation #12

wants to merge 3 commits into from

Conversation

fjsanpedro
Copy link

There is a problem with composed locale names (i.e. en-US). With the current code it is necessary to set the default_locale to en_US which is an invalid locale for rails.

I move the locale translation to the file_client which is the component who really need to translate en-US to en_US.

To sum up:

  • Rails locale folder should look (and will be stored also) similar to this:
/config
  en-US.yml
  /onesky_es-ES/
    es-ES.yml
  • Rails application.rb should look like this (to select en-US.yml as default):
config.i18n.default_locale = :"en-US"
config.i18n.load_path += Dir[Rails.root.join('config','locales', '**/*.{rb,yml}')] #To load locales in onesky folders

which is an invalid locale code (and rails complains about it)
With the funcion removed, you will compare
"en-US" (locale code retrieved from OneSky) == "en-US" (Rails App) which is true
…s locale format.

Remember, the default_locale is en-US but we want to store the content in files with
name like en_US.yml
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

Successfully merging this pull request may close these issues.

1 participant