履歴: ソフトウェア/rails/言語ネゴシエーション

各行は、その日時に書かれた内容です。追加・削除は、1 つ前の版との行数の差です (全 21 版)。「差分」は比較する版、「基準」は比べる相手の版を選びます

日時タイトル文字数追加削除内容差分基準
2014/5/20 19:20:23ソフトウェア/rails/言語ネゴシエーション 最新版3,891+1 -1表示差分—
2014/5/20 19:20:23ソフトウェア/rails/言語ネゴシエーション 3,897+8 -1表示差分選択
2013/1/5 18:30:15ソフトウェア/rails/言語ネゴシエーション 3,842+3 -0表示差分選択
2009/7/14 9:35:50ソフトウェア/rails/言語ネゴシエーション 3,732+43 -27表示差分選択
2009/7/11 15:06:20ソフトウェア/rails/言語ネゴシエーション 3,727+9 -0表示差分選択
2009/6/28 2:02:38ソフトウェア/rails/言語ネゴシエーション 3,515+2 -0表示差分選択
2009/6/27 8:15:42ソフトウェア/rails/言語ネゴシエーション 3,458+4 -0表示差分選択
2009/6/21 9:14:00ソフトウェア/rails/言語ネゴシエーション 3,403+15 -0表示差分選択
2009/6/21 6:41:27ソフトウェア/rails/言語ネゴシエーション 3,126+62 -2793表示差分選択
2009/6/10 11:14:13ソフトウェア/rails/言語ネゴシエーション 84,051+327 -1表示差分選択
2009/6/10 3:14:21ソフトウェア/rails/言語ネゴシエーション 73,730+459 -3表示差分選択
2009/6/9 15:42:54ソフトウェア/rails/言語ネゴシエーション 58,379+247 -473表示差分選択
2009/6/9 11:29:37ソフトウェア/rails/言語ネゴシエーション 66,074+317 -40表示差分選択
2009/6/8 20:22:16ソフトウェア/rails/言語ネゴシエーション 58,607+75 -2表示表示中選択
2009/6/8 15:18:39ソフトウェア/rails/言語ネゴシエーション 55,917+958 -223表示差分基準
2009/6/8 8:00:44ソフトウェア/rails/言語ネゴシエーション 33,858+247 -35表示差分選択
2009/6/7 13:55:06ソフトウェア/rails/言語ネゴシエーション 28,314+195 -18表示差分選択
2009/6/7 4:15:30ソフトウェア/rails/言語ネゴシエーション 23,332+140 -3表示差分選択
2009/6/6 14:50:13ソフトウェア/rails/言語ネゴシエーション 19,622+30 -27表示差分選択
2009/6/6 6:50:47ソフトウェア/rails/言語ネゴシエーション 19,701+581 -3表示差分選択
2009/6/6 2:59:56ソフトウェア/rails/言語ネゴシエーション 2,869— —表示—選択

基準: ソフトウェア/rails/言語ネゴシエーション (2009/6/8 15:18:39) → 比較: ソフトウェア/rails/言語ネゴシエーション (2009/6/8 20:22:16)

@@ -10,7 +10,7 @@
rails アプリケーションの多言語化する方法を調べてみた。
rails のバージョンが上がっているせいと、それ以外の問題とで、
-結局かなりの部分を1から書いたのでメモメモ。
+結局かなりの部分を1から書いたのでメモしておく。
やりたい内容としては
+ views/*/*.html.ja.erb と views/*/*.html.en.erb とを両方作っておき、
@@ -1885,7 +1885,7 @@
残るはドキュメントとテストケースだ。
-* テスト [#z90f29b8]
+* テストケース [#z90f29b8]
プラグインのテストケースを書かなければ。
@@ -1937,7 +1937,80 @@
end
end
+* 手動テスト [#wd595311]
+ LANG:console
+ $ jed app/controllers/test_controller.rb
+ class TestController < ApplicationController
+ caches_page :pagecached
+ caches_action :actioncached
+ def index
+ end
+ def pagecached
+ end
+ def actioncached
+ end
+ def fragmentcached
+ end
+ def onlyja
+ end
+ def rendereaction
+ render :action=>:onlyja
+ end
+ def renderfile
+ render :file=>"renderfile_"
+ end
+ end
+ $ echo "Test <%= render :partial=>'ok' %>" > app/views/test/index.html.en.erb
+ $ echo "テスト <%= render :partial=>'ok' %>" > app/views/test/index.html.ja.erb
+ $ echo "Page cached" > app/views/test/pagecached.html.en.erb
+ $ echo "ページキャッシュ" > app/views/test/pagecached.html.ja.erb
+ $ echo "Action cached" > app/views/test/actioncached.html.en.erb
+ $ echo "アクションキャッシュ" > app/views/test/actioncached.html.ja.erb
+ $ echo "Fragment cached" > app/views/test/fragmentcached.html.en.erb
+ $ echo "フラグメントキャッシュ" > app/views/test/fragmentcached.html.ja.erb
+ $ echo "日本語のみ" > app/views/test/onlyja.html.ja.erb
+ $ echo "File" > app/views/test/renderfile_.html.en.erb
+ $ echo "ファイル" > app/views/test/renderfile_.html.ja.erb
+ $ rm public/test*
+ rm: cannot remove `public/test*': そのようなファイルやディレクトリはありません
+ $ alias wgetc="wget -qO- --load-cookies=tmp/wget.cookie --save-cookies=tmp/wget.cookie --keep-session-cookies --header='ACCEPT: text/html'"
+ $ jed public/.htaccess
+ RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
+ $ wgetc --header="Accept-Language: en" http://localhost/negotiation/test
+ エラー: no route to "/negotiation/test"
+
+うまくいかない。。。
+
+ vendor/actionpack/CHANGELOG
+ *2.2 (November 21st, 2008)*
+ * AbstractRequest.relative_url_root is no longer automatically configured
+ by a HTTP header. It can now be set in your configuration environment with
+ config.action_controller.relative_url_root [Josh Peek]
+
+これみたい?~
+でもなんで fcgi の時だけだめなんだろう?
+
+ LANG:console
+ $ echo 'config.action_controller.relative_url_root = "/negotiation"' >> environments/production.rb
+ $ wgetc --header="Accept-Language: en" http://localhost/negotiation/test
+ 日本語: テスト ばっちり
+ $ rm tmp/wget.cookie
+ $ wgetc --header="Accept-Language: en" http://localhost/negotiation/test
+ English: Test OK
+ $ wgetc --header="Accept-Language: en" http://localhost/negotiation/test.ja
+ 日本語: テスト ばっちり
+ $ wgetc --header="Accept-Language: en" http://localhost/negotiation/test
+ 日本語: テスト ばっちり
+ $ wgetc http://localhost/negotiation/test/pagecached
+ 日本語: ページキャッシュ
+ $ ls public/test/*
+ public/test/pagecached.html.ja
+ $ wgetc http://localhost/negotiation/test/pagecached.en
+ English: Page cached
+ $ ls public/test/*
+ public/test/pagecached.html.en public/test/pagecached.html.ja
+
* コメント [#kfcbe2ab]
気づいた点など、ぜひとも突っ込みを入れて下さい。