プラグインをローカライズするには

英語で表示されるプラグインでも、翻訳機能を使って日本語で表示することができる。

外国語に対応しているプラグインであれば、potという拡張子のファイルが用意されいてる。
例えば、example.pot
Poeidtというアプリケーション(Windows用)を使って、example.potを翻訳する。
[ファイル]-[POTファイルをもとに新しいカタログを作成する]メニューでpotファイルを読み込む
必要箇所を翻訳し、名前を付けて保存する。
日本語化する場合、このときのファイル名はexample-ja.poにすること。
保存と同時にexample-ja.moが作成される

プラグインで指定してあるディレクトリにmoファイルをコピーする
load_plugin_textdomain(‘example’, PLUGINDIR . ‘/example/languages’);

プラグイン中で翻訳される箇所は、__(や_eの箇所となる。

1件のコメント

  1. accommodation in brac 2012年5月2日 08:55

    Howdy just wanted to give you a quick heads up. The words in your post seem to be running off the screen in Internet explorer. I’m not sure if this is a formatting issue or something to do with browser compatibility but I thought I’d post to let you know. The layout look great though! Hope you get the issue solved soon. Thanks

    http://brac-croatia.info

コメントを残す

次のHTML タグと属性が使えます: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>