Translating Trame
=================

Trame (the trame command, trame-tui and trame-gui) uses one gettext
domain, "trame". Every string lives in po/trame.pot; each language is
one file, po/<lang>.po. You need the gettext tools (msginit, msgmerge,
msgfmt) and a text editor, or a PO editor such as Poedit.


Start a new language
--------------------

    make po-init L=de        # creates po/de.po, adds "de" to po/LINGUAS

Use the code of your locale: de, es, pt_BR, zh_CN...
Translate every msgstr in po/<lang>.po, then check it:

    make msgfmt po-stats

"fr" is complete and is a good model.


Update a language
-----------------

When the code changes, refresh the template and your file:

    make pot msgmerge
    make po-stats            # shows what is fuzzy or missing

New strings have an empty msgstr. Strings whose English changed are
marked "#, fuzzy" with the old English as "#| msgid": fix the
translation, then remove the fuzzy line.


Try it
------

    make msgfmt
    sudo make install-msg    # /usr/share/locale/<lang>/LC_MESSAGES/trame.mo
    LANG=de_DE.UTF-8 trame hardware summary
    LANG=de_DE.UTF-8 trame-gui

The menu entry (Name, Comment of trame-gui.desktop) is translated from
the same .po file when trame-gui is built.


Rules
-----

- Keep every %s, %d, %.1f, %% of the msgid, in the same order. msgfmt
  --check (run by make msgfmt) catches mistakes.
- Keep "\n" line breaks, and leading or trailing spaces.
- The GUI is for people who know nothing about Linux: plain words,
  short sentences. The CLI and the TUI are for experts.
- Command names, package names and options stay as they are: trame,
  spk-add, --yes, iwlwifi.
- Comments starting with "TRANSLATORS:" in the .pot explain a string.
- Plurals: fill every msgstr[n] your language needs; Plural-Forms in the
  header says how many.


Send it
-------

Post your po/<lang>.po on the SliTaz forum (https://forum.slitaz.org/)
or send a patch to the Mercurial repository (https://hg.slitaz.org/trame).
