Rails 3.1 list of supported locales

223 views
Skip to first unread message

vhochstein

unread,
Jun 24, 2011, 5:25:38 PM6/24/11
to rails-i18n
Hi,

1. What s the best way to get a list of all supported locales in a
rails 3.1 app?
2. What s the best way to iterate them to generate javascript code for
each locale using corresponding translations?

Thanks a lot in advance..
Volker

Iain Hecker

unread,
Jun 25, 2011, 2:57:01 AM6/25/11
to rails...@googlegroups.com
Hi Volker,

There is no real limit to which locales are supported, you can create
your own if you like. A good list of pre-made translations for rails
are available at: https://github.com/svenfuchs/rails-i18n

You can get a list of all locales for which you have translations with
`I18n.available_locales`.

-- iain

> --
> You received this message because you are subscribed to the Google Groups "rails-i18n" group.
> To post to this group, send email to rails...@googlegroups.com.
> To unsubscribe from this group, send email to rails-i18n+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rails-i18n?hl=en.
>
>

Ciur Eugen

unread,
Jun 25, 2011, 3:20:48 AM6/25/11
to rails...@googlegroups.com
Hi,

Just wanted to add to Iain answer,  that locale can be whatever come to your mind. For example: I18n.locale = :bonus_language_ex
just make sure your have yaml file bonus_language_ex.yml in your locale (this is if you use simple locale).

vhochstein

unread,
Jun 30, 2011, 4:02:54 AM6/30/11
to rails-i18n
Hi,

thanks a lot will try out available_locales call.

--
Volker

My question was more like, which locales are actually supported by an
application.

On Jun 25, 9:20 am, Ciur Eugen <ciur.eu...@gmail.com> wrote:
> Hi,
>
> Just wanted to add to Iain answer,  that locale can be whatever come to your
> mind. For example: I18n.locale = :bonus_language_ex
> just make sure your have yaml file bonus_language_ex.yml in your locale
> (this is if you use simple locale).
>
>
>
>
>
>
>
>
>
> On Sat, Jun 25, 2011 at 9:57 AM, Iain Hecker <i...@iain.nl> wrote:
> > Hi Volker,
>
> > There is no real limit to which locales are supported, you can create
> > your own if you like. A good list of pre-made translations for rails
> > are available at:https://github.com/svenfuchs/rails-i18n
>
> > You can get a list of all locales for which you have translations with
> > `I18n.available_locales`.
>
> > -- iain
>
> > On Fri, Jun 24, 2011 at 23:25, vhochstein <vhochst...@googlemail.com>
Reply all
Reply to author
Forward
0 new messages