New AbiWord Translation

From AbiWiki

(Difference between revisions)
Jump to: navigation, search
(Updated CVS instructions with that of SVN and further updates.)
Line 1: Line 1:
-
<h2 dir="ltr">New AbiWord Translation</h2>
+
=[http://abaviteha.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
 +
&lt;h2 dir=&quot;ltr&quot;&gt;New AbiWord Translation&lt;/h2&gt;
-
<p>These instructions will allow you to translate AbiWord
+
&lt;p&gt;These instructions will allow you to translate AbiWord
-
for a language that does not have an existing translation yet.</p>
+
for a language that does not have an existing translation yet.&lt;/p&gt;
-
<p>Before you start, make sure that you have SVN and Perl
+
&lt;p&gt;Before you start, make sure that you have SVN and Perl
installed on your computer.  
installed on your computer.  
-
<h3>Step 1: Download AbiWord via SVN</h3>
+
&lt;h3&gt;Step 1: Download AbiWord via SVN&lt;/h3&gt;
-
<p>There are [http://www.abisource.com/developers/download.phtml Instructions for using SVN] to download AbiWord's source code.</p>
+
&lt;p&gt;There are [http://www.abisource.com/developers/download.phtml Instructions for using SVN] to download AbiWord's source code.&lt;/p&gt;
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
     $ svn co http://svn.abisource.com/abiword/trunk abiword
     $ svn co http://svn.abisource.com/abiword/trunk abiword
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<h3>Step 2: Build a New Translation File</h3>
+
&lt;h3&gt;Step 2: Build a New Translation File&lt;/h3&gt;
-
<p>You need a build a file called abiword.pot which is basically a  
+
&lt;p&gt;You need a build a file called abiword.pot which is basically a  
-
blank translation of AbiWord's strings.</p>
+
blank translation of AbiWord's strings.&lt;/p&gt;
-
<p>To do this, go into the <strong>abiword/po</strong> directory and run the "update.pl" script as follows:</p>
+
&lt;p&gt;To do this, go into the &lt;strong&gt;abiword/po&lt;/strong&gt; directory and run the &quot;update.pl&quot; script as follows:&lt;/p&gt;
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
$ ./update.pl --pot
$ ./update.pl --pot
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<p>This should produce the file <strong>abiword.pot</strong>.</p>
+
&lt;p&gt;This should produce the file &lt;strong&gt;abiword.pot&lt;/strong&gt;.&lt;/p&gt;
-
<p> Now you are ready to make the new translation file for your  
+
&lt;p&gt; Now you are ready to make the new translation file for your  
-
language. All you need to do is rename <strong>abiword.pot</strong>
+
language. All you need to do is rename &lt;strong&gt;abiword.pot&lt;/strong&gt;
-
to the form <strong><em>xx-YY</em>.po</strong>
+
to the form &lt;strong&gt;&lt;em&gt;xx-YY&lt;/em&gt;.po&lt;/strong&gt;
-
where <em><strong>xx</strong></em> or <em><strong>xxx</strong></em>
+
where &lt;em&gt;&lt;strong&gt;xx&lt;/strong&gt;&lt;/em&gt; or &lt;em&gt;&lt;strong&gt;xxx&lt;/strong&gt;&lt;/em&gt;
-
is your ISO language code and <em><strong>YY</strong></em>
+
is your ISO language code and &lt;em&gt;&lt;strong&gt;YY&lt;/strong&gt;&lt;/em&gt;
is your ISO country code. For example, fr-FR is French, pt-BR is
is your ISO country code. For example, fr-FR is French, pt-BR is
Line 38: Line 39:
don't know the ISO code for your language, look [http://www.loc.gov/standards/iso639-2/englangn.html here]
don't know the ISO code for your language, look [http://www.loc.gov/standards/iso639-2/englangn.html here]
and [http://www.sil.org/iso639-3/iso-639-3_Name_Index_20080529.tab here]
and [http://www.sil.org/iso639-3/iso-639-3_Name_Index_20080529.tab here]
-
and see [http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html this list] of ISO county codes.)</p>
+
and see [http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html this list] of ISO county codes.)&lt;/p&gt;
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
$ mv abiword.pot xx-YY.po
$ mv abiword.pot xx-YY.po
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<h3>Step 3: Translate xx-YY.po</h3>
+
&lt;h3&gt;Step 3: Translate xx-YY.po&lt;/h3&gt;
-
<p>Each phrase to translate in the file <strong><em>xx-YY</em>.po</strong>
+
&lt;p&gt;Each phrase to translate in the file &lt;strong&gt;&lt;em&gt;xx-YY&lt;/em&gt;.po&lt;/strong&gt;
-
will appear in this format:</p>
+
will appear in this format:&lt;/p&gt;
   
   
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
-
     WHITE-SPACE<br />
+
     WHITE-SPACE&lt;br /&gt;
-
     #  TRANSLATOR-COMMENTS<br />
+
     #  TRANSLATOR-COMMENTS&lt;br /&gt;
-
     #. AUTOMATIC-COMMENTS<br />
+
     #. AUTOMATIC-COMMENTS&lt;br /&gt;
-
     #: REFERENCE...<br />
+
     #: REFERENCE...&lt;br /&gt;
-
     #, FLAG...<br />
+
     #, FLAG...&lt;br /&gt;
-
     msgid UNTRANSLATED-STRING<br />
+
     msgid UNTRANSLATED-STRING&lt;br /&gt;
     msgstr TRANSLATED-STRING
     msgstr TRANSLATED-STRING
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<p>The important elements are the <b>msgid</b> which contains the orignal
+
&lt;p&gt;The important elements are the &lt;b&gt;msgid&lt;/b&gt; which contains the orignal
-
phrase in English and the <b>msgstr</b> which contains the translated  
+
phrase in English and the &lt;b&gt;msgstr&lt;/b&gt; which contains the translated  
-
phrase. You only need to change the <b>msgstr</b>. For example,  
+
phrase. You only need to change the &lt;b&gt;msgstr&lt;/b&gt;. For example,  
-
if you are translating the msgid "Cancel" into Spanish,  
+
if you are translating the msgid &quot;Cancel&quot; into Spanish,  
-
you would only need to change from this:</p>
+
you would only need to change from this:&lt;/p&gt;
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
-
     #. DLG_Cancel<br />
+
     #. DLG_Cancel&lt;br /&gt;
-
     #: po/tmp/xap_String_Id.h.h:127<br />
+
     #: po/tmp/xap_String_Id.h.h:127&lt;br /&gt;
-
     msgid "Cancel"<br />
+
     msgid &quot;Cancel&quot;&lt;br /&gt;
-
     msgstr ""<br />
+
     msgstr &quot;&quot;&lt;br /&gt;
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<p>To this:</p>
+
&lt;p&gt;To this:&lt;/p&gt;
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
-
   #. DLG_Cancel<br />
+
   #. DLG_Cancel&lt;br /&gt;
-
   #: po/tmp/xap_String_Id.h.h:127<br />
+
   #: po/tmp/xap_String_Id.h.h:127&lt;br /&gt;
-
   msgid "Cancel"<br />
+
   msgid &quot;Cancel&quot;&lt;br /&gt;
-
   msgstr "Cancelar"<br />
+
   msgstr &quot;Cancelar&quot;&lt;br /&gt;
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<p>If you are unsure how to translate a string, it is good idea to mark it
+
&lt;p&gt;If you are unsure how to translate a string, it is good idea to mark it
-
with a "fuzzy" flag and leave a comment for the next translator to check
+
with a &quot;fuzzy&quot; flag and leave a comment for the next translator to check
-
it. For instance if you don't know whether to translate "Cancel" as  
+
it. For instance if you don't know whether to translate &quot;Cancel&quot; as  
-
"Cancelar" or "Anular", you could change this entry to:</p>
+
&quot;Cancelar&quot; or &quot;Anular&quot;, you could change this entry to:&lt;/p&gt;
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
-
     #  Should it be "Cancelar" or "Anular"?<br />
+
     #  Should it be &quot;Cancelar&quot; or &quot;Anular&quot;?&lt;br /&gt;
-
     #. DLG_Cancel<br />
+
     #. DLG_Cancel&lt;br /&gt;
-
     #: po/tmp/xap_String_Id.h.h:127<br />
+
     #: po/tmp/xap_String_Id.h.h:127&lt;br /&gt;
-
     #, fuzzy<br />
+
     #, fuzzy&lt;br /&gt;
-
     msgid "Cancel"<br />
+
     msgid &quot;Cancel&quot;&lt;br /&gt;
-
     msgstr "Cancelar"<br />
+
     msgstr &quot;Cancelar&quot;&lt;br /&gt;
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<p>Strings which contain a <strong>"&amp;"</strong> or  
+
&lt;p&gt;Strings which contain a &lt;strong&gt;&quot;&amp;amp;&quot;&lt;/strong&gt; or  
-
<strong>"&amp;amp;"</strong> can be accessed with a  
+
&lt;strong&gt;&quot;&amp;amp;amp;&quot;&lt;/strong&gt; can be accessed with a  
key press in a menu or a dialog box. The character  
key press in a menu or a dialog box. The character  
-
following the <strong>&amp;</strong> or  
+
following the &lt;strong&gt;&amp;amp;&lt;/strong&gt; or  
-
<strong>"&amp;amp;"</strong> will be underlined to
+
&lt;strong&gt;&quot;&amp;amp;amp;&quot;&lt;/strong&gt; will be underlined to
-
tell the user which key to press.</p>
+
tell the user which key to press.&lt;/p&gt;
-
<p>For example, the menu item "&amp;Header"
+
&lt;p&gt;For example, the menu item &quot;&amp;amp;Header&quot;
-
would appear as "<u>H</u>eader" and can be reached by  
+
would appear as &quot;&lt;u&gt;H&lt;/u&gt;eader&quot; and can be reached by  
-
pressing <b>H</b> or <b>Alt + H</b>. The Spanish  
+
pressing &lt;b&gt;H&lt;/b&gt; or &lt;b&gt;Alt + H&lt;/b&gt;. The Spanish  
-
translation of "Header" is "Cabecera", so the  
+
translation of &quot;Header&quot; is &quot;Cabecera&quot;, so the  
-
strings would look like this:</p>
+
strings would look like this:&lt;/p&gt;
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
-
     msgid "&amp;Header"<br />
+
     msgid &quot;&amp;amp;Header&quot;&lt;br /&gt;
-
     msgstr "&amp;amp;Cabecera"
+
     msgstr &quot;&amp;amp;amp;Cabecera&quot;
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<p>Only underline one character per menu item and avoid chosing
+
&lt;p&gt;Only underline one character per menu item and avoid chosing
thin characters such as 'i' or 'l' because it will be difficult for
thin characters such as 'i' or 'l' because it will be difficult for
the AbiWord user to see that these characters are underlined. Also
the AbiWord user to see that these characters are underlined. Also
avoid underlining characters such as 'j' and 'y' whose strokes are
avoid underlining characters such as 'j' and 'y' whose strokes are
-
lower than normal letters and difficult to read when underlined.</p>
+
lower than normal letters and difficult to read when underlined.&lt;/p&gt;
-
<p>Long strings that are difficult to read can be broken
+
&lt;p&gt;Long strings that are difficult to read can be broken
into multiple lines by enclosed extra lines in double quotation marks.
into multiple lines by enclosed extra lines in double quotation marks.
Breaking the string into multiple lines will have no effect on
Breaking the string into multiple lines will have no effect on
the final string, since the computer will strip away any spaces
the final string, since the computer will strip away any spaces
-
and hard returns outside of the quotation marks. </p>
+
and hard returns outside of the quotation marks. &lt;/p&gt;
-
<p>If you want to  
+
&lt;p&gt;If you want to  
put double quotation marks inside a string, use
put double quotation marks inside a string, use
-
the escape code <b>\"</b>&nbsp;&nbsp;
+
the escape code &lt;b&gt;\&quot;&lt;/b&gt;&amp;nbsp;&amp;nbsp;
-
The escape code <b>\n</b> adds a hard return to a string and <b>\t</b>
+
The escape code &lt;b&gt;\n&lt;/b&gt; adds a hard return to a string and &lt;b&gt;\t&lt;/b&gt;
adds a tab. As a general rule, only add these escape codes to
adds a tab. As a general rule, only add these escape codes to
-
the <b>msgstr</b> if they are found in the <b>msgid</b>.
+
the &lt;b&gt;msgstr&lt;/b&gt; if they are found in the &lt;b&gt;msgid&lt;/b&gt;.
-
If you see <b>%s</b> or <b>%d</b> in the <b>msgid</b>,
+
If you see &lt;b&gt;%s&lt;/b&gt; or &lt;b&gt;%d&lt;/b&gt; in the &lt;b&gt;msgid&lt;/b&gt;,
that indicates that a string variable or a numerical
that indicates that a string variable or a numerical
variable will be inserted into the string at that point. Make sure that
variable will be inserted into the string at that point. Make sure that
-
the <b>msgstr</b> contains the same number of these variables as are found in
+
the &lt;b&gt;msgstr&lt;/b&gt; contains the same number of these variables as are found in
-
the <b>msgid</b>.</p>
+
the &lt;b&gt;msgid&lt;/b&gt;.&lt;/p&gt;
-
<p>For instance, here is a good example of a screen message
+
&lt;p&gt;For instance, here is a good example of a screen message
with a number of
with a number of
escape codes and variable codes. Notice how it is broken up over
escape codes and variable codes. Notice how it is broken up over
several lines to make it easier to read and each line is enclosed in
several lines to make it easier to read and each line is enclosed in
-
double quotation marks:</p>
+
double quotation marks:&lt;/p&gt;
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
-
msgid ""<br />
+
msgid &quot;&quot;&lt;br /&gt;
-
"%s not implemented yet.\n\n"<br />
+
&quot;%s not implemented yet.\n\n&quot;&lt;br /&gt;
-
"If you are a programmer, feel free to add code in %s, line %d\n"<br />
+
&quot;If you are a programmer, feel free to add code in %s, line %d\n&quot;&lt;br /&gt;
-
"and mail patches to:\n\n"<br />
+
&quot;and mail patches to:\n\n&quot;&lt;br /&gt;
-
"\tabiword-dev@abisource.com\n\n"<br />
+
&quot;\tabiword-dev@abisource.com\n\n&quot;&lt;br /&gt;
-
"Otherwise, please be patient."<br />
+
&quot;Otherwise, please be patient.&quot;&lt;br /&gt;
-
msgstr ""<br />
+
msgstr &quot;&quot;&lt;br /&gt;
-
"%s todaví­a no está implementado.\n\n"<br />
+
&quot;%s todaví­a no está implementado.\n\n&quot;&lt;br /&gt;
-
"Si usted es un programador, siéntase libre para
+
&quot;Si usted es un programador, siéntase libre para
añadir código en %s, lí­nea
añadir código en %s, lí­nea
-
%d\n"<br />
+
%d\n&quot;&lt;br /&gt;
-
"y enviar parches a:\n\n"<br />
+
&quot;y enviar parches a:\n\n&quot;&lt;br /&gt;
-
"\tabiword-dev@abisource.com\n\n"<br />
+
&quot;\tabiword-dev@abisource.com\n\n&quot;&lt;br /&gt;
-
"En otro caso, tenga paciencia."
+
&quot;En otro caso, tenga paciencia.&quot;
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<p>You can edit the file <b><i>xx-YY</i>.po</b>
+
&lt;p&gt;You can edit the file &lt;b&gt;&lt;i&gt;xx-YY&lt;/i&gt;.po&lt;/b&gt;
with any text editor so
with any text editor so
long as you save it in the same character encoding which is listed in the header of the PO file. It is best to use
long as you save it in the same character encoding which is listed in the header of the PO file. It is best to use
Line 170: Line 171:
to enclose it in double quotation marks.   
to enclose it in double quotation marks.   
[http://notepad-plus.sourceforge.net Notepad++]
[http://notepad-plus.sourceforge.net Notepad++]
-
is a good text editor for Windows users. (Set "Language" to "C" and  
+
is a good text editor for Windows users. (Set &quot;Language&quot; to &quot;C&quot; and  
-
mark "Encode in UTF-8" under "Format").</p>
+
mark &quot;Encode in UTF-8&quot; under &quot;Format&quot;).&lt;/p&gt;
    
    
-
<p>Some people prefer to use special
+
&lt;p&gt;Some people prefer to use special
translation software such as [http://kbabel.kde.org/ KBabel]
translation software such as [http://kbabel.kde.org/ KBabel]
or [http://www.poedit.org/ poedit]
or [http://www.poedit.org/ poedit]
Line 181: Line 182:
word. If multiple people will be working on
word. If multiple people will be working on
the translation, it may be easier to use a web-based PO translator such
the translation, it may be easier to use a web-based PO translator such
-
as [http://pootle.wordforge.org Pootle].</p>
+
as [http://pootle.wordforge.org Pootle].&lt;/p&gt;
-
<p>If you are translating in a language which borrows a lot of frases from another language, you can use the script [http://www.runasimipi.org/blanco-en.php?file=instrans instrans.php]
+
&lt;p&gt;If you are translating in a language which borrows a lot of frases from another language, you can use the script [http://www.runasimipi.org/blanco-en.php?file=instrans instrans.php]
to insert translations from that other language. For example many
to insert translations from that other language. For example many
indigenous language in Latin America use Spanish frases for computer
indigenous language in Latin America use Spanish frases for computer
-
terminology. &nbsp;A translator can leave these terms blank and
+
terminology. &amp;nbsp;A translator can leave these terms blank and
-
use&nbsp;instrans.php to insert the Spanish frases in the PO file. In
+
use&amp;nbsp;instrans.php to insert the Spanish frases in the PO file. In
addition, people who can't read English or want to see the translation
addition, people who can't read English or want to see the translation
in a third language can use instrans with the --comment option to
in a third language can use instrans with the --comment option to
Line 193: Line 194:
the PO file. For instance, translators of Quechua (an indigenous
the PO file. For instance, translators of Quechua (an indigenous
language of the Andes) often want to see the translation in Spanish
language of the Andes) often want to see the translation in Spanish
-
before translating into Quechua.</p>
+
before translating into Quechua.&lt;/p&gt;
-
<h3>Step 4: Check the Translation</h3>
+
&lt;h3&gt;Step 4: Check the Translation&lt;/h3&gt;
-
<p>After you have finished your translation, you should
+
&lt;p&gt;After you have finished your translation, you should
check how it will appear in AbiWord. In order to test your translation
check how it will appear in AbiWord. In order to test your translation
-
you will have to convert it from a <b>.po</b>
+
you will have to convert it from a &lt;b&gt;.po&lt;/b&gt;
-
file to a <b>.string</b> file with the perl script <b>ui-backport.pl</b>.
+
file to a &lt;b&gt;.string&lt;/b&gt; file with the perl script &lt;b&gt;ui-backport.pl&lt;/b&gt;.
-
Go to the <b>abiword/po</b> directory and issue the command:</p>
+
Go to the &lt;b&gt;abiword/po&lt;/b&gt; directory and issue the command:&lt;/p&gt;
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
$ ./ui-backport.pl xx-YY
$ ./ui-backport.pl xx-YY
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<p>This script will create a file called <b><i>
+
&lt;p&gt;This script will create a file called &lt;b&gt;&lt;i&gt;
-
xx.YY</i>.string</b>
+
xx.YY&lt;/i&gt;.string&lt;/b&gt;
-
in the directory <b>abiword/user/wp/strings</b>.
+
in the directory &lt;b&gt;abiword/user/wp/strings&lt;/b&gt;.
If you have downloaded the complete source code
If you have downloaded the complete source code
you can compile and install AbiWord now and see if your translation
you can compile and install AbiWord now and see if your translation
worked. Instead, you may also test your translation with an existing installation of AbiWord. Find
worked. Instead, you may also test your translation with an existing installation of AbiWord. Find
-
the <b>AbiWord/strings</b> directory in your installed
+
the &lt;b&gt;AbiWord/strings&lt;/b&gt; directory in your installed
copy of AbiWord. On Linux/UNIX you will typically find it at
copy of AbiWord. On Linux/UNIX you will typically find it at
-
<b>/usr/share/AbiSuite-2.<i>X</i>/AbiWord/strings</b>
+
&lt;b&gt;/usr/share/AbiSuite-2.&lt;i&gt;X&lt;/i&gt;/AbiWord/strings&lt;/b&gt;
-
and in Windows at <b>c:\Program
+
and in Windows at &lt;b&gt;c:\Program
-
Files\AbiSuite2\Abiword\strings</b>. In
+
Files\AbiSuite2\Abiword\strings&lt;/b&gt;. In
-
Linux/UNIX/OS X you can find your string file with the locate command:</p>
+
Linux/UNIX/OS X you can find your string file with the locate command:&lt;/p&gt;
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
-
  $ updatedb<br />
+
  $ updatedb&lt;br /&gt;
  $ locate xx-YY.string
  $ locate xx-YY.string
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<p>Now replace the existing .string file with the one that you just
+
&lt;p&gt;Now replace the existing .string file with the one that you just
created. Rename the existing xx-YY.string file to xx.YY.string.old and
created. Rename the existing xx-YY.string file to xx.YY.string.old and
-
then copy your new .string file from the directory <b>abi/user/wp/strings</b>
+
then copy your new .string file from the directory &lt;b&gt;abi/user/wp/strings&lt;/b&gt;
-
to <b>AbiWord/strings</b>. If you have <b>abiword</b> trunk checked out in the  
+
to &lt;b&gt;AbiWord/strings&lt;/b&gt;. If you have &lt;b&gt;abiword&lt;/b&gt; trunk checked out in the  
-
<b>home/user</b> directory, the commands would be:</p>
+
&lt;b&gt;home/user&lt;/b&gt; directory, the commands would be:&lt;/p&gt;
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
-
  $ su<br />
+
  $ su&lt;br /&gt;
-
  &nbsp;&nbsp;&nbsp;&nbsp;<i>enter the root password</i><br />
+
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;i&gt;enter the root password&lt;/i&gt;&lt;br /&gt;
-
  # cd /usr/share/AbiSuite-2.X/AbiWord/strings<br />
+
  # cd /usr/share/AbiSuite-2.X/AbiWord/strings&lt;br /&gt;
-
  # mv xx-YY.strings xx-YY.strings.old<br />
+
  # mv xx-YY.strings xx-YY.strings.old&lt;br /&gt;
-
  # cp /home/user/abi/user/wp/strings/xx-YY.strings ./<br />
+
  # cp /home/user/abi/user/wp/strings/xx-YY.strings ./&lt;br /&gt;
  # exit
  # exit
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<p>If you are using Windows, start up AbiWord and go to
+
&lt;p&gt;If you are using Windows, start up AbiWord and go to
-
<b>Tools</b>-&gt;<b>Preferences</b> and change the  
+
&lt;b&gt;Tools&lt;/b&gt;-&amp;gt;&lt;b&gt;Preferences&lt;/b&gt; and change the  
-
<b>"User Interface Language"</b> to
+
&lt;b&gt;&quot;User Interface Language&quot;&lt;/b&gt; to
your language. After you quit and restart AbiWord, the program should
your language. After you quit and restart AbiWord, the program should
using your new translation. If you are starting a new translation of
using your new translation. If you are starting a new translation of
Line 252: Line 253:
with a different language code. For instance, you could rename it as
with a different language code. For instance, you could rename it as
pt-BR.strings and then select Brazilian Portuguese as your user
pt-BR.strings and then select Brazilian Portuguese as your user
-
interface language to see your translation in AbiWord </p>
+
interface language to see your translation in AbiWord &lt;/p&gt;
-
<p>To order to run AbiWord with your translation in Linux/UNIX/OS X, your
+
&lt;p&gt;To order to run AbiWord with your translation in Linux/UNIX/OS X, your
locale needs to be set to your translation language. Check what
locale needs to be set to your translation language. Check what
-
language you are currently in:</p>
+
language you are currently in:&lt;/p&gt;
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
$ locale
$ locale
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<p>If your locale doesn't match the language of your
+
&lt;p&gt;If your locale doesn't match the language of your
-
.string file, change it to match:</p>
+
.string file, change it to match:&lt;/p&gt;
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
-
$ LANG=xx_YY.UTF-8<br />
+
$ LANG=xx_YY.UTF-8&lt;br /&gt;
$ export LANG
$ export LANG
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<p>Now run AbiWord. If AbiWord starts up in English, then
+
&lt;p&gt;Now run AbiWord. If AbiWord starts up in English, then
there is probably something wrong with your PO file. Check that all the
there is probably something wrong with your PO file. Check that all the
-
strings terminate in double quotation marks and that the number of <b>%s</b>
+
strings terminate in double quotation marks and that the number of &lt;b&gt;%s&lt;/b&gt;
-
and <b>%d</b> codes in the <b>msgid</b> matches the number in <b>msgstr</b>.</p>
+
and &lt;b&gt;%d&lt;/b&gt; codes in the &lt;b&gt;msgid&lt;/b&gt; matches the number in &lt;b&gt;msgstr&lt;/b&gt;.&lt;/p&gt;
-
<p>Open all the dialog boxes in AbiWord and make sure that
+
&lt;p&gt;Open all the dialog boxes in AbiWord and make sure that
your translations fit in the available space. You may have to use
your translations fit in the available space. You may have to use
shorter phrases to fit in the buttons. Check each menu and submenu to
shorter phrases to fit in the buttons. Check each menu and submenu to
Line 281: Line 282:
shortcut character has been assigned to more than one item in a menu.
shortcut character has been assigned to more than one item in a menu.
Also check to see that the underlined character is easy to see for each
Also check to see that the underlined character is easy to see for each
-
menu item. Check the shortcut characters in dialog boxes as well.</p>
+
menu item. Check the shortcut characters in dialog boxes as well.&lt;/p&gt;
-
<p>If possible you should check your translation in both
+
&lt;p&gt;If possible you should check your translation in both
Windows and Linus/UNIX because many of the dialog boxes such as
Windows and Linus/UNIX because many of the dialog boxes such as
-
"Preferences" are not the same in different operating systems.</p>
+
&quot;Preferences&quot; are not the same in different operating systems.&lt;/p&gt;
-
<p>Don't worry if you see some of the standard buttons in
+
&lt;p&gt;Don't worry if you see some of the standard buttons in
dialog boxes in a different language other than your translation. In
dialog boxes in a different language other than your translation. In
some of its dialog boxes AbiWord is using standard system buttons whose
some of its dialog boxes AbiWord is using standard system buttons whose
Line 298: Line 299:
Quechua or Basque where you would prefer the buttons to default to a
Quechua or Basque where you would prefer the buttons to default to a
different language like Spanish, but there is nothing that you can do
different language like Spanish, but there is nothing that you can do
-
about it.</p>
+
about it.&lt;/p&gt;
When you have finished using AbiWord, remember to return your system to its original language using LANG and export.
When you have finished using AbiWord, remember to return your system to its original language using LANG and export.
-
<h3>Step 5: Submit the Translation</h3>
+
&lt;h3&gt;Step 5: Submit the Translation&lt;/h3&gt;
-
<p>After you have translated and tested your translation,
+
&lt;p&gt;After you have translated and tested your translation,
please send your xx-YY.po file to the developer's mailing list so that
please send your xx-YY.po file to the developer's mailing list so that
we can incorporate your translation into the project. Please zip the
we can incorporate your translation into the project. Please zip the
attachment before sending it, as that will be more convenient for users
attachment before sending it, as that will be more convenient for users
on slow internet connections, and to prevent it from being marked as
on slow internet connections, and to prevent it from being marked as
-
spam my our mail server.</p>
+
spam my our mail server.&lt;/p&gt;
-
<p>You can subscribe to the mailing list by sending an
+
&lt;p&gt;You can subscribe to the mailing list by sending an
-
email to abiword-dev-request@abisource.com with the word "subscribe" in the mesage body. Once you're subscribed,
+
email to abiword-dev-request@abisource.com with the word &quot;subscribe&quot; in the mesage body. Once you're subscribed,
you can send an email to abiword-dev@abisource.com
you can send an email to abiword-dev@abisource.com
and attach your translation. Please zip or gzip your attachment before
and attach your translation. Please zip or gzip your attachment before
-
sending it, otherwise it might be too large or marked as spam.</p>
+
sending it, otherwise it might be too large or marked as spam.&lt;/p&gt;
-
<p>If you started translating your xx-YY.po file several months ago, you  
+
&lt;p&gt;If you started translating your xx-YY.po file several months ago, you  
may want to update it before submitting it to be included in the project  
may want to update it before submitting it to be included in the project  
source code. In a couple months time, some of the original msgid strings  
source code. In a couple months time, some of the original msgid strings  
-
may have changed and new ones may have been added.</p>
+
may have changed and new ones may have been added.&lt;/p&gt;
   
   
-
<p>To update your <b>xx-YY.po</b> file, take an svn update on the abiword <b>trunk</b>
+
&lt;p&gt;To update your &lt;b&gt;xx-YY.po&lt;/b&gt; file, take an svn update on the abiword &lt;b&gt;trunk&lt;/b&gt;
-
and copy your <b>xx.YY.po</b> file into the <b>abiword/po</b> directory.
+
and copy your &lt;b&gt;xx.YY.po&lt;/b&gt; file into the &lt;b&gt;abiword/po&lt;/b&gt; directory.
-
Then run the <b>update.pl</b> script to check for changes:</p>
+
Then run the &lt;b&gt;update.pl&lt;/b&gt; script to check for changes:&lt;/p&gt;
-
<blockquote><code>
+
&lt;blockquote&gt;&lt;code&gt;
$ ./update.pl xx-YY
$ ./update.pl xx-YY
-
</code></blockquote>
+
&lt;/code&gt;&lt;/blockquote&gt;
-
<p>The <b>update.pl</b> script will not only add any new strings to be translated,
+
&lt;p&gt;The &lt;b&gt;update.pl&lt;/b&gt; script will not only add any new strings to be translated,
-
it will also mark any changed strings with a "fuzzy" flag. You can do a search
+
it will also mark any changed strings with a &quot;fuzzy&quot; flag. You can do a search
-
for the word "fuzzy" to find these changed strings, so you can change  
+
for the word &quot;fuzzy&quot; to find these changed strings, so you can change  
-
them before submitting your translation.</p>
+
them before submitting your translation.&lt;/p&gt;

Revision as of 04:26, 24 November 2010

Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page

<h2 dir="ltr">New AbiWord Translation</h2>

<p>These instructions will allow you to translate AbiWord for a language that does not have an existing translation yet.</p>

<p>Before you start, make sure that you have SVN and Perl installed on your computer.

<h3>Step 1: Download AbiWord via SVN</h3>

<p>There are Instructions for using SVN to download AbiWord's source code.</p>

<blockquote><code>

    $ svn co http://svn.abisource.com/abiword/trunk abiword

</code></blockquote>

<h3>Step 2: Build a New Translation File</h3>

<p>You need a build a file called abiword.pot which is basically a blank translation of AbiWord's strings.</p>

<p>To do this, go into the <strong>abiword/po</strong> directory and run the "update.pl" script as follows:</p>

<blockquote><code> $ ./update.pl --pot </code></blockquote>

<p>This should produce the file <strong>abiword.pot</strong>.</p>

<p> Now you are ready to make the new translation file for your language. All you need to do is rename <strong>abiword.pot</strong> to the form <strong><em>xx-YY</em>.po</strong> where <em><strong>xx</strong></em> or <em><strong>xxx</strong></em> is your ISO language code and <em><strong>YY</strong></em>

is your ISO country code. For example, fr-FR is French, pt-BR is Brazilian Portuguese, and arn-CL is Mapudungun from Chile. (If you don't know the ISO code for your language, look here and here and see this list of ISO county codes.)</p>

<blockquote><code> $ mv abiword.pot xx-YY.po </code></blockquote>

<h3>Step 3: Translate xx-YY.po</h3>

<p>Each phrase to translate in the file <strong><em>xx-YY</em>.po</strong> will appear in this format:</p>

<blockquote><code>

   WHITE-SPACE<br />
   #  TRANSLATOR-COMMENTS<br />
   #. AUTOMATIC-COMMENTS<br />
   #: REFERENCE...<br />
   #, FLAG...<br />
   msgid UNTRANSLATED-STRING<br />
   msgstr TRANSLATED-STRING

</code></blockquote>

<p>The important elements are the <b>msgid</b> which contains the orignal phrase in English and the <b>msgstr</b> which contains the translated phrase. You only need to change the <b>msgstr</b>. For example, if you are translating the msgid "Cancel" into Spanish, you would only need to change from this:</p>

<blockquote><code>

   #. DLG_Cancel<br />
   #: po/tmp/xap_String_Id.h.h:127<br />
   msgid "Cancel"<br />
   msgstr ""<br />

</code></blockquote>

<p>To this:</p>

<blockquote><code>

  #. DLG_Cancel<br />
  #: po/tmp/xap_String_Id.h.h:127<br />
  msgid "Cancel"<br />
  msgstr "Cancelar"<br />

</code></blockquote>

<p>If you are unsure how to translate a string, it is good idea to mark it with a "fuzzy" flag and leave a comment for the next translator to check it. For instance if you don't know whether to translate "Cancel" as "Cancelar" or "Anular", you could change this entry to:</p>

<blockquote><code>

   #  Should it be "Cancelar" or "Anular"?<br />
   #. DLG_Cancel<br />
   #: po/tmp/xap_String_Id.h.h:127<br />
   #, fuzzy<br />
   msgid "Cancel"<br />
   msgstr "Cancelar"<br />

</code></blockquote>

<p>Strings which contain a <strong>"&amp;"</strong> or <strong>"&amp;amp;"</strong> can be accessed with a key press in a menu or a dialog box. The character following the <strong>&amp;</strong> or <strong>"&amp;amp;"</strong> will be underlined to tell the user which key to press.</p>

<p>For example, the menu item "&amp;Header" would appear as "<u>H</u>eader" and can be reached by pressing <b>H</b> or <b>Alt + H</b>. The Spanish translation of "Header" is "Cabecera", so the strings would look like this:</p>

<blockquote><code>

   msgid "&amp;Header"<br />
   msgstr "&amp;amp;Cabecera"

</code></blockquote>

<p>Only underline one character per menu item and avoid chosing thin characters such as 'i' or 'l' because it will be difficult for the AbiWord user to see that these characters are underlined. Also avoid underlining characters such as 'j' and 'y' whose strokes are lower than normal letters and difficult to read when underlined.</p>

<p>Long strings that are difficult to read can be broken into multiple lines by enclosed extra lines in double quotation marks. Breaking the string into multiple lines will have no effect on the final string, since the computer will strip away any spaces and hard returns outside of the quotation marks. </p>

<p>If you want to put double quotation marks inside a string, use the escape code <b>\"</b>&nbsp;&nbsp; The escape code <b>\n</b> adds a hard return to a string and <b>\t</b> adds a tab. As a general rule, only add these escape codes to the <b>msgstr</b> if they are found in the <b>msgid</b>. If you see <b>%s</b> or <b>%d</b> in the <b>msgid</b>, that indicates that a string variable or a numerical variable will be inserted into the string at that point. Make sure that the <b>msgstr</b> contains the same number of these variables as are found in the <b>msgid</b>.</p>

<p>For instance, here is a good example of a screen message with a number of escape codes and variable codes. Notice how it is broken up over several lines to make it easier to read and each line is enclosed in double quotation marks:</p>

<blockquote><code> msgid ""<br /> "%s not implemented yet.\n\n"<br /> "If you are a programmer, feel free to add code in %s, line %d\n"<br /> "and mail patches to:\n\n"<br /> "\tabiword-dev@abisource.com\n\n"<br /> "Otherwise, please be patient."<br /> msgstr ""<br /> "%s todaví­a no está implementado.\n\n"<br /> "Si usted es un programador, siéntase libre para añadir código en %s, lí­nea %d\n"<br />

"y enviar parches a:\n\n"<br /> "\tabiword-dev@abisource.com\n\n"<br /> "En otro caso, tenga paciencia." </code></blockquote>

<p>You can edit the file <b><i>xx-YY</i>.po</b> with any text editor so long as you save it in the same character encoding which is listed in the header of the PO file. It is best to use UTF-8 (8-bit Unicode) encoding. To avoid syntax errors, use a text editor that recognizes source code such as emacs, vim, gedit, or kate so that you can see when you improperly terminated a string or forgot to enclose it in double quotation marks. Notepad++ is a good text editor for Windows users. (Set "Language" to "C" and mark "Encode in UTF-8" under "Format").</p>

<p>Some people prefer to use special translation software such as KBabel or poedit which has translation memory so you only have to translate a phrase once. These programs also help you maintain a consistant translation for every instance of a word. If multiple people will be working on the translation, it may be easier to use a web-based PO translator such as Pootle.</p>

<p>If you are translating in a language which borrows a lot of frases from another language, you can use the script instrans.php to insert translations from that other language. For example many indigenous language in Latin America use Spanish frases for computer terminology. &nbsp;A translator can leave these terms blank and use&nbsp;instrans.php to insert the Spanish frases in the PO file. In addition, people who can't read English or want to see the translation in a third language can use instrans with the --comment option to insert the translations from another language in the comment field in the PO file. For instance, translators of Quechua (an indigenous language of the Andes) often want to see the translation in Spanish before translating into Quechua.</p>


<h3>Step 4: Check the Translation</h3>

<p>After you have finished your translation, you should check how it will appear in AbiWord. In order to test your translation you will have to convert it from a <b>.po</b> file to a <b>.string</b> file with the perl script <b>ui-backport.pl</b>. Go to the <b>abiword/po</b> directory and issue the command:</p>

<blockquote><code> $ ./ui-backport.pl xx-YY </code></blockquote>

<p>This script will create a file called <b><i> xx.YY</i>.string</b> in the directory <b>abiword/user/wp/strings</b>. If you have downloaded the complete source code you can compile and install AbiWord now and see if your translation worked. Instead, you may also test your translation with an existing installation of AbiWord. Find the <b>AbiWord/strings</b> directory in your installed copy of AbiWord. On Linux/UNIX you will typically find it at

<b>/usr/share/AbiSuite-2.<i>X</i>/AbiWord/strings</b> and in Windows at <b>c:\Program Files\AbiSuite2\Abiword\strings</b>. In Linux/UNIX/OS X you can find your string file with the locate command:</p>

<blockquote><code>

$ updatedb<br />
$ locate xx-YY.string

</code></blockquote>

<p>Now replace the existing .string file with the one that you just created. Rename the existing xx-YY.string file to xx.YY.string.old and then copy your new .string file from the directory <b>abi/user/wp/strings</b> to <b>AbiWord/strings</b>. If you have <b>abiword</b> trunk checked out in the <b>home/user</b> directory, the commands would be:</p>

<blockquote><code>

$ su<br />
&nbsp;&nbsp;&nbsp;&nbsp;<i>enter the root password</i><br />
# cd /usr/share/AbiSuite-2.X/AbiWord/strings<br />
# mv xx-YY.strings xx-YY.strings.old<br />
# cp /home/user/abi/user/wp/strings/xx-YY.strings ./<br />
# exit

</code></blockquote>

<p>If you are using Windows, start up AbiWord and go to <b>Tools</b>-&gt;<b>Preferences</b> and change the <b>"User Interface Language"</b> to your language. After you quit and restart AbiWord, the program should using your new translation. If you are starting a new translation of AbiWord, then AbiWord probably doesn't recognize your language because it doesn't have a language code for it yet. You can still test your translation by renaming your .strings file to an existing .strings file with a different language code. For instance, you could rename it as pt-BR.strings and then select Brazilian Portuguese as your user interface language to see your translation in AbiWord </p>

<p>To order to run AbiWord with your translation in Linux/UNIX/OS X, your locale needs to be set to your translation language. Check what language you are currently in:</p>

<blockquote><code> $ locale </code></blockquote>

<p>If your locale doesn't match the language of your .string file, change it to match:</p>

<blockquote><code> $ LANG=xx_YY.UTF-8<br /> $ export LANG </code></blockquote>

<p>Now run AbiWord. If AbiWord starts up in English, then there is probably something wrong with your PO file. Check that all the strings terminate in double quotation marks and that the number of <b>%s</b> and <b>%d</b> codes in the <b>msgid</b> matches the number in <b>msgstr</b>.</p>

<p>Open all the dialog boxes in AbiWord and make sure that your translations fit in the available space. You may have to use shorter phrases to fit in the buttons. Check each menu and submenu to see whether each menu item can be accessed with a key press and no shortcut character has been assigned to more than one item in a menu. Also check to see that the underlined character is easy to see for each menu item. Check the shortcut characters in dialog boxes as well.</p>

<p>If possible you should check your translation in both Windows and Linus/UNIX because many of the dialog boxes such as "Preferences" are not the same in different operating systems.</p>

<p>Don't worry if you see some of the standard buttons in dialog boxes in a different language other than your translation. In some of its dialog boxes AbiWord is using standard system buttons whose appearance isn't controlled by xx-YY.strings file. In Windows, these buttons will appear in the language of the operating system. Since Windows Unicode Port is in progress, you may find some of the dialogs in incomplete state in Windows. In Linux/UNIX your standard system buttons will default to English if your system doesn't recognize your language or have a translation for your language. This can be a very annoying feature if you are working with a minority language like Quechua or Basque where you would prefer the buttons to default to a different language like Spanish, but there is nothing that you can do about it.</p>

When you have finished using AbiWord, remember to return your system to its original language using LANG and export.

<h3>Step 5: Submit the Translation</h3>

<p>After you have translated and tested your translation, please send your xx-YY.po file to the developer's mailing list so that we can incorporate your translation into the project. Please zip the attachment before sending it, as that will be more convenient for users on slow internet connections, and to prevent it from being marked as spam my our mail server.</p>

<p>You can subscribe to the mailing list by sending an email to abiword-dev-request@abisource.com with the word "subscribe" in the mesage body. Once you're subscribed, you can send an email to abiword-dev@abisource.com and attach your translation. Please zip or gzip your attachment before sending it, otherwise it might be too large or marked as spam.</p>

<p>If you started translating your xx-YY.po file several months ago, you may want to update it before submitting it to be included in the project source code. In a couple months time, some of the original msgid strings may have changed and new ones may have been added.</p>

<p>To update your <b>xx-YY.po</b> file, take an svn update on the abiword <b>trunk</b> and copy your <b>xx.YY.po</b> file into the <b>abiword/po</b> directory. Then run the <b>update.pl</b> script to check for changes:</p>

<blockquote><code> $ ./update.pl xx-YY </code></blockquote>

<p>The <b>update.pl</b> script will not only add any new strings to be translated, it will also mark any changed strings with a "fuzzy" flag. You can do a search for the word "fuzzy" to find these changed strings, so you can change them before submitting your translation.</p>

Personal tools