= gettext_rails gettext_rails provides the localization for Ruby on Rails-2.3 or later using Ruby-GetText-Package. * Autodetect client locale using locale/locale_rails. * Easy maintainance of translations to use powerful tools for gettext family. * Model translation using gettext_activerecord. * Localization for some helpers. * Works with other Rails I18n backend. * Note that gettext_rails is not the one of I18n backend. * Thread safe. == Website * homepage[http://www.yotabanana.com/hiki/ruby-gettext.html] * on rubyforge[http://gettext/rubyforge.org/] * on github[http://github.com/mutoh/gettext_rails/tree/master] == Requirements * {Ruby 1.8.3 or later}[http://www.ruby-lang.org] * {Rubygems}[http://www.rubygems.org/] * {locale gem}[http://rubyforge.org/projects/locale/] * {locale_rails gem}[http://rubyforge.org/projects/locale_rails/] * {gettext gem}[http://rubyforge.org/projects/gettext/] * {gettext_activerecord gem}[http://rubyforge.org/projects/gettext/] * {gettext_rails gem}[http://rubyforge.org/projects/gettext/] == Install #Uninstall old gettext if exists. (sudo/su on POSIX system) gem uninstall gettext #from github (edge/unstable) (not supported yet) (sudo/su on POSIX system) #gem install mutoh-gettext_rails -s http://gems.github.com/ #from rubyforge (stable) (sudo/su on POSIX system) gem install gettext_rails == Usage See sample direcotries for more details. ==== Rakefile require 'rubygems' desc "Create mo files" task :makemo do require 'gettext_rails/tools' GetText.create_mofiles end task :updatepo do require 'gettext_rails/tools' # Need to access DB to find Model table/column names. # Use config/database.yml which is the same style with rails. GetText.update_pofiles("sample_rails", ["topic.rb"], "sample_rails 1.0.0") end ==== config/environment.rb Rails::Initializer.run do |config| : : config.gem "locale" config.gem "locale_rails" config.gem "gettext" config.gem "gettext_activerecord" config.gem "gettext_rails" end ==== application_controller.rb class ApplicationController < ActionController::Base init_gettext "blog" # replace "blog" to your textdomain name. end ==== Then ... $ rake updatepo $ cd po $ mkdir ja $ msginit -l ja_JP.UTF-8 -i blog.pot -o ja/sample.po $ Edit ja/sample.po $ cd ../../ $ rake makemo $ ruby sample.rb See {Ruby-GetText-Package HOWTO for Ruby on Rails}[http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html] for more details. == Support matrix * gettext_rails-2.1.0 - rails-2.3.2,2.3.3,2.3.4 * gettext_rails-2.0.2 - rails-2.3.2 * gettext_rails-2.0.1 - rails-2.3.2 * gettext_rails-2.0.0 - rails-2.3.2 == License This program is licenced under the same licence as Ruby(See COPYING) or LGPL(Lesser General Public License: http://www.gnu.org/licenses/lgpl-3.0.txt). * Copyright (C) 2001-2009 Masao Mutoh == Translators * Bosnian(bs) - Sanjin Sehic * Bulgarian(bg) - Sava Chankov * Catalan(ca) - Ramon Salvadó * Chinese(Simplified)(zh_CN) * Yang Bob (current) * Yingfeng * Chinese(Traditional)(zh_TW) * Yang Bob (current) * LIN CHUNG-YI * Croatian(hr) - Sanjin Sehic * Czech(cs) - Karel Miarka * Dutch(nl) - Bart ten Brinke (current) Menno Jonkers * Esperanto(eo) - Malte Milatz * Estonian(et) - Erkki Eilonen * French(fr) * Vincent Isambart (current) * David Sulc * David Sulc * Laurent Sansonetti * German(de) * Patrick Lenz (current) * Detlef Reichl * Sven Herzberg * Sascha Ebach * Greek(el) - Vassilis Rizopoulos * Hungarian(hu) - Tamás Tompa * Italian(it) * Marco Lazzeri * Gabriele Renzi * Japanese(ja) - Masao Mutoh * Korean(ko) - Gyoung-Yoon Noh * Latvian(lv) - Aivars Akots * Norwegian(nb) - Runar Ingebrigtsen * Portuguese(Brazil)(pt_BR) * Antonio S. de A. Terceiro (current) * Joao Pedrosa * Russian(ru) - Yuri Kozlov * Serbian(sr) - Slobodan Paunović" * Spanish(es) * David Espada (current) * David Moreno Garza * Ukrainian(ua) - Alex Rootoff * Vietnamese(vi) - Ngoc Dao Thanh == Status of translations * Bosnian(bs) - 1.90.0 (old) * Bulgarian(bg) - 2.0.0 * Catalan(ca) - 2.0.0 * Croatian(hr) - 1.90.0 (old) * Chinese(zh_CN) - 2.0.0 * Chinese(zh_TW) - 2.0.0 * Czech(cs) - 1.9.0 (old) * Dutch(nl) - 2.0.2 * English(default) - 1.90.0 (old) * Esperanto(eo) - 2.0.0 * Estonian(et) - 2.0.0 * French(fr) - 2.0.0 * German(de) - 2.0.0 * Greek(el) - 2.0.0 * Hungarian(hu) - 2.0.0 * Italian(it) - 1.6.0 (old) * Japanese(ja) - 2.1.0 * Korean(ko) - 1.9.0 (old) * Latvian(lv) - 2.0.0 * Norwegian(nb) - 2.0.0 * Portuguese(Brazil)(pt_BR) - 2.0.0 * Russian(ru) - 2.0.0 * Serbian(sr) - 1.91.0 (old) * Spanish(es) - 2.0.0 * Ukrainian(ua) - 2.0.0 * Vietnamese(vi) - 2.0.0 == Maintainer Masao Mutoh