I also tried :
AVAILABLE_LOCALES = ALL_LOCALES.dup
AVAILABLE_LOCALES.delete_if{|key, value| key == I18n.locale }
but get also an error ... dynamic constant assignment (SyntaxError)
with the dup ...
I don't understand as I can do it with irb ....
On 9 fév, 23:06, Erwin <[email protected]> wrote:
> I have a constant set up like that :
> ALL_LOCALES
> => {"it"=>"Italian", "fr"=>"Français", "de"=>"Deutsch", "en-
> GB"=>"English (UK)", "es"=>"Español (España)", "pt-PT"=>"Português",
> "pl"=>"Polski", "en-US"=>"English (US)", "pt-BR"=>"Português
> (Brasil)"}
>
> my locale is set : I18n.locale
> => :"en-US"
>
> based on the current locale , dynamically changed, I would like to
> define a new constant, AVAILABLE_LOCALES which would be the
> ALL_LOCALES minus the current locale...
>
> AVAILABLE_LOCALES
> => {"it"=>"Italian", "fr"=>"Français", "de"=>"Deutsch", "en-
> GB"=>"English (UK)", "es"=>"Español (España)", "pt-PT"=>"Português",
> "pl"=>"Polski", "pt-BR"=>"Português (Brasil)"}
>
> I dont' see how todo that ? any clue ?
>
> thanks a lot fyh
> erwin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---