locale_rails/lib/i18n.rb - Ruby/Locale for “Ruby on Rails”
Copyright (C) 2008,2009 Masao Mutoh
You may redistribute it and/or modify it under the same license terms as Ruby or LGPL.
Sets the default locale.
I18n.default_locale = "ja"
# File lib/locale_rails/i18n.rb, line 42 def default_locale=(tag) tag = Locale::Tag::Rfc.parse(tag.to_s) if tag.kind_of? Symbol Locale.default = tag @@default_locale = tag end
Sets the locale.
I18n.locale = "ja-JP"
# File lib/locale_rails/i18n.rb, line 33 def locale=(tag) Locale.clear tag = Locale::Tag::Rfc.parse(tag.to_s) if tag.kind_of? Symbol Locale.current = tag Thread.current[:locale] = Locale.candidates(:type => :rfc)[0] end
Sets the supported locales.
I18n.set_supported_locales("ja-JP", "ko-KR", ...)
# File lib/locale_rails/i18n.rb, line 21 def set_supported_locales(*tags) Locale.set_app_language_tags(*tags) end
Generated with the Darkfish Rdoc Generator 2.