Rails2.0でgettext(windows)

Railsアプリケーションの国際化(日本語表示)
Mac OSX + Rails 2.1 に gettext 1.91 を使おうとしてたら駄目で「むーん」だったんだけど、windows + Rails2.0.2 でやってみたら出来た!やっぱりversionだったかぁ。自宅のMacもRailsのversion下げてやり直してみよう。

プロンプトを起ち上げて以下のコマンドでgettextをインストール
複数選択肢が表示される中で「gettext 1.91.0(ruby)」を選択した

gem install gettext

config/environment.rbの末尾(endの後に)に次の一行を追加

require 'gettext/rails'

app/controller/application.rb内にある
helper :all # include all helpers, all the timeの後に
init_gettext “任意の文字列”
を追加

class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time
  init_gettext "任意の文字列"
 

Tags:

Comments

No comments so far.

  • Leave a Reply
     
    Your gravatar
    Your Name
     
     
     

    コメントリンクを nofollow free に設定することも出来ます。