2007年12月アーカイブ
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
カテゴリー:
php.ini
;expose_php=On expose_php=Offhttpd.conf
#ServerTokens OS ServerTokens ProductOnly
以下の条件を満たせば、外部ファイルに対する読み込み宣言なしで、クラスが参照された瞬間に自動的に読み込まれる。
・ロードパス上にファイルを配置する。
・クラス(モジュール)名をアンダースコア化したファイル名にクラスを定義する。(アンダースコア化はActiveSupportのString#underscore, String#classifyで確認できる)


最近のコメント