[ruby on rails] Rails2.0とruby-gettext

Using ruby-gettext with Edge Rails - zargony.com

Rails2.0でruby-gettextを使うと、
・500 Internal Server Errorが発生する。
・Rails2.0の新しいテンプレート *.html.erbのような*.xxx.erb を認識しない。

上記リンク先に解決方法が記載されている。

・500 Internal Server Errorは、rubyのバージョンを1.8.6-p26以降に上げると解決。

・*.xxx.erbについては、lib/tasks/gettext.rakeを以下のように修正する。

※Ruby-GetText-Package-1.90.0でRuby on Rails 2.0に対応して、デフォルトで.erbがERBファイルとして認識されるようになったため、下記対策は不要となった。
よたらぼ(2008-02-03)

require 'gettext/utils'

# Tell ruby-gettext's ErbParser to parse .erb files as well
# See also http://zargony.com/2007/07/29/using-ruby-gettext-with-edge-rails/
GetText::ErbParser.init(:extnames => ['.rhtml', '.erb'])

desc 'Update pot/po files'
task :updatepo do
  GetText.update_pofiles('messages', Dir.glob("{app,lib}/**/*.{rb,rhtml,erb,rjs}"), 'MyApp')
end

desc 'Create mo-files'
task :makemo do
  GetText.create_mofiles(true, 'po', 'locale')
end


トラックバック(0)

このブログ記事を参照しているブログ一覧: Rails2.0とruby-gettext

このブログ記事に対するトラックバックURL: http://www.pistolfly.jp/mt/mt-tb-alt.cgi/257

コメントする