When you run your installed copy of dopewars, it should detect your "locale" automatically and talk to you in your native language. If this does not happen, the following are some possible explanations:-
Adding a new translation is simply a matter of copying the reference file dopewars.pot to your language-specific .po file in the po/ directory, and filling in the "msgstr" entries. Once this is done, edit the configure.in file in the top dopewars directory to add your language code to the ALL_LINGUAS variable. Then run autoconf to rebuild the configure script, before making and installing dopewars as usual. The new translation should now be available. Once this is complete, please send the translation to be included in the next dopewars version.
Please note that some strings are format strings containing the %
character. These are used in the program code for substituting numbers and
other pieces of text into the string - these substitutions are are performed
using variables which are specified in the same order as the %
characters in the format string. For example, the following format string
substitutes in a string (%s) and an integer number (%d):-
"String '%s' has %d characters"
The string and number are specified in order in the code. This is problematic
if your translation changes the order - for example, a valid German translation
of the string would be
"%d Zeichen lang ist die Zeichenkette '%s'"
Now the number and string are specified in the wrong order, and this will
probably crash the program on running! To fix this, use the special notation
"%2$d Zeichen lang ist die Zeichenkette '%1$s'"
(i.e. replace %x with %n$x where n is the index that the
format specifier "should" have, starting from 1.)
Obviously dopewars cannot guess what your "alternative forms" are; you must
specify them yourself. Essentially, when setting a string in a dopewars
configuration file (or the defaults, which are set in dopewars.c) alternative
forms can be added by alternating two-letter codes and alternative forms after
the original word, separating them by _ (underline) symbols. For example,
Additionally, prices in dopewars are automatically formatted into strings by
means of the %P notation, and comments can be introduced into format strings
by means of the %/.../ notation. Everything between the two / characters is
not printed. This is used to "qualify" some strings for translation, and the
%/.../ can be left out of the translated string if desired (the comment does
not need to be translated).
dopewars specifics
Names.Bitch = "bitch_no_bitcho_ac_bitche"
specifies two alternative forms for "bitch", identified by the "no"
and "ac" codes. You can then use "bitcho" anywhere that "bitch" is
normally used by translating the relevant string as "%tno" (and to
get "bitche" use "%tac"). If you specify a two letter code
in the translation that you haven't given an alternative form for, the
default word ("bitch") will be used. In the original English, "%tde"
is used for this purpose, but there is nothing special about the "de"
code - you can use it yourself if you like, and you can use as many
different two-letter codes as you want to.Updating a translation for a new dopewars
version
New versions of dopewars will often change what is printed to the user, and
so may may require changes to the translation. To update an existing
translation, "make" the new version of dopewars. This will create
a dopewars.pot file listing the strings that need translating. Change
into the po/ subdirectory, and create a new translation file from
your "old" translation file (we'll assume it's called de.po) and
dopewars.pot with the msgmerge command:-
msgmerge -o newfile de.po dopewars.pot
Examine this new file newfile for translations that need updating
(a search for "fuzzy" should find most of them) and then overwrite your old
translation with the new one:
mv newfile de.po
Rebuild and reinstall dopewars, and the new translations should become
available. Again, it is deeply appreciated if such updated files are
contributed to the main dopewars distribution!
Currently available translations