Module | GetText::Rails |
In: |
lib/gettext/rails.rb
|
GetText::Rails supports Ruby on Rails. You add only 2 lines in your controller, all of the controller/view/models are targeted the textdomain.
See <Ruby-GetText-Package HOWTO for Ruby on Rails (www.yotabanana.com/hiki/ruby-gettext-howto-rails.html>.
Rails | = | ::Rails #:nodoc: |
bindtextdomain | -> | _bindtextdomain |
Returns locales which supported by the application. This function returns an reversed array of the locale strings under RAILS_ROOT/locale/*. It is used for restriction such as caching files.
Bind a textdomain(#{path}/#{locale}/LC_MESSAGES/#{domainname}.mo) to your program. Notes the textdomain scope becomes all of the controllers/views/models in your app. This is different from normal GetText.bindtextomain.
Usually, you don‘t call this directly in your rails application. Call init_gettext in ActionController::Base instead.
On the other hand, you need to call this in helpers/plugins.
Returns a normalized locale which is in available_locales.