# HG changeset patch # User Paul Boddie # Date 1446765395 -3600 # Node ID c030453cb40b2d52ba2a92be22827ebeef94342c # Parent 6df45ddd56d115dafb6e3854c40064879ab776f1 Added a localisation section to the development guide. diff -r 6df45ddd56d1 -r c030453cb40b docs/wiki/Developing --- a/docs/wiki/Developing Fri Nov 06 00:00:55 2015 +0100 +++ b/docs/wiki/Developing Fri Nov 06 00:16:35 2015 +0100 @@ -155,3 +155,49 @@ particularly as each user's data should remain isolated from that of other users, and thus the volumes of data should remain relatively small if managed well enough. + +== Localisation == + +The traditional [[https://www.gnu.org/s/gettext|gettext]] mechanisms for +translating labels, messages and other user-readable strings are employed +in the imip-agent code. Some tools have been provided to maintain this +localisation. + +To extract "messages" from the code, run the `tools/i18n_messages.sh` +script: + +{{{ +tools/i18n_messages.sh +}}} + +This produces a file called `imip-agent.pot` in the current directory, +and it also attempts to merge any new messages into the existing message +translations found in the `messages` directory. Such translation files +have the following form: + +{{{ +messages/xx_XX.imip-agent.po +}}} + +Here, `xx` is usually an [[WikiPedia:ISO_639-1|ISO 639-1]] language code, +whereas `XX` is usually an [[WikiPedia:ISO_3166-1|ISO 3166-1]] country code. + +Translators should inspect and edit their files in the `messages` +directory and then use the `tools/i18n_format.sh` script to generate the +translations that the software will use: + +{{{ +tools/i18n_format.sh +}}} + +This installs the "compiled" translations into the `locale` directory in +a location of the following form: + +{{{ +locale/xx_XX/LC_MESSAGES/imip-agent.mo +}}} + +The `tools/install.sh` script will copy the `locale` directory into the +installation location unless the `--no-locale-dir` option is given. This is +provided to allow any centrally-installed translations to take precedence +over any locally-available translations.