IntlFaqNotesForTranslators

From AbiWiki

(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Yvuwicyvok (Talk) to last revision by Maintenance script)
 
Line 1: Line 1:
-
----
 
-
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
-
----
 
-
=[http://ukusypumi.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
 
-
----
 
-
=[http://ukusypumi.co.cc CLICK HERE]=
 
-
----
 
-
</div>
 
-
&lt;H2&gt;[[IntlFAQ|IntlFAQ]]: Notes For Abiword Translators&lt;/H2&gt;
+
<H2>[[IntlFAQ|IntlFAQ]]: Notes For Abiword Translators</H2>
Raphael Finkel
Raphael Finkel
Line 17: Line 9:
A.1. If you want to work on a particular language, say Pelonian (language
A.1. If you want to work on a particular language, say Pelonian (language
zz-ZZ), you may start this way:
zz-ZZ), you may start this way:
-
&lt;verbatim&gt;
+
<verbatim>
./update.pl --pot
./update.pl --pot
-
mv abiword.pot zz-ZZ.po&lt;/verbatim&gt;
+
mv abiword.pot zz-ZZ.po</verbatim>
(The .po suffix doesn''t mean Pelonian; it applies to any language.) Now edit
(The .po suffix doesn''t mean Pelonian; it applies to any language.) Now edit
Line 28: Line 20:
strings.  In the comment at the top of zz-ZZ.po, make sure the following two
strings.  In the comment at the top of zz-ZZ.po, make sure the following two
lines appear:
lines appear:
-
&lt;verbatim&gt;
+
<verbatim>
-
&quot;Content-Type: text/plain; charset=UTF-8\n&quot;
+
"Content-Type: text/plain; charset=UTF-8\n"
-
&quot;Content-Transfer-Encoding: 8-bit\n&quot;&lt;/verbatim&gt;
+
"Content-Transfer-Encoding: 8-bit\n"</verbatim>
A.3. Now you want to translate all lines that start with msgid
A.3. Now you want to translate all lines that start with msgid
and place the translation in place of the empty string in the following msgstr
and place the translation in place of the empty string in the following msgstr
line.  For instance, you might translate
line.  For instance, you might translate
-
&lt;verbatim&gt;
+
<verbatim>
-
msgid &quot;the dictionary&quot;
+
msgid "the dictionary"
-
msgstr &quot;grompabikku-la&quot;&lt;/verbatim&gt;
+
msgstr "grompabikku-la"</verbatim>
(Sorry, my knowledge of the Pelonian language is limited.)
(Sorry, my knowledge of the Pelonian language is limited.)
Line 45: Line 37:
you may divide long lines:
you may divide long lines:
-
&lt;verbatim&gt; msgstr &quot;&quot;
+
<verbatim> msgstr ""
-
&quot;implog revulam&quot;
+
"implog revulam"
-
&quot;groppsigu moturo nula&quot;&lt;/verbatim&gt;
+
"groppsigu moturo nula"</verbatim>
Later processing steps will automatically divide long lines for you in any case.
Later processing steps will automatically divide long lines for you in any case.
Line 53: Line 45:
A.4. Once you have translated as much as you want, check your translation for
A.4. Once you have translated as much as you want, check your translation for
sanity:
sanity:
-
&lt;verbatim&gt;
+
<verbatim>
-
msgfmt -cv zz-ZZ.po&lt;/verbatim&gt;
+
msgfmt -cv zz-ZZ.po</verbatim>
Fix any errors that msgfmt finds.  Then run this script:
Fix any errors that msgfmt finds.  Then run this script:
-
&lt;verbatim&gt;
+
<verbatim>
-
./ui-backport.pl zz-ZZ&lt;/verbatim&gt;
+
./ui-backport.pl zz-ZZ</verbatim>
This program places strings in ../user/wp/strings/zz-ZZ.strings.  The next time
This program places strings in ../user/wp/strings/zz-ZZ.strings.  The next time
Line 68: Line 60:
translate earlier, and see if new strings have been introduced into [[AbiWord|AbiWord]]
translate earlier, and see if new strings have been introduced into [[AbiWord|AbiWord]]
that you need to translate.  Run this script:
that you need to translate.  Run this script:
-
&lt;verbatim&gt;
+
<verbatim>
-
./update.pl zz-ZZ&lt;/verbatim&gt;
+
./update.pl zz-ZZ</verbatim>
You will be see a summary that tells you how many messages have been translated
You will be see a summary that tells you how many messages have been translated
-
and how many are still untranslated.  It will also indicate how many &quot;fuzzy&quot;
+
and how many are still untranslated.  It will also indicate how many "fuzzy"
translations there are.  These are translations that you have made but which
translations there are.  These are translations that you have made but which
may no longer be right, because [[AbiWord|AbiWord]] no longer uses quite the same text in
may no longer be right, because [[AbiWord|AbiWord]] no longer uses quite the same text in
the message that it did when you first made the translation.  Search for the
the message that it did when you first made the translation.  Search for the
-
word &quot;fuzzy&quot; in zz-ZZ.po, and fix all such translations, if necessary.  Remove
+
word "fuzzy" in zz-ZZ.po, and fix all such translations, if necessary.  Remove
-
the line that says &quot;fuzzy&quot; to indicate that you have fixed them.  Then do
+
the line that says "fuzzy" to indicate that you have fixed them.  Then do
whatever other translations you want, and backport as indicated above.
whatever other translations you want, and backport as indicated above.
Line 94: Line 86:
the no-NO translation, which is one step removed from the English source.
the no-NO translation, which is one step removed from the English source.
-
A.6.ii.  Run &lt;code&gt;[[AbiWord|AbiWord]] --dumpstrings&lt;/code&gt;; you will find a fresh file in the current
+
A.6.ii.  Run <code>[[AbiWord|AbiWord]] --dumpstrings</code>; you will find a fresh file in the current
directory called en-US.strings.  Copy this file to
directory called en-US.strings.  Copy this file to
user/wp/strings/zz-ZZ.strings and edit it.  Disadvantages:  (a-c) above.
user/wp/strings/zz-ZZ.strings and edit it.  Disadvantages:  (a-c) above.
Line 103: Line 95:
to specify your language.  Before you start [[AbiWord|AbiWord]], set your LANG and
to specify your language.  Before you start [[AbiWord|AbiWord]], set your LANG and
LC_ALL environment variables to
LC_ALL environment variables to
-
&lt;verbatim&gt;
+
<verbatim>
LANG=zz-ZZ.utf8
LANG=zz-ZZ.utf8
-
LC_ALL=zz_ZZ&lt;/verbatim&gt;
+
LC_ALL=zz_ZZ</verbatim>
[[AbiWord|AbiWord]] uses the LANG variable; Gtk+ uses the LC_ALL variable.
[[AbiWord|AbiWord]] uses the LANG variable; Gtk+ uses the LC_ALL variable.
Line 114: Line 106:
B.2.  You might not like the font in which Pelonian is displayed.  In your home
B.2.  You might not like the font in which Pelonian is displayed.  In your home
directory, place a file called
directory, place a file called
-
&lt;verbatim&gt;
+
<verbatim>
-
.gtkrc-2.0&lt;/verbatim&gt;
+
.gtkrc-2.0</verbatim>
In that file, place a line saying
In that file, place a line saying
-
&lt;verbatim&gt;
+
<verbatim>
-
gtk-font-name = &quot;sans 20&quot;&lt;/verbatim&gt;
+
gtk-font-name = "sans 20"</verbatim>
The 20 is a size indicator; you may change that if you like.  Now you must tell
The 20 is a size indicator; you may change that if you like.  Now you must tell
Line 126: Line 118:
/etc/pango) to ~/.pangox_aliases).  Add your favorite Pelonian font (mine is
/etc/pango) to ~/.pangox_aliases).  Add your favorite Pelonian font (mine is
-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1) to the top of the
-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1) to the top of the
-
entry for &quot;sans normal normal normal normal&quot;.  You may have to remove other
+
entry for "sans normal normal normal normal".  You may have to remove other
fonts from that list if you don''t get the font you want.
fonts from that list if you don''t get the font you want.
If your favorite font is monospace (like mine), set your gtk-font-name to
If your favorite font is monospace (like mine), set your gtk-font-name to
-
&quot;monospace 20&quot; and put your font name in the entry for &quot;monospace normal normal
+
"monospace 20" and put your font name in the entry for "monospace normal normal
-
normal normal&quot;.
+
normal normal".
If you don''t see any font at all, your Unix machine is most likely using the
If you don''t see any font at all, your Unix machine is most likely using the
Line 141: Line 133:
B.3. Your [[AbiWord|AbiWord]] translations only apply to those menus and buttons that
B.3. Your [[AbiWord|AbiWord]] translations only apply to those menus and buttons that
-
[[AbiWord|AbiWord]] builds for itself.  [[AbiWord|AbiWord]] also uses &quot;stock&quot; items from Gtk+,
+
[[AbiWord|AbiWord]] builds for itself.  [[AbiWord|AbiWord]] also uses "stock" items from Gtk+,
-
including buttons that say &quot;Cancel&quot; and &quot;OK&quot;.  If you don''t see these messages
+
including buttons that say "Cancel" and "OK".  If you don''t see these messages
in Pelonian, you need to introduce Pelonian strings to the gtk+ library.  Get
in Pelonian, you need to introduce Pelonian strings to the gtk+ library.  Get
the source distribution of gtk+ (mine is gtk+-2.0.0 as of 2/2003).  In the po
the source distribution of gtk+ (mine is gtk+-2.0.0 as of 2/2003).  In the po
subdirectory, run
subdirectory, run
-
&lt;verbatim&gt;
+
<verbatim>
./update.pl --pot
./update.pl --pot
-
mv abiword.pot zz_ZZ.po&lt;/verbatim&gt;
+
mv abiword.pot zz_ZZ.po</verbatim>
and edit the zz_ZZ.po file just as you did for Abiword, paying special
and edit the zz_ZZ.po file just as you did for Abiword, paying special
Line 155: Line 147:
Modify the Makefile, adding zz_ZZ.po and zz_ZZ.gmo everywhere you
Modify the Makefile, adding zz_ZZ.po and zz_ZZ.gmo everywhere you
see zh_CN.po.
see zh_CN.po.
-
&lt;verbatim&gt;
+
<verbatim>
make zz_ZZ.gmo
make zz_ZZ.gmo
-
make install (you may need privilege)&lt;/verbatim&gt;
+
make install (you may need privilege)</verbatim>
B.4. If you get the error message that your zz_ZZ locale isn''t recognized, or
B.4. If you get the error message that your zz_ZZ locale isn''t recognized, or
you don''t see stock items in Pelonian, try
you don''t see stock items in Pelonian, try
-
&lt;verbatim&gt;
+
<verbatim>
-
locale -a&lt;/verbatim&gt;
+
locale -a</verbatim>
If zz_ZZ is not listed, you need to set up Pelonian as one of the supported
If zz_ZZ is not listed, you need to set up Pelonian as one of the supported
locales on your machine.  You will need privilege, typically as root.
locales on your machine.  You will need privilege, typically as root.
-
&lt;verbatim&gt;
+
<verbatim>
cd /usr/share/i18n/locales/
cd /usr/share/i18n/locales/
[pick any language that seems similar to Pelonian, such as en_GB]
[pick any language that seems similar to Pelonian, such as en_GB]
Line 175: Line 167:
localedef -c -f UTF-8 -i zz_ZZ /usr/share/locale/zz_ZZ
localedef -c -f UTF-8 -i zz_ZZ /usr/share/locale/zz_ZZ
localedef --add-to-archive /usr/share/locale/zz_ZZ
localedef --add-to-archive /usr/share/locale/zz_ZZ
-
[for newer versions]&lt;/verbatim&gt;
+
[for newer versions]</verbatim>
B.5. If Pelonian is written right-to-left (RTL) instead of LTR, you might need
B.5. If Pelonian is written right-to-left (RTL) instead of LTR, you might need
Line 181: Line 173:
includes non-RTL characters, such as periods, query marks, and numbers.  But a
includes non-RTL characters, such as periods, query marks, and numbers.  But a
better solution is to set the translation for the Gtk (not [[AbiWord|AbiWord]]) msgid
better solution is to set the translation for the Gtk (not [[AbiWord|AbiWord]]) msgid
-
&quot;default:LTR&quot; to be msgstr &quot;default:RTL&quot;.  This single setting modifies the
+
"default:LTR" to be msgstr "default:RTL".  This single setting modifies the
-
&quot;outer&quot; directionality, influencing the position of widgets within containers
+
"outer" directionality, influencing the position of widgets within containers
and the default direction of all text.
and the default direction of all text.

