Update AbiWord Translation

From AbiWiki

Revision as of 13:30, 1 June 2008 by Amosbatto (Talk | contribs)
Jump to: navigation, search

Contents

Update an Existing AbiWord Translation

These instructions will allow you to update an existing AbiWord translation.

Step 1: Getting a Translation

First, you need to download a PO file containing the translation for your language. Look for the appropriate file from the translation status table on the right. These PO files appear in the form xx-YY.po where xx or xxx is your ISO language code and YY is your ISO country code. For example, fr-FR is French and pt-BR is Brazilian Portuguese. (If you don't know the ISO code for your language, look here and see this list of ISO county codes.)


Step 2: Translate xx-YY.po

Each phrase to translate in the file xx-YY.po will appear in this format:

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

The important elements are the msgid which contains the orignal phrase in English and the msgstr which contains the translated phrase. Look for msgstr's which haven't been translated. They will contain an empty string "".

For example, if you are translating the msgid "Cancel" into Spanish, you would only need to change "" to the Spanish word "Cancelar".

From this:

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

To this:

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

In addition to empty strings "", look for strings which are marked with the "fuzzy" flag:

#, fuzzy

When the original msgid strings are changed in the AbiWord source code, the translation is marked as "fuzzy", so you may have to retranslate these phrases. After you retranslate the phrase, remove the fuzzy flag so the next translator will know that the translation is no longer out of date.

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 the entry to:

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

Strings which contain a "&" or "&" can be accessed with a key press in a menu or a dialog box. The character following the & or "&" will be underlined to tell the user which key to press.

For example, the menu item "&Header" would appear as "Header" and can be reached by pressing H or Alt + H. The Spanish translation of "Header" is "Cabecera", so the strings would look like this:

msgid "&Header"
msgstr "&Cabecera"

Only underline one character per menu item and avoid choosing 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.

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.

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

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:

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

You can edit the file xx-YY.po with any text editor so long as you save it in the same character encoding listed in the PO header. It is recommended 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").

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 consistent 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.


Step 3: Check the Translation

After you have finished your translation, you may want to check how it will appear in AbiWord. Follow these instructions to download the abi module with CVS, and use the ui-backport.pl script to convert your xx-YY.po file to xx-YY.po Replace the xx-YY.strings file in your current installation of AbiWord with the xx-YY.strings file that you just created and then run AbiWord. For more information see New AbiWord Translation.


Step 4: Submit the Translation

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.

You can subscribe to the mailing list by sending an email to abiword-dev-request@abisource.com with the word "subscribe" in the message 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.

Personal tools