Skip to content

Invalid rails locale translation#12

Open
fjsanpedro wants to merge 3 commits into
onesky:masterfrom
MarsBased:invalid_rails_locale_translation
Open

Invalid rails locale translation#12
fjsanpedro wants to merge 3 commits into
onesky:masterfrom
MarsBased:invalid_rails_locale_translation

Conversation

@fjsanpedro
Copy link
Copy Markdown

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