| ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot |
Gettext is a set of tools, guidelines, directory naming conventions and a runtime library. Together, they are the standard way to translate applications in the *nix environment. Don't be scared, you can use it on Windows as well. I don't want to describe the whole system here, just the things you need to translate your application - you can read the manual if you want more information.
The gettext system translates replaces whole strings with the translated
equivalent in the target language. This means that you don't have to
invent array keys but can keep the original string in the code, which
makes it a lot more readable. The translations are written down in
so-called .po-files, where "po" stands for
"portable object". They contain the human-readable and human-editable
translation of the strings to the target language. To speed up the
live-translation process when the application is running, they are
compiled to .mo-files, "machine object" files.
These files are required to be in a certain directory structure:
A .mo translation file looks the following way:
After translating your strings, you have to compiles the
.po to .mo files
which is done by using the msgfmt tool.
On *nix, you should have it somewhere; on Windows you can get
it with mingw32.
Go to the LC_MESSAGES directory and just call the compiler:
|
各種マニュアル:
PHPマニュアル |
PEARマニュアル |
Smarty(英語)マニュアル |
PHP-GTKマニュアル |
「Gettext」をGoogle検索
|