<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--
Copyright 2003 Raphael Finkel Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts A copy of the license is included in the section entitled "GNU Free Documentation License"
<li dir="ltr" style="text-align:left"><span xml:lang="en-US" lang="en-US"> </span><span> If you want to work on a particular language, say Pelonian (langu</span>age<span style="font-weight:bold" xml:lang="en-US" lang="en-US"> </span><span>zz-ZZ</span><span>), you may start this way:</span></li>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US">(The .po suffix doesn't mean Pelonian; it applies to any language.) Now edit </span><span>zz-ZZ.po</span><span>. Fix the comment at the start to indicate who you are, what the language is, and when you are doing this work.</span></p>
<ol>
<li dir="ltr" style="text-align:left"><span xml:lang="en-US" lang="en-US"> </span><span>I strongly recommend you use Unicode UTF-8 to encode all your Pelonian strings. In the comment at the top of </span><span>zz-ZZ.po</span><span>, make sure the following two lines appear:</span></li>
<li dir="ltr" style="text-align:left"><span xml:lang="en-US" lang="en-US"> </span><span>Now you want to translate all lines that start with </span><span>msgid</span><span> and place the translation in place of the empty string in the following msgstr line. For instance, you might translate</span></li>
</ol>
<pre><span xml:lang="en-US" lang="en-US"> </span><span>msgid "the dictionary"</span></pre>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US">(Sorry, my knowledge of the Pelonian language is limited.) Translate as many entries as you like. Entries that have </span><span>%d</span><span> or </span><span>%s</span><span> should most likely be translated with </span><span>%d</span><span> and </span><span>%s</span><span> in place, referring to numeric or string data to be filled in later. Don't worry that lines get very long. If you like, you may divide long lines:</span></p>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US">Later processing steps will automatically divide long lines for you in any case.</span></p>
<ol>
<li dir="ltr" style="text-align:left"><span xml:lang="en-US" lang="en-US"> </span><span>Once you have translated as much as you want, check your translation for sanity:</span></li>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US">Fix any errors that msgfmt finds. Then run this script:</span></p>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US">This program places strings in </span><span>../user/wp/strings/zz-ZZ.strings</span><span>. The next time you build AbiWord, the Pelonian strings will be available, or you can manually copy the strings file to </span><span>$prefix/AbiSuite-2.0/AbiWord/strings/zz-ZZ.strings</span><span> and see them immediately when you next run AbiWord.</span></p>
<ol>
<li dir="ltr" style="text-align:left"><span xml:lang="en-US" lang="en-US"> </span><span>Later, you will want to fix your translations, finish strings you didn't translate earlier, and see if new strings have been introduced into AbiWord that you need to translate. Run this script:</span></li>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US">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 </span><span>zz-ZZ.po</span><span>, 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.</span></p>
<p></p>
<ol>
<li dir="ltr" style="text-align:left"><span xml:lang="en-US" lang="en-US"> </span><span>There are several alternative techniques for building Pelonian string files, although I don't recommend them.</span>
<ol>
<li dir="ltr" style="text-align:left"><span xml:lang="en-US" lang="en-US"> </span><span>Look in </span><a href="http://www.abisource.com/dev/strings/strings.html"><span xml:lang="en-US" lang="en-US">http://www.abisource.com/dev/strings/strings.html</span></a><span xml:lang="en-US" lang="en-US"> (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 </span><span>no-NO</span><span>. Copy </span><span>user/wp/strings/no-NO.strings</span><span> to </span><span>user/wp/strings/zz-ZZ.strings</span><span> and modify the translations. Disadvantages: (a) You can't easily keep up with new strings added to AbiWord over time, (b) You can't easily find which Pelonian strings you haven't 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.</span></li>
<li dir="ltr" style="text-align:left"><span xml:lang="en-US" lang="en-US"> </span><span>Run </span><span>AbiWord --dumpstrings</span><span>; you will find a fresh file in the current directory called en-US.strings. Copy this file to </span><span>user/wp/strings/zz-ZZ.strings</span><span> and edit it. Disadvantages: (a-c) above.</span></li>
</ol>
</li>
</ol>
<h2><span xml:lang="en-US" lang="en-US">Unix and Gtk+ issues</span></h2>
<p></p>
<ol>
<li dir="ltr" style="text-align:left"><span xml:lang="en-US" lang="en-US"> </span><span>In order for your translations to appear, you need to set your environment to specify your language. Before you start AbiWord, set your </span><span>LANG</span><span> and </span><span>LC_ALL</span><span> environment variables to</span><span> </span></li>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US">AbiWord uses the </span><span>LANG</span><span> variable; Gtk+ uses the </span><span>LC_ALL</span><span> variable.</span></p>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US">When you run AbiWord, you should see all the strings you have translated in Pelonian, not in English.</span></p>
<ol>
<li dir="ltr" style="text-align:left"><span xml:lang="en-US" lang="en-US"> </span><span>You might not like the font in which Pelonian is displayed. In your home directory, place a file called</span></li>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US">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 </span><span>/usr/local/etc/pango/pangox.aliases</span><span> (it may be in a different place, such as </span><span>/etc/pango</span><span>) to </span><span>~/.pangox_aliases</span><span>). Add your favorite Pelonian font (mine is </span><span>-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1</span><span>) to the top of the 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.</span></p>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US">If your favorite font is monospace (like mine), set your </span><span>gtk-font-name</span><span> to </span><span>"</span><span>monospace 20</span><span>"</span><span> and put your font name in the entry for "</span><span>monospace normal normal normal normal</span><span>".</span></p>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US">If you don't see any font at all, your Unix machine is most likely using the fontconfig library. Look at its configuration file in </span><span>/etc/fonts/fonts.conf</span><span> to see where it finds fonts. For instance, you might find that it mentions the directory </span><span>/usr/share/fonts</span><span>, which is a good place to put extra fonts, such as Unicode TrueType fonts. Apparently </span><span>/usr/share/fonts</span><span> must not be a symlink to a remotely mounted filesystem.</span></p>
<ol>
<li dir="ltr" style="text-align:left"><span xml:lang="en-US" lang="en-US"> </span><span>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 don't see these messages in Pelonian, you need to introduce Pelonian strings to the gtk+ library. Get the source distribution of gtk+ (mine is </span><span>gtk+-2.0.0</span><span> as of 2/2003). In the </span><span>po</span><span> subdirectory, run</span></li>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US">and edit the </span><span>zz_ZZ.po</span><span> file just as you did for Abiword, paying special attention to those items labeled with </span><span>gtk/gtkstock.c</span><span>.</span></p>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US">Modify the Makefile, adding </span><span>zz_ZZ.po</span><span> and </span><span>zz_ZZ.gmo</span><span> everywhere you see </span><span>zh_CN.po</span><span>.</span></p>
<p style="margin-left:36pt"> <span class="code plain_text" style="">make install</span> (you may need privilege)</p>
<ol>
<li dir="ltr" style="text-align:left"><span xml:lang="en-US" lang="en-US"> </span><span>If you get the error message that your </span><span>zz_ZZ</span><span> locale isn't recognized, or you don't see stock items in Pelonian, try</span></li>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US">If </span><span>zz_ZZ</span><span> 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.</span></p>
<pre><span class="code plain_text" style=""> cd /usr/share/i18n/locales/</span></pre>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US"> [pick any language that seems similar to Pelonian, such as en_GB]</span></p>
<p dir="ltr" style="text-align:left;margin-left:36pt"><span xml:lang="en-US" lang="en-US"> [edit </span><span>zz_ZZ</span><span> as needed, or just leave it the way it is]</span></p>
<li dir="ltr" style="text-align:left"><span xml:lang="en-US" lang="en-US"> </span><span>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) </span><span>msgid</span><span> </span><span>"default:LTR"</span><span> to be </span><span>msgstr "default:RTL"</span><span>. This single setting modifies the "outer" directionality, influencing the position of widgets within containers and the default direction of all text.</span></li>