Current revision as of 13:37, 27 November 2010

Contents

IntlFAQ: Notes For Abiword Translators

Raphael Finkel raphael@cs.uky.edu

A. Getting started

A.1. If you want to work on a particular language, say Pelonian (language zz-ZZ), you may start this way: <verbatim> ./update.pl --pot mv abiword.pot zz-ZZ.po</verbatim>

(The .po suffix doesnt mean Pelonian; it applies to any language.) Now edit zz-ZZ.po. Fix the comment at the start to indicate who you are, what the language is, and when you are doing this work.

A.2 I strongly recommend you use Unicode UTF-8 to encode all your Pelonian strings. In the comment at the top of zz-ZZ.po, make sure the following two lines appear: <verbatim> "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n"</verbatim>

A.3. Now you want to translate all lines that start with msgid and place the translation in place of the empty string in the following msgstr line. For instance, you might translate <verbatim> msgid "the dictionary" msgstr "grompabikku-la"</verbatim>

(Sorry, my knowledge of the Pelonian language is limited.) Translate as many entries as you like. Entries that have s should most likely be translated with s in place, referring to numeric or string data to be filled in later. Dont worry that lines get very long. If you like, you may divide long lines:

<verbatim> msgstr "" "implog revulam" "groppsigu moturo nula"</verbatim>

