Class Ethna_Plugin_Generator_I18n

Description

i18n 向け、メッセージカタログ生成クラスのスーパークラス

Located in /class/Plugin/Generator/I18n.php (line 20)

Ethna_Plugin_Abstract
   |
   --Ethna_Plugin_Generator
      |
      --Ethna_Plugin_Generator_I18n
Variable Summary
 mixed $file_exists
 mixed $locale
 mixed $time
 mixed $tokens
 mixed $use_gettext
Method Summary
 true|Ethna_Error generate (string $locale, int $use_gettext, [array $ext_dirs = array()])
 true|Ethna_Error _analyzeActionForm (string $file_path)
 true|Ethna_Error _analyzeDirectory (string $dir)
 true|Ethna_Error _analyzeFile (string $file)
 true|Ethna_Error _analyzeTemplate (string $file)
 void _find_template_i18n ($tokens $tokens, $index $index)
 true|Ethna_Error _generateFile ([ $skel = null], [ $entity = null], [ $macro = null], [ $overwrite = false], string $locale, int $use_gettext)
 string _get_output_file ()
Variables
mixed $file_exists (line 36)
  • access: protected
mixed $locale (line 30)
  • access: protected
mixed $time (line 39)
  • access: protected
mixed $tokens = array() (line 27)
  • access: protected
mixed $use_gettext (line 33)
  • access: protected

Inherited Variables

Inherited from Ethna_Plugin_Abstract

Ethna_Plugin_Abstract::$action_form
Ethna_Plugin_Abstract::$af
Ethna_Plugin_Abstract::$backend
Ethna_Plugin_Abstract::$config
Ethna_Plugin_Abstract::$config_default
Ethna_Plugin_Abstract::$controller
Ethna_Plugin_Abstract::$ctl
Ethna_Plugin_Abstract::$logger
Ethna_Plugin_Abstract::$name
Ethna_Plugin_Abstract::$session
Ethna_Plugin_Abstract::$type
Methods
generate (line 52)

プロジェクトのメッセージカタログを生成する

  • return: true:成功 Ethna_Error:失敗
  • access: protected
true|Ethna_Error generate (string $locale, int $use_gettext, [array $ext_dirs = array()])
  • string $locale: 生成するカタログのロケール
  • int $use_gettext: gettext 使用フラグ true ならgettext のカタログ生成 false ならEthna組み込みのカタログ生成
  • array $ext_dirs: 走査する追加のディレクトリの配列
_analyzeActionForm (line 294)

指定されたPHPスクリプトを調べ、メッセージ処理関数の呼び出し 箇所を取得します。

NOTICE: このメソッドは、指定ファイルがPHPスクリプトとして 正しいものかどうかはチェックしません。

  • return: true:成功 Ethna_Error:失敗
  • access: protected
true|Ethna_Error _analyzeActionForm (string $file_path)
  • string $file_path: 走査対象ファイル
_analyzeDirectory (line 147)

指定されたディレクトリを再帰的に走査します。

  • return: true:成功 Ethna_Error:失敗
  • access: protected
true|Ethna_Error _analyzeDirectory (string $dir)
  • string $dir: 走査対象ディレクトリ
_analyzeFile (line 197)

指定されたPHPスクリプトを調べ、メッセージ処理関数の呼び出し 箇所を取得します。

NOTICE: このメソッドは、指定ファイルがPHPスクリプト (テンプレートファイル)として正しいものかどう かはチェックしません。

  • return: true:成功 Ethna_Error:失敗
  • access: protected
true|Ethna_Error _analyzeFile (string $file)
  • string $file: 走査対象ファイル
_analyzeTemplate (line 365)

指定されたテンプレートファイルを調べ、メッセージ処理関数 の呼び出し箇所を取得します。

  • return: true:成功 Ethna_Error:失敗
  • access: protected
true|Ethna_Error _analyzeTemplate (string $file)
  • string $file: 走査対象ファイル
_find_template_i18n (line 427)

テンプレートのトークンを逆順に走査し、 翻訳トークンを取得します。

  • access: protected
void _find_template_i18n ($tokens $tokens, $index $index)
  • $tokens $tokens: 解析対象トークン
  • $index $index: インデックス
_generateFile (line 486)

解析済みのメッセージ処理関数の情報を元に、カタログファイ ルを生成します。 生成先は以下のパスになる。 [appid]/[locale_dir]/[locale_name]/LC_MESSAGES/[locale_name].[ini|po]

  • return: true:成功 Ethna_Error:失敗
  • access: protected
true|Ethna_Error _generateFile ([ $skel = null], [ $entity = null], [ $macro = null], [ $overwrite = false], string $locale, int $use_gettext)
  • string $locale: 生成するカタログのロケール
  • int $use_gettext: gettext 使用フラグ true ならgettext のカタログ生成 false ならEthna組み込みのカタログ生成
  • $skel
  • $entity
  • $macro
  • $overwrite
_get_output_file (line 118)

出力ファイル名を取得します。

  • return: 出力ファイル名
  • access: protected
string _get_output_file ()
_mergeEthnaMessageCatalog (line 453)

Ethna組み込みのメッセージカタログファイルを、上書き する場合にマージします。

  • access: protected
void _mergeEthnaMessageCatalog ()

Inherited Methods

Inherited From Ethna_Plugin_Abstract

 Ethna_Plugin_Abstract::__construct()
 Ethna_Plugin_Abstract::getConfig()
 Ethna_Plugin_Abstract::getName()
 Ethna_Plugin_Abstract::getType()
 Ethna_Plugin_Abstract::_detectName()
 Ethna_Plugin_Abstract::_detectType()
 Ethna_Plugin_Abstract::_load()
 Ethna_Plugin_Abstract::_loadConfig()

Documentation generated on Fri, 11 Nov 2011 03:58:19 +0900 by phpDocumentor 1.4.3