Missing en-UK.yml file for Rails app

I am trying to switch one of my sites to en-UK to get the correct date and currency formats, etc.

I found this yaml file:

http://github.com/mattetti/globalite/blob/master/lang/rails/en-UK.yml

Any ideas if there is a better way to use?

I also checked here but couldn't see it:

http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale

Thanks Nick

+2


a source to share


2 answers


I found a better solution than keeping a duplicate version of en.yml and just changing $ to £.

There is a plugin that only allows you to override the required values:

http://github.com/javan/rails-i18n-translation-inheritance-helper

config / environment.rb

config.i18n.default_locale = 'en-UK'

      

and then create:

config / locales / en-UK.yml - for special cases



en-UK:
  number:
    currency:
      format:
        unit: '£'
        format: '%u%n'

      

config / locales / en.yml - for all translations in English

en:
 btn_submit: Submit

      

This works and it also means that I don't need to keep the file separate from any special cases as described above.

View

=t 'btn_submit' #Submit
=h number_to_currency(@price, :precision => 0) #£1,000

      

Hope this helps others as it takes a while to find a solution.

+3


a source


I think you are looking for en-GB :)



https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/en-GB.yml

0


a source







All Articles