- 2009年1月11日 11:44 AM
- RoR
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 "任意の文字列"
コメント:0
トラックバック:0
- この記事のトラックバック URL
- http://showzine.info/blog/2009/01/rails20%e3%81%a7gettextwindows.html/trackback
- トラックバックの送信元リスト
- Rails2.0でgettext(windows) - SHOWJIN*BLOG より