Later processing steps will automatically divide long lines for you in any case.

A.4. Once you have translated as much as you want, check your translation for sanity: <verbatim> msgfmt -cv zz-ZZ.po</verbatim>

Fix any errors that msgfmt finds. Then run this script: <verbatim> ./ui-backport.pl zz-ZZ</verbatim>

This program places strings in ../user/wp/strings/zz-ZZ.strings. The next time you build AbiWord, the Pelonian strings will be available, or you can manually copy the strings file to $prefix/AbiSuite-2.0/AbiWord/strings/zz-ZZ.strings and see them immediately when you next run AbiWord.

A.5. Later, you will want to fix your translations, finish strings you didnt translate earlier, and see if new strings have been introduced into AbiWord that you need to translate. Run this script: <verbatim> ./update.pl zz-ZZ</verbatim>

You will be see a summary that tells you how many messages have been translated and how many are still untranslated. It will also indicate how many "fuzzy" translations there are. These are translations that you have made but which may no longer be right, because AbiWord no longer uses quite the same text in the message that it did when you first made the translation. Search for the word "fuzzy" in zz-ZZ.po, and fix all such translations, if necessary. Remove the line that says "fuzzy" to indicate that you have fixed them. Then do whatever other translations you want, and backport as indicated above.

A.6.There are several alternative techniques for building Pelonian string files, although I dont recommend them.

