CodeIgniter2 を試す (日本語化編)

スポンサーリンク

先日リリースされた CodeIgniter2 をこれまで何度か取り上げてきたが,今回は日本語化を行なう。

まず,以前のバージョン (1.7.3) と最新版 (2.0.0) の言語ファイルを比較してみたところ,以下のようにほとんど変更がなかった。

$ diff -r english1.7/db_lang.php english2.0/db_lang.php
9d8
< $lang['db_must_set_database'] = 'You must set the database name in your database config file.';
10a10,11
> $lang['db_must_use_index'] = 'You must specify an index to match on for batch updates.';
> $lang['db_batch_missing_index'] = 'One or more rows submitted for batch updating is missing the specified index.';
$ diff -r english1.7/form_validation_lang.php english2.0/form_validation_lang.php
17a18
> $lang['regex_match']		= "The %s field is not in the correct format.";
$ diff -r english1.7/ftp_lang.php english2.0/ftp_lang.php
9a10
> $lang['ftp_unable_to_download']		= "Unable to download the specified file.  Please check your path.";
$ diff -r english1.7/profiler_lang.php english2.0/profiler_lang.php
10a11,12
> $lang['profiler_config']		= 'CONFIG VARIABLES';
> $lang['profiler_headers']		= 'HTTP HEADERS';
16a19
> $lang['profiler_no_profiles']	= 'No Profile data - all Profiler sections have been disabled.';
$ diff -r english1.7/unit_test_lang.php english2.0/unit_test_lang.php
20a21
> $lang['ut_notes']			= 'Notes';
  • scaffolding_lang.php の削除
  • validation_lang.php の削除

ということで,日本ユーザ会が配布している 1.7.3 の日本語パッチをほぼそのまま流用して,不足している部分のみ自力で追加すれば良さそうだ。 (form_validation_lang.php$lang['regex_match'] など)

具体的には,以前のバージョンの ci-ja-all-in-one-1.7.3-1/system/language/japanese/ フォルダを 2.0.0 の system/language/ フォルダの中にコピーする。これだけでエラー表示などが次のように日本語になる。

なお,言語ファイル以外の日本語パッチによる変更箇所は,ci-ja-all-in-one-1.7.3-1/README-all-in-one.ja.txt に書かれている。

コメント

タイトルとURLをコピーしました