github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

mutoh / gettext_rails

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 20
    • 3
  • Source
  • Commits
  • Network (3)
  • Issues (0)
  • Downloads (6)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (6)
    • 2.1.0
    • 2.0.4
    • 2.0.3
    • 2.0.2
    • 2.0.1
    • 2.0.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Ruby on Rails (>=2.3) localization support with Ruby-GetText-Package. — Read more

  cancel

http://www.rubyforge.org/projects/gettext/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Update ChangeLog. 
mutoh (author)
Fri Nov 13 18:36:47 -0800 2009
commit  181b458aad911a402734e3036c2c30b3386398c7
tree    452ec2c96ad86d0a5dff8fef84e80eab630faa04
parent  b4cf08acda8655f147de54e0389ae41e46101d82
gettext_rails /
name age
history
message
file .gitignore Fri Feb 27 09:36:50 -0800 2009 Initial import. [mutoh]
file COPYING Wed Oct 14 11:10:32 -0700 2009 Update license information (explicit to use Rub... [mutoh]
file ChangeLog Fri Nov 13 18:36:47 -0800 2009 Update ChangeLog. [mutoh]
file README.rdoc Sun Nov 08 06:47:58 -0800 2009 Support Rails-2.3.2,2.3.3,2.3.4. Update README.... [mutoh]
file Rakefile Fri Nov 13 18:36:12 -0800 2009 Update dependencies. [mutoh]
directory lib/ Sun Nov 08 06:47:58 -0800 2009 Support Rails-2.3.2,2.3.3,2.3.4. Update README.... [mutoh]
directory po/ Mon Apr 27 07:43:16 -0700 2009 Add Bart ten Brinke as a Dutch translator. [mutoh]
directory sample/ Sat May 02 10:15:25 -0700 2009 Fixed date_select usage. [mutoh]
directory test/ Sun Nov 08 06:47:58 -0800 2009 Support Rails-2.3.2,2.3.3,2.3.4. Update README.... [mutoh]
README.rdoc

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
  • on rubyforge
  • on github

Requirements

  • Ruby 1.8.3 or later
  • Rubygems
  • locale gem
  • locale_rails gem
  • gettext gem
  • gettext_activerecord gem
  • gettext_rails gem

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 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: www.gnu.org/licenses/lgpl-3.0.txt).

  • Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>

Translators

  • Bosnian(bs) - Sanjin Sehic <saserr at gmail.com>
  • Bulgarian(bg) - Sava Chankov <sava.chankov at gmail.com>
  • Catalan(ca) - Ramon Salvadó <rsalvado at gnuine.com>
  • Chinese(Simplified)(zh_CN)
    • Yang Bob <bob.yang.dev at gmail.com> (current)
    • Yingfeng <blogyingfeng at gmail.com>
  • Chinese(Traditional)(zh_TW)
    • Yang Bob <bob.yang.dev at gmail.com> (current)
    • LIN CHUNG-YI <xmarsh at gmail.com>
  • Croatian(hr) - Sanjin Sehic <saserr at gmail.com>
  • Czech(cs) - Karel Miarka <kajism at yahoo.com>
  • Dutch(nl) - Bart ten Brinke<info at retrosync.com> (current)
                                 Menno Jonkers <ruby-gettext at jonkers.com>
    
  • Esperanto(eo) - Malte Milatz <malte at gmx-topmail.de>
  • Estonian(et) - Erkki Eilonen <erkki at itech.ee>
  • French(fr)
    • Vincent Isambart <vincent.isambart at gmail.com> (current)
    • David Sulc <davidsulc at gmail.com>
    • David Sulc <davidsulc at gmail.com>
    • Laurent Sansonetti <laurent.sansonetti at gmail.com>
  • German(de)
    • Patrick Lenz <patrick at limited-overload.de> (current)
    • Detlef Reichl <detlef.reichl at gmx.org>
    • Sven Herzberg <herzi at abi02.de>
    • Sascha Ebach <se at digitale-wertschoepfung.de>
  • Greek(el) - Vassilis Rizopoulos <damphyr at gmx.net>
  • Hungarian(hu) - Tamás Tompa <tompata at gmail.com>
  • Italian(it)
    • Marco Lazzeri <marco.lazzeri at gmail.com>
    • Gabriele Renzi <surrender_it at yahoo.it>
  • Japanese(ja) - Masao Mutoh <mutomasa at gmail.com>
  • Korean(ko) - Gyoung-Yoon Noh <nohmad at gmail.com>
  • Latvian(lv) - Aivars Akots <aivars.akots at gmail.com>
  • Norwegian(nb) - Runar Ingebrigtsen <runar at mopo.no>
  • Portuguese(Brazil)(pt_BR)
    • Antonio S. de A. Terceiro <terceiro at softwarelivre.org> (current)
    • Joao Pedrosa <joaopedrosa at gmail.com>
  • Russian(ru) - Yuri Kozlov <kozlov.y at gmail.com>
  • Serbian(sr) - Slobodan Paunović" <slobodan.paunovic at gmail.com>
  • Spanish(es)
    • David Espada <davinci at escomposlinux.org> (current)
    • David Moreno Garza <damog at damog.net>
  • Ukrainian(ua) - Alex Rootoff <rootoff at pisem.net>
  • Vietnamese(vi) - Ngoc Dao Thanh <ngocdaothanh at gmail.com>

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 <mutomasa at gmail.com>

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server