A.6.i. Look in http://www.abisource.com/dev/strings/strings.html (quite long; all you need is the beginning) to find a fairly complete translation of some language that you can work from, perhaps because the language is related to Pelonian. Say you choose no-NO. Copy user/wp/strings/no-NO.strings to user/wp/strings/zz-ZZ.strings and modify the translations. Disadvantages: (a) You cant easily keep up with new strings added to AbiWord over time, (b) You cant easily find which Pelonian strings you havent done yet, (c) In the cases where the same English string occurs in multiple instances, you need to introduce your Pelonian translation for each instance. (d) You have to trust the no-NO translation, which is one step removed from the English source.

A.6.ii. Run AbiWord --dumpstrings; you will find a fresh file in the current directory called en-US.strings. Copy this file to user/wp/strings/zz-ZZ.strings and edit it. Disadvantages: (a-c) above.

B. Unix and Gtk+ issues

B.1. In order for your translations to appear, you need to set your environment to specify your language. Before you start AbiWord, set your LANG and LC_ALL environment variables to <verbatim> LANG=zz-ZZ.utf8 LC_ALL=zz_ZZ</verbatim>

AbiWord uses the LANG variable; Gtk+ uses the LC_ALL variable.

When you run AbiWord, you should see all the strings you have translated in Pelonian, not in English.

