From 983017d3929f0ad5abfa4f88c0d6a6d7f5281ac2 Mon Sep 17 00:00:00 2001 From: "Y. Wang" Date: Wed, 4 Oct 2023 20:07:24 +0200 Subject: Autogenerate .tr files from .po files --- advtrains/locale/README.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'advtrains/locale/README.md') diff --git a/advtrains/locale/README.md b/advtrains/locale/README.md index a54cb6c..3e94682 100644 --- a/advtrains/locale/README.md +++ b/advtrains/locale/README.md @@ -1,17 +1,12 @@ # Translations -**Please note that this document is outdated as transition to `.po` -files is currently in progress.** - Please read this document before working on any translations. -## Getting Started -If there is a translation file for your language (e.g. German), you can -edit the file directly. Please read [the documentation on the -translation file format][tr-format]. +Unlike many other mods, Advtrains uses `.po` files for localization, +which are then automatically converted to `.tr` files when the mod is +loaded. Therefore, please submit patches that edit the `.po` files. -Alternatively, Advtrains provides a script named `gui` that can be used -to, among other things, edit translation files. The script requires -Tcl/Tk 8.6, which is provided by most Linux distributions. +## Getting Started +The translation files can be edited like any other `.po` file. If the translation file for your language does not exist, create it by copying `template.txt` to `advtrains.XX.tr`, where `XX` is replaced by @@ -20,7 +15,7 @@ the language code. Feel free to use the [discussion mailing list][srht-discuss] if you have any questions regarding localization. -You can share your `.tr` file directly or [as a patch][gsm] to the [dev +You can share your `.po` file directly or [as a patch][gsm] to the [dev mailing list][srht-devel]. The latter is encouraged, but, unlike code changes, translation files sent directly are also accepted. @@ -62,6 +57,12 @@ halfwidth punctuation marks). However, do not leave any space between Han characters and Arabic numerals. ## Notes for developers +* The `update-translations.sh` script can be used to update the +translation files. However, please make sure to install the +`basic_trains` mod before running the script. +* Please make sure that the first argument to `S` (or `attrans`) _only_ +includes string literals without formatting or concatenation. This is +unfortunately a limitation of the `xgettext` utility. * Avoid word-by-word translations. * Avoid manipulating translated strings (except for concatenation). Use server-side translations if you have to modify the text sent to users. -- cgit v1.2.3