MacOS X10.5 Leopardç°å¢ã«Ruby-GetTextãã¤ã³ã¹ãã¼ã«ãã
Railsã使ããªããRuby GetTextãã¤ã³ã¹ãã¼ã«ããã¦ããã¨ããããããªé¢ã§å¹¸ãã«ãªããgettextæ¬æ¥ã®ç®çã¯å¤è¨èªåã ãã翻訳æååãæ½åºãã¦ç½®ãæããã¨ããæ©è½ã¨ãã¼ã«ã¯ããã以å¤ã®ç®çã«ã便å©ã«ä½¿ããã
- æ¥æ¬èªãå¥ã®æ¥æ¬èªã«ç½®ãæããã¨ãã使ãæ¹ããããéçºãã¦ããã¨ãã¼ã¸ä¸ã«è¡¨è¨ãããåèªããå¥ã®è¨ãåãã«çµ±ä¸ããããªããã¨ãããããããããªæã«ä¾¿å©ã
- ã¨ã©ã¼è¡¨ç¤ºãã«ã¹ã¿ãã¤ãºããã¨ããRuby-GetTextãæä¾ãã¦ããã %{fn} ã¯ã¨ã¦ã便å©ã以ä¸ã®ããã«ç½®ãæããããã
- %{fn}ã¯ãã¨ã©ã¼ãçºçãã¦ãããã£ã¼ã«ãåï¼ãã£ã¼ã«ãåãæååã®å é ã ãã§ãªãã好ã¿ã®ä½ç½®ã«è¨å®ã§ãããï¼
- ã¡ãªã¿ã«æ¨æºæ©è½ã ãã%d㯠validates_length_of ã使ç¨ããéã®æ¤è¨¼æ°å¤ã«ãªãã
- error_message_onã使ã£ãã¨ããããã©ã«ãã§ä¸»èªããã®ã¨ã©ã¼ã¡ãã»ã¼ã¸ã«ãã¦ãããã
ãªã©ãªã©ãã ããã10.5ç°å¢ã«ãæ©éã¤ã³ã¹ãã¼ã«ãã¦ããã
Ruby GetTextã®ã¤ã³ã¹ãã¼ã«
- ã³ãã³ããµã¼ããã¹ã®ç¢ºèªãOSã¤ã³ã¹ãã¼ã«ç´å¾ã®ä»¥ä¸ã®ãã¹ã表示ãããç°å¢ã
MacBook:~ zari$ echo $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
- Ruby gemãå©ç¨ãã¦ã¤ã³ã¹ãã¼ã«
- gemã³ãã³ãå®è¡å¾ããã¼ã¸ã§ã³ãªã¹ãã表示ãããã®ã§ãææ°çã¨æããã1ãé¸æããã
- ãã¦ã³ãã¼ããå§ã¾ãããã°ããããã¨ã¤ã³ã¹ãã¼ã«å®äºã
MacBook:~ zari$ sudo gem install gettext Password: Select which gem to install for your platform (universal-darwin9.0) 1. gettext 1.10.0 (ruby) 2. gettext 1.10.0 (mswin32) 3. gettext 1.9.0 (mswin32) 4. gettext 1.9.0 (ruby) 5. Skip this gem 6. Cancel installationBuilding native extensions. This could take a while... Successfully installed gettext-1.10.0GNU gettextã®ã¤ã³ã¹ãã¼ã«
Ruby GetTextãå©ç¨ãããªããå¿ ããã¢ã§ã¤ã³ã¹ãã¼ã«ãã¦ããããã*1
- gettextã®ãã¼ã¸ããダウンロードサイトリストã§è¿ãã®ãã©ã¼ãµã¤ããæ¢ããã
- æ¥æ¬ã®ãã©ã¼ãµã¤ããã gettextãã©ã«ã ãéãã¦ãææ°çã¨æããã gettext-0.17.tar.gz ããã¦ã³ãã¼ãããã
- ãã¦ã³ãã¼ãããã解åãã¦ãããï¼gettext-0.17ãã©ã«ããçºçãï¼
- ã¿ã¼ããã«ã§ä»¥ä¸ã®æä½ãå®è¡ãããï¼configureãmakeãmake installã¨ãã...ä¸ç¥... ã§çµæ§ãªæéãããããï¼
MacBook:~ zari$ cd ~/Downloads/gettext-0.17 MacBook:gettext-0.17 zari$ ./configure ...ï¼ä¸ç¥ï¼... MacBook:gettext-0.17 zari$ make ...ï¼ä¸ç¥ï¼... MacBook:gettext-0.17 zari$ sudo make install ...ï¼ä¸ç¥ï¼...使ãæ¹
gettextで以前の日記を検索ããã¨ãèªåã試è¡é¯èª¤ããçµæããçµæ§åºã¦ãããåãã¦ä½¿ãå ´åã¯ãGetTextで日本語化してみる辺ãããå¤å°ã¯åèã«ãªããããããªã...ã
*1:ç¡ãã¦ãåä½ã«åé¡ã¯ç¡ããã翻訳æååã追å ã¢ãããã¼ãããæã«å°ã£ããã¨ã«ãªããGNU gettextãç¡ãã¨ãããã¾ã§ã®ç¿»è¨³æååã¨ãã¼ã¸ããããæ°è¦poãã¡ã¤ã«ã«ç½®ãæãããã¦ãã¾ãã以åããããç¥ããã«å®è¡ãã¦ãã¾ããä»ã¾ã§ã®ç¿»è¨³æååãæ¶ãã¦ãã¾ããæ²ããæãããããã¨ãããã