OSDN Git Service

- added _getDefaultLanguage method to skel/app.controller.php.
authormumumu-org <mumumu-org@2ef88817-412d-0410-a32c-8029a115e976>
Wed, 21 May 2008 23:53:35 +0000 (23:53 +0000)
committermumumu-org <mumumu-org@2ef88817-412d-0410-a32c-8029a115e976>
Wed, 21 May 2008 23:53:35 +0000 (23:53 +0000)
CHANGES
class/Plugin/Generator/Ethna_Plugin_Generator_Project.php
skel/app.controller.php

diff --git a/CHANGES b/CHANGES
index a133f90..3cb5ded 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -13,6 +13,7 @@
 -- [Breaking B.C] gettext を使用する際には [appid]/etc/[appid]-ini.php で 'use_gettext' => true と設定しないと gettext を使わないようにした
 --- 2.3.5 までのコードは、gettext.so がロードされていれば *無条件に* gettext が実行されるようになっているので、Ethna 独自のメッセージカタログとの選択がわかりづらいため。
 --- 2.3.5までのコードで gettext を利用している場合は、設定が明示的に必要です。
+-- "ethna add-project" コマンドに [-l|locale] オプションを追加
 -- スケルトンの日本語コメントをすべてASCIIに変更(好みのエンコーディングで編集できるようにするため)
 - [Breaking B.C] レンタルサーバを考慮して、[appid]_Controllerの include_path を、[appid]/lib を優先するように変更
 -- include_path の順番に依存するコードは少ないとは思いますが、移行の際は注意すべきです。
index 816399c..875bfea 100644 (file)
@@ -111,6 +111,7 @@ class Ethna_Plugin_Generator_Project extends Ethna_Plugin_Generator
         $macro['project_id'] = ucfirst($id);
         $macro['project_prefix'] = $id;
         $macro['basedir'] = realpath($basedir);
+        $macro['locale'] = $locale;
 
         $macro['action_class'] = '{$action_class}';
         $macro['action_form'] = '{$action_form}';
index ecf7eb0..75429b6 100644 (file)
@@ -257,6 +257,21 @@ class {$project_id}_Controller extends Ethna_Controller
     );
 
     /**#@-*/
+
+    /**
+     *  Get Default language and locale setting.
+     *  If you want to change Ethna's output encoding, override this method.
+     *
+     *  @access protected
+     *  @return array   locale name(e.x ja_JP, en_US .etc),
+     *                  system encoding name,
+     *                  client encoding name(= template encoding)
+     *                  (locale name is "ll_cc" format. ll = language code. cc = country code.)
+     */
+    function _getDefaultLanguage()
+    {
+        return array('{$locale}', 'UTF-8', 'UTF-8');
+    }
 }
 
 ?>