B.2. You might not like the font in which Pelonian is displayed. In your home directory, place a file called <verbatim> .gtkrc-2.0</verbatim>

In that file, place a line saying <verbatim> gtk-font-name = "sans 20"</verbatim>

The 20 is a size indicator; you may change that if you like. Now you must tell Pango (which actually draws the fonts) what you mean by sans 20. Copy /usr/local/etc/pango/pangox.aliases (it may be in a different place, such as /etc/pango) to ~/.pangox_aliases). Add your favorite Pelonian font (mine is -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1) to the top of the entry for "sans normal normal normal normal". You may have to remove other fonts from that list if you dont get the font you want.

If your favorite font is monospace (like mine), set your gtk-font-name to "monospace 20" and put your font name in the entry for "monospace normal normal normal normal".

If you dont see any font at all, your Unix machine is most likely using the fontconfig library. Look at its configuration file in /etc/fonts/fonts.conf to see where it finds fonts. For instance, you might find that it mentions the directory /usr/share/fonts, which is a good place to put extra fonts, such as Unicode TrueType fonts. Apparently /usr/share/fonts may not be a symlink to a remotely mounted filesystem.

B.3. Your AbiWord translations only apply to those menus and buttons that AbiWord builds for itself. AbiWord also uses "stock" items from Gtk+, including buttons that say "Cancel" and "OK". If you dont see these messages in Pelonian, you need to introduce Pelonian strings to the gtk+ library. Get the source distribution of gtk+ (mine is gtk+-2.0.0 as of 2/2003). In the po subdirectory, run <verbatim> ./update.pl --pot mv abiword.pot zz_ZZ.po</verbatim>

and edit the zz_ZZ.po file just as you did for Abiword, paying special attention to those items labeled with gtk/gtkstock.c.

Modify the Makefile, adding zz_ZZ.po and zz_ZZ.gmo everywhere you see zh_CN.po. <verbatim> make zz_ZZ.gmo make install (you may need privilege)</verbatim>

B.4. If you get the error message that your zz_ZZ locale isnt recognized, or you dont see stock items in Pelonian, try <verbatim> locale -a</verbatim>

If zz_ZZ is not listed, you need to set up Pelonian as one of the supported locales on your machine. You will need privilege, typically as root. <verbatim> cd /usr/share/i18n/locales/ [pick any language that seems similar to Pelonian, such as en_GB] cp en_GB zz_ZZ [edit zz_ZZ as needed, or just leave it the way it is] localedef -i zz_ZZ -c -f UTF-8 zz_ZZ [for older versions of localedef] localedef -c -f UTF-8 -i zz_ZZ /usr/share/locale/zz_ZZ localedef --add-to-archive /usr/share/locale/zz_ZZ [for newer versions]</verbatim>

B.5. If Pelonian is written right-to-left (RTL) instead of LTR, you might need to put a directional marker such as u202b at the start of any message that includes non-RTL characters, such as periods, query marks, and numbers. But a better solution is to set the translation for the Gtk (not AbiWord) msgid "default:LTR" to be msgstr "default:RTL". This single setting modifies the "outer" directionality, influencing the position of widgets within containers and the default direction of all text.

Contributors

Personal tools