Movable Type/Â裷²óMT¥×¥é¥°¥¤¥óÊÙ¶¯²ñ - ¹ñºÝ²½¡Ê¿¸À¸ì²½¡Ë¤¹¤ëÊýË¡ http://www.ark-web.jp/sandbox/wiki/334.html
Movable Type/Â裷²óMT¥×¥é¥°¥¤¥óÊÙ¶¯²ñ - ¹ñºÝ²½¡Ê¿¸À¸ì²½¡Ë¤¹¤ëÊýË¡
Â裷²ó¤Ï¥×¥é¥°¥¤¥ó¤ò¹ñºÝ²½¡Ê¿¸À¸ì²½¡Ë¤¹¤ëÊýË¡¤ò²òÀ⤷¤Þ¤¹¡£Bootstrap¤Ç¸Æ¤Ó½Ð¤µ¤ì¤ëµ¡Ç½¤ò¿¸À¸ì²½¤ÎÊýË¡¤â²òÀ⤷¤Þ¤¹¡£º£²ó¤Ï»þ´Öû¤¤¤«¤â¤Ç¤¹^^;
Æ°²è¡ÊUstream¡Ë †
ÊÙ¶¯²ñ¤ÎÌÏÍͤò¥¢¥Ã¥×¤·¤Þ¤·¤¿¡£
º£²ó¤Ï»öÁ°¤Ë¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤òÍѰդǤ¤Ê¤¯¤Æ½àÈ÷ÉÔ¤À¤Ã¤¿¤Ç¤¹¤Í¡¢¤¹¤ß¤Þ¤»¤ó¤Ç¤¹¡Ê´À
Ustream¤Î¥Á¥ã¥ó¥Í¥ë¤Ï¤³¤Á¤é¡£
http://www.ustream.tv/channel/mt%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E5%8B%89%E5%BC%B7%E4%BC%9A
¤´´¶ÁÛ¡¦¤´¼ÁÌä¤Ê¤É †
¤´´¶ÁÛ¡¢¤´¼ÁÌä¤Ê¤É¤¢¤ì¤Ð¤ªµ¤·Ú¤Ë¤É¤¦¤¾¡£Äº¤±¤ë¤È¤È¤Æ¤âÎå¤ß¤Ë¤Ê¤ê¤Þ¤¹¡£
ÊÙ¶¯²ñ¤Ç²òÀ⤷¤¿¥×¥í¥°¥é¥à¥³¡¼¥É¤Î¥À¥¦¥ó¥í¡¼¥É †
¥Í¥¿ †
Æü»þ †
- 2008/07/4¡Ê¶â¡Ë 10:30¡Á11:00( or 10:45)
¥×¥é¥°¥¤¥ó¤ò¹ñºÝ²½¡Ê¿¸À¸ì²½¡Ë¤¹¤ëÊýË¡¤Î´ðÁÃŪ¤Ê¤³¤È †
ËÝÌõ¤Î´ðËÜŪ¤Ê»ÅÁÈ¤ß †
Six Apart - µ»½Ñ¾ðÊóÄó¶¡¥Ö¥í¥°: ¥í¡¼¥«¥é¥¤¥ºµ»½Ñ¤Î²òÀâ¤è¤ê¡¢
Movable Type¤Î´ÉÍý²èÌ̤ϡ¢É½¼¨¤¹¤ëÆâÍƤòÄêµÁ¤·¤¿¡Ö¥Æ¥ó¥×¥ì¡¼¥È¡¦¥Õ¥¡¥¤¥ë¡×¤ò¥Æ¥ó¥×¥ì¡¼¥È¡¦¥¨¥ó¥¸¥ó¤¬²òÀÏ¡¢½èÍý¤·¤Æɽ¼¨¤µ¤ì¤Þ¤¹¡£¥Æ¥ó¥×¥ì¡¼¥È¡¦¥¨¥ó¥¸¥ó¤Ï¡¢¥Æ¥ó¥×¥ì¡¼¥È¡¦¥Õ¥¡¥¤¥ë¤Ëµ½Ò¤·¤Æ¤¢¤ëʸ»úÎó¤ò¡¢¸½ºß¤Î¸À¸ì¾ðÊó¡Ê¥í¥°¥¤¥ó¤·¤Æ¤¤¤ëÅê¹Æ¼Ô¤Î¥×¥í¥Õ¥£¡¼¥ë¤Ç»ØÄꤷ¤¿¸À¸ì¤â¤·¤¯¤Ï´Ä¶ÊÑ¿ô DefaultLanguage¤ÎÃ͡ˤò¤â¤È¤Ë¡¢¼½ñ¥Õ¥¡¥¤¥ë¤«¤éËÝÌõ·ë²Ì¤òÃê½Ð¤·¤Æɽ¼¨¤·¤Æ¤¤¤Þ¤¹¡£
¼½ñ¥Õ¥¡¥¤¥ë¤ÎÇÛÃÖ †
¼½ñ¥Õ¥¡¥¤¥ë¤Ï°Ê²¼¤Î¤è¤¦¤ËÇÛÃÖ¤¹¤ë´·Î㤬¤¢¤ê¤Þ¤¹¡£
# ¼½ñ¥Õ¥¡¥¤¥ë¤òÍøÍѤ¹¤ë¤¿¤á¤Î¥Ñ¥Ã¥±¡¼¥¸ MT_DIR/plugins/[¥×¥é¥°¥¤¥ó̾]/lib/[¥×¥é¥°¥¤¥ó̾]/L10N.pm # ¸À¸ìÊ̤μ½ñ¥Õ¥¡¥¤¥ë MT_DIR/plugins/[¥×¥é¥°¥¤¥ó̾]/lib/[¥×¥é¥°¥¤¥ó̾]/L10N/en_us.pm # ±Ñ¸ì MT_DIR/plugins/[¥×¥é¥°¥¤¥ó̾]/lib/[¥×¥é¥°¥¤¥ó̾]/L10N/ja.pm # ÆüËܸì
³Æ¥Õ¥¡¥¤¥ë¤Î¹½Â¤¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£²¾¤Ë¥×¥é¥°¥¤¥ó̾¤òMyPlugin¤È¤·¤Þ¤¹¡£
L10N.pm
package MyPlugin::L10N; use strict; use base qw( MT::Plugin::L10N ); 1;
L10N/en_us.pm
package MyPlugin::L10N::en_us; use strict; use base qw( MyPlugin::L10N ); use vars qw( %Lexicon ); %Lexicon = ( # ¼½ñÄêµÁ ); 1;
L10N/ja.pm
package MyPlugin::L10N::ja; use strict; use base qw( MyPlugin::L10N::en_us ); use vars qw( %Lexicon ); %Lexicon = ( # ¼½ñÄêµÁ ); 1;
MT::Plugin::L10N -> MyPlugin::L10N -> MyPlugin::L10N::en_us -> MyPlugin::L10N::ja¤È·Ñ¾µ¤·¤Æ¤¤¤Þ¤¹¡£¤³¤ì¤Ë¤è¤Ã¤ÆÆüËܸì¤Î¼½ñÄêµÁ¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ç¤â±Ñ¸ì¤ÎÄêµÁ¤¬»È¤ï¤ì¡¢¤½¤ì¤â¤Ê¤±¤ì¤ÐMT::Plugin::L10N¤ÎÄêµÁ¤¬ÍøÍѤµ¤ì¤Þ¤¹¡£
¸À¸ìÊ̤μ½ñ¥Õ¥¡¥¤¥ë¤Ë¤Ï¾¤Ë¤â¡¢fr.pm¡Ê¥Õ¥é¥ó¥¹¸ì¡Ë¡¢de.pm¡Ê¥É¥¤¥Ä¸ì¡Ë¡¢es.pm¡Ê¥¹¥Ú¥¤¥ó¸ì¡Ë¡¢nl.pm¡Ê¥ª¥é¥ó¥À¸ì¡Ë¤¬ÄêµÁ¤Ç¤¤Þ¤¹¡£
¼½ñÄêµÁ¤Î½ñ¼° †
¼½ñÄêµÁ¤Î½ñ¼°¤Ï%Lexicon¤È¤¤¤¦¥Ï¥Ã¥·¥å¤Î¥¡¼¤ËÂоݤÎʸ»úÎó¡Ê¥Õ¥ì¡¼¥º¡Ë¤ò¡¢ÃͤËÊÑ´¹·ë²Ì¤òÄêµÁ¤·¤Æʤ٤ë·Á¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
%Lexicon = ( 'Close' => 'ÊĤ¸¤ë', # ʸ¾Ï¤â¥¡¼¤Ë¤Ç¤¤ë¡£'¤Î¥¨¥¹¥±¡¼¥×¤ËÃí°Õ 'Hello, MT\'s World' => 'MT¤ÎÀ¤³¦¤Ë¤è¤¦¤³¤½', : );
±Ñ¸ì¡Êen_us.pm¡Ë°Ê³°¤Î¸À¸ì¤Î¼½ñ¥Õ¥¡¥¤¥ë¤Ïen_us.pm¤ò·Ñ¾µ¤·¤ÆÄêµÁ¤·¤Þ¤¹¡£¤³¤¦¤¹¤ë¤³¤È¤Ç¡¢Àè¤Ë½Ò¤Ù¤Þ¤·¤¿¤¬¡¢ÂоݤΥ¡¼¤ËÂФ¹¤ëÌõ¤¬¤Ê¤¤¾ì¹ç¤Ç¤â¡¢±Ñ¸ì¤Î¥Õ¥ì¡¼¥º¤¬»È¤ï¤ì¤Þ¤¹¡£
¼½ñ¥Õ¥¡¥¤¥ë¤Î»È¤¤Êý †
¼½ñ¥Õ¥¡¥¤¥ë¤ò»È¤¦¤Ë¤Ï¡¢¥×¥é¥°¥¤¥óËÜÂΤΥץ饰¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È¤Înew¤Ç
my $plugin = new MT::Plugin::MyPlugin({ : l10n_class => 'MyPlugin::L10N', : }); MT->add_plugin($plugin);
¤Î¤è¤¦¤Ël10n_class¤Ë¼½ñ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥Ã¥±¡¼¥¸(MT::Plugin::L10N¤ò·Ñ¾µ¤·¤¿¥Ñ¥Ã¥±¡¼¥¸¡Ë¤ò»ØÄꤷ¤Þ¤¹¡£
¤Þ¤¿¡¢¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤Ï
<MT_TRANS phrase="ËÝÌõÂоݤÎʸ»úÎó¡Ê¥Õ¥ì¡¼¥º¡Ë">
¤Þ¤¿¤Ï
<__trans phrase="ËÝÌõÂоݤÎʸ»úÎó¡Ê¥Õ¥ì¡¼¥º¡Ë">
¤Èµ½Ò¤·¤Þ¤¹¡£¥Æ¥ó¥×¥ì¡¼¥È¥¨¥ó¥¸¥ó¤Ïphrase¤ÎÃͤËÂбþ¤¹¤ë¼½ñÄêµÁ¤òõ¤·¡¢¤¢¤ì¤ÐËÝÌõ¡¢¤Ê¤±¤ì¤Ðphrase¤ÎÃͤò¤½¤Î¤Þ¤Þ½ÐÎϤ·¤Þ¤¹¡£¤¿¤À¤·¡¢_¤Ç»Ï¤Þ¤ë¥Õ¥ì¡¼¥º*1¤Ï±Ñ¸ì¤Ë¤âÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡£
¥¹¥¯¥ê¥×¥ÈÆâ¤Ç¤âËÝÌõ½èÍý¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤¤Þ¤¹¡£MT::Plugin¤Îtranslate¥á¥½¥Ã¥É¤òÍøÍѤ·¤Þ¤¹¡£
Bootstrap¤Ç¼Â¸½¤µ¤ì¤ëµ¡Ç½¤Î¹ñºÝ²½¡Ê¿¸À¸ì²½¡Ë †
¥×¥é¥°¥¤¥ó¤Î¼½ñ¥Õ¥¡¥¤¥ë¤òÍøÍѤ·¤Þ¤¹¡£
Bootstrap¤Ç¼¡¤Î¤è¤¦¤ËMyCGI¤È¤¤¤¦¥¯¥é¥¹¤¬µ¯Æ°¤µ¤ì¤ë¤È¤·¤Þ¤¹¡£
use strict; (...) use MT::Bootstrap App => 'MyCGI';
¤½¤·¤Æ¡¢plugins/MyCGI/MyCGI.pm¤Ç¥×¥é¥°¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È¤Î»²¾È¤ò¼èÆÀ¤·¤Þ¤¹¡£
package MyCGI; (...) $MyCGI::plugin = new MT::Plugin::MyCGI({ id => 'MyCGI', l10n_class => 'MyCGI::L10N' });
¸å¤Ï¡¢¤³¤Î¥×¥é¥°¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È¤Î»²¾È¤ò»È¤Ã¤Æ¡¢½ÐÎϤòÊÖ¤¹Á°¤Ëtranslate¤·¤Æ¤¢¤²¤Þ¤¹¡£
# ¥Æ¥ó¥×¥ì¡¼¥È¤ò¥í¡¼¥É¤· my $html = $app->load_tmpl('mycgi.tmpl', \%param); # ËÝÌõ¤·¤ÆÊÖ¤¹¡Ê̤¸¡¾Ú^^;¡Ë return $MyCGI::plugin->translate($html->text));
¼¡²óͽÄê †
¼¡²ó¤Ïregistry¥á¥½¥Ã¥É¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¤ò°ìÄ̤긫¤Æ¤¤¤¤¿¤¤¤È»×¤¤¤Þ¤¹¡£¤ª¤½¤é¤¯Ä¹¤¯¤Ê¤ë¤È»×¤¤¤Þ¤¹¤Î¤Ç¡¢2¡Á3²ó¤Ë¤ï¤±¤ë¤È»×¤¤¤Þ¤¹¡£