~ubuntu-branches/ubuntu/maverick/fotoxx/maverick

« back to all changes in this revision

Viewing changes to doc/TRANSLATIONS

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Torres Batan
  • Date: 2009-08-20 12:27:47 UTC
  • Revision ID: james.westby@ubuntu.com-20090820122747-jr7txlqf1a58omzk
Tags: upstream-8.3
Import upstream version 8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
TRANSLATIONS OF FOTOXX
 
2
 
 
3
The instructions here apply to the GUI interface (menus and dialogs).
 
4
For user guide translations, see below.
 
5
 
 
6
There are two GUI translation files (assuming a default installation):
 
7
   /usr/local/share/fotoxx/locales/lc/fotoxx.po
 
8
   /usr/local/share/fotoxx/locales/lc/zfuncs.po
 
9
 
 
10
"fotoxx" is the main application program. "zfuncs" is a collection 
 
11
of utility programs. "lc" is the standard 2-character language code: 
 
12
de, es, fr, zh, etc. These two .po files contain the English phrases 
 
13
used by fotoxx and zfuncs, with corresponding translations. They can 
 
14
be edited with any text editor or one of the special .po file editors.
 
15
 
 
16
In addition the these "lc" translation files, files for regional 
 
17
languages or dialects may also be installed. These file names include 
 
18
the region code as follows:
 
19
   /usr/local/share/fotoxx/locales/lc_RC/fotoxx.po
 
20
   /usr/local/share/fotoxx/locales/lc_RC/zfuncs.po
 
21
 
 
22
"lc_RC" is a combined language and region code, e.g. "de_AT" for 
 
23
Austrian German, or "zh_TW" for Taiwan Chinese. This is also the
 
24
locale of the target computer system, as shown by the following
 
25
command: $ echo $LANG
 
26
 
 
27
If both standard and regional translation files are present, BOTH
 
28
are read and processed. If the same English text is translated in
 
29
both files, the regional translation will be used. Thus you can make
 
30
a regional .po file that contains only the exceptions to standard 
 
31
translations.
 
32
 
 
33
To change or add-to an existing translation file:
 
34
 
 
35
1. Edit fotoxx.po and zfuncs.po to add or update translations.
 
36
2. Open a terminal window and go to the location of these files.
 
37
3. Compile the .po files to check for errors:
 
38
   $ msgfmt -v --check-format  -o /dev/null  fotoxx.po
 
39
   $ msgfmt -v --check-format  -o /dev/null  zfuncs.po
 
40
4. Run fotoxx and check how the translations look.
 
41
5. Send the modified .po files to me (kornelix@yahoo.de) so they
 
42
   can be included in future releases.
 
43
 
 
44
NOTE: 
 
45
Steps 2 and 3 are optional. The usual binary translation files (.mo)
 
46
that are output by msgfmt are not needed by fotoxx. The translation 
 
47
source files (.po) are read directly by fotoxx, and changes made to
 
48
a .po file are immediately effective. Steps 2 and 3 are useful to 
 
49
find errors (e.g. format codes in a translated string do not match 
 
50
those in the English string).
 
51
 
 
52
To add a new language:
 
53
 
 
54
1. Move the source program files fotoxx-N.N.cpp and zfuncs.cpp from 
 
55
   the release tarball into some convenient directory.
 
56
2. Create template files (.pot) from the source programs (.cpp)
 
57
      $ xgettext -s --keyword=ZTX -o fotoxx.pot fotoxx-N.N.cpp
 
58
      $ xgettext -s --keyword=ZTX -o zfuncs.pot zfuncs.cpp
 
59
3. Create translation files (.po) from the template files (.pot)
 
60
      $ msginit -l lc -o fotoxx.po -i fotoxx.pot
 
61
      $ msginit -l lc -o zfuncs.po -i zfuncs.pot
 
62
   "lc" is the 2-character code for the new language.
 
63
   If asked for an e-mail address, reply with Enter to ignore this.
 
64
4. Edit the two .po files to insert translations for all text.
 
65
5. Create an installation directory for the translation files:
 
66
      /usr/local/share/fotoxx/locales/lc
 
67
6. Move the two .po files into the installation location:
 
68
       /usr/local/share/fotoxx/locales/lc/fotoxx.po
 
69
       /usr/local/share/fotoxx/locales/lc/zfuncs.po
 
70
7. Run fotoxx and check how the translations look.
 
71
8. Send the new .po files to me (kornelix@yahoo.de) so they can be 
 
72
   included in future releases.
 
73
 
 
74
Problems with long translations:
 
75
 
 
76
English can be terse compared to other languages (e.g. "undo" becomes 
 
77
"Rückgängig machen" in German), and this can cause ugliness in the 
 
78
GUI layouts. Therefore try to make dialog labels and buttons short.
 
79
 
 
80
Context-dependent translations:
 
81
 
 
82
Sometimes the same English text will need multiple translations that
 
83
depend on context. A simple example is "save file" when used on a
 
84
toolbar button or in a menu. On the button the translation should be
 
85
short, but there is no limit for the menu. In German, this could be
 
86
"speichern" for the button and "in Datei speichern" for the menu.
 
87
The standard method to do this in Gnu gettext is fairly horrible, but
 
88
since fotoxx reads the source translations (.po files) instead of
 
89
the binaries (.mo files), a simpler method is available. The English
 
90
text may include an extra string to distinguish different contexts.
 
91
This context string is removed from the GUI output, so the user does 
 
92
not see it. The context string is any short string followed with the
 
93
special marker "::". To continue our example, the fotoxx.po file
 
94
might look like this:
 
95
   msgid "save file"
 
96
   msgstr "in Datei speichern"
 
97
   msgid "toolbar::save file"
 
98
   msgstr "speichern"
 
99
In English, fotoxx would show "save file" for both cases, and in 
 
100
German "in Datei speichern" or "speichern". Context strings may be
 
101
present in the .po files distributed with fotoxx, and also in a
 
102
newly created language .po file.
 
103
 
 
104
User Guide translations:
 
105
 
 
106
The user guide is named as follows (assuming a default installation):
 
107
   /usr/local/share/doc/fotoxx/userguide-lc.html
 
108
   /usr/local/share/doc/fotoxx/userguide-lc_RC.html
 
109
 
 
110
The file is a text HTML file, which may be edited with any HTML editor.
 
111
"lc" is a standard language code, and "lc_RC" is a language and region 
 
112
code combination. The user locale in $LANG or $LANGUAGE is used to find 
 
113
"lc_RC". If a file with the region code is present, this file is used, 
 
114
otherwise the standard language version is used. If this is not found, 
 
115
the english file (userguide-en.html) is used.
 
116
 
 
117
If you make a new or revised translation, please send it to me so that
 
118
it can be included in the source distribution (kornelix@yahoo.de).
 
119
 
 
120