Ruby-GetText-Package document for Developers

ruby-gettext-dev

Basic term explanation

pot-file, po-file
They are the text files with msgid(Original message) and msgstr(Translated message). pot-file is the template. The developer of your application generate pot-file using rgettext(or merge old one with msgmerge). Then translaters copy it and rename the extension to .po(po-file) and edit it.
mo-file
These are binary files which created from po-files by rmsgfmt. The Ruby-GetText-Package library read mo-files, not po-files.
domain(TextDomain)
domain is just mo-file name. Usually, it is called PACKAGE(like in GNOME).

Environment Variables for developers

LC_ALL, LC_CTYPE, LC_MESSAGES, LANG

Set your locale. ja_JP.eucJP, ja_JP.UTF-8, etc. If it's not set, it's set C under UNIX environment, and it's got from system environment under MS Windows.

$export LC_ALL="ja_JP.eucJP"

OUTPUT_CHARSET

Set output-charset. UTF-8, euc-jp, etc. Optional.

$export OUTPUT_CHARSET="euc-jp"

GETTEXT_PATH

Set mo-files path. Use "," to set plural paths. This is useful when you develop your application unless installing mo.files.

$export GETTEXT_PATH="/home/foo/yourapp/locale,/usr/share/locale"

Difference from GNU gettext

  • bindtextdomain has locale argument.
  • do not exist a method same as textdomain function.
  • do not support category.
Last modified:2010/01/02 00:23:23
Keyword(s):
References:[Ruby-GetText-Package] [HOWTO write your own message parsers]