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
a source to share
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.
a source to share
I think you are looking for en-GB :)
https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/en-GB.yml
a source to share