• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Translating xenForo with the .PO format advantages

cclaerhout

Well-known member
Translating xenForo with the .PO format advantages
xf2po & po2xf Converters

What's this « thing »?
This « thing » is a way to convert the xenForo language file from XML format to PO format (xf2po) & to convert back a PO file to xenForo language XML file(po2xf).

Great... and what's the purpose?
To use the advantages provided by the PO format for translators: faster translation, faster update and Collaborative Computer-assisted translation (CAT) on Internet.

Hey, hold one, what is a PO file and what are its advantages?
A PO file includes three main parts for each expression:
  1. An introductory comment
  2. The source language
  3. The translation
Unlike the original language file, each phrase has its own translation. Some software allow to edit this translation very quickly keeping an eye on the source language.

Translation memory
Having both the source language and its translation allow to create a « translation memory ». The Editing PO software will memorize the way you have translated phrases. If a non-translated phrase will match its memory, then it will suggest you to use the previous phrase you’ve already translated. This system allows translators to agree on which word to use in order to have a standardized translation.

Updates with more efficiency
The great advantage of this system is when a new language files comes out, it’s very easy to update your translation. Just open your previous translation, tell the software to update it with the new language file, and this one will add the new phrases and erase the former ones.

If the xenForo team updates one of the existing expressions, the software will detect it and will erase the former translation. The translator will have to translate it again (it should be done fast thanks to the translation memory). With this system the translation file is always up to date.

On-line Computer-assisted translation
Some websites will help you to have an on-line Computer-assisted translation. To use them with xenForo, the PO seems to be the only solution.

Great! And the converts are supposed to work with all version of xF?
Yes, since xfpo 1.02 there are supposed to work with all version of xF, providing your PO editor software doesn’t delete unnecessary PO comments ^^. And let’s suppose than it’s not working, the xfpo macros will just need to be updated. If can’t stand waiting, you still can use during this time the tradition way to translate an xml file ;)
The best solution would be the xF team develops her own system to make translations easier (especially the way to update them: find new phrases, find updates one, delete former ones). Wordress, Drupal did it, so why not xenForo? :)

Well understood! So please tell me how to use your converters? What are these .ini files?
Through lake of knowing how to program using Perl, I’ve used regular expressions (REGEX) using the great editor EDITPAD PRO (not free). This one use the REGEX (with the DOT ALL option). The .ini files are some macros I’ve written to use with that software. To import them, it’s very easy, just do: Macros=>Organise Macro=>Import Macros. Then choose the files and it’s done.

Then, to use them, it’s even simpler. Open your Xf XML language file. Start the macro xf2po, you will get in less than 2 seconds a new file using the PO format. Just save it with the PO extension. You will be able to edit it with any PO software.

Once you’ve have finished the translation, open your translation PO file in Editpad pro. Start the macro po2xf, and here is your xF XML translation file.
Please note that if you want to use an existing xF XML file, you’ll have to merge the Msgid from the xF PO language file to your PO translation file (see XFPO – Msgid Merging Procedure).

In your opinion, what is the best software to edit PO files?
In order to make an on-line Computer-assisted translation, it should be a cloud computing service. There are a few (will be listed later), but they still need time to get better. But if you want to edit, update, translate your PO translation file using your computer, the best software in my opinion is Virtaal (Wikipedia link|Website). Of course there is also POEDIT, but after tested it seems it doesn’t support the carriage return… which breaks the phrases format of the original xF translation file. That’s why I don’t recommending to use it.

I’ve noticed there’s a third macro called "po_kill_fuzzy.ini", what is it for?
Before to describe its purpose, it’s better to explain what “fuzzy” means (sorry if it sounds you obvious in English, but in French it wasn’t) because you will meet for sure this word during your translations in PO editing software. I’ve described above that a PO file included three main parts. Guess what, I’ve lied. In fact, there are four:
  1. An introductory comment
  2. The source language
  3. The translation
  4. "Fuzzy" or not?
The "Fuzzy" word points out if this is not the final translation and it needs to be confirmed by other translators. By default, the xf2po macro marks all phrases as “fuzzy”. If you’re sure of your phrases you can use the macro called “po_kill_fuzzy” to delete all “fuzzy” indications from the PO file.

I don’t understand why is there inside the source language (Msgid) some brackets with some value in it?
The PO format has many advantages but it is very awkward. It can’t stand to have any repetition of the source language (Msgid). Nevertheless in the xenForo XML file there are quite many (for example, the “Add-on” phrase” repeats several times), but this is absolutely normal. The xF team logic was to divide expressions per function using each time a different variable name. But here it is, it’s not compatible with the PO format. So to get round this problem, I’ve added inside the Msgid part these brackets that include the xF variable and version number. Of course, you mustn’t include theses brackets inside the translation ^^

____________________​
End of the description​
____________________​

----------------------------------------------
>>>Version history
----------------------------------------------
2010-11-02: version 1.0.2 released to public

----------------------------------------------
>>>Files
----------------------------------------------
  • (1) XFPO - xf2po & po2xf Converters.pdf (above description)
  • (2) XFPO - Msgid Merging Procedure.pdf (if you already have a translated xml file)
  • Archive xfpo v1.02.zip
    • xf2po_1.02.ini (macro)
    • Description xf2po (manual mode).txt
    • po2xf_1.02.ini (macro)
    • Description po2xf (manual mode).txt
    • po_kill_fuzzy.ini (macro)
The archive has got a password. Please send me a PM to get the password.
Edit 2011.08: no more password required
----------------------------------------------
>>>Why a password?
----------------------------------------------
It's for me a pacific way to protest against the attitude of some French guys. Want to know more? That's very simple. Please see that thread. I'm asking if the translation of this thread will be "opensource" (meaning that the ending credits can be deleted) [ref]. If it is, I will be happy to join the team, otherwise I will release my own "opensource" translation [ref]. The first answer is "no" [ref]. The reason : 1) to thank translators for their work 2) for the "ranking" of this website: xenfrench.com [ref]. Then a laughable idea is suggested: a paying version without the ending credits [ref]. Then two different translators had contacted me saying that they both have already finished to translate the xml file and they wanted to make it "opensource" (creative commons licence). They decide to work together and put their translation here the 24th of October [ref]. The day after the other translation (from xenfrench.com) comes out here. And guess what? It's also "opensource" [ref] ^^ Of course it can appear like a good thing, but instead of working together some people make translators working against each other to have exactly the same thing. That's a childish attitude. The French vB community had the same problem and it happens again! That's a non-sense. I continue to support this translation. But I do hope that some people will be enough clever to stop acting like this and will collaborate for the benefit of everybody. By the way, it could be a good thing if xF team makes clear on what copyright the translations and the modules can be distributed. It avoids many problems for the futur.
Thank your for you attention.
 

Attachments

On-line Computer-assisted translation (CAT) Services:
P.S : I still don't manage to find one CAT service with Translation Memory option

>www.crowdin.net
Working fine... but can't delete a project after its creation. I don't like this.
>www.transifex.net
It takes me quite a lot of time to understand how to use it. With this system, you will need to know how to use the "repository" system" in order to upload your files. For example, Google Code uses the "Mercurial" protocol (bless you)... A nice software will help you a little: http://tortoisehg.bitbucket.org/, but you will still need to understand how the repository sytem works. Good luck ! ^^
>http://mygengo.com/string/about
I've tried... Doesn't work.
>https://webtranslateit.com/
I've tried. It's expensive, the upload is long, and it deletes the translated phrases. May be I did something wrong. I don't know.
>Pottle
Should be an interesting solution, but you need to have a dedicated server and to know how to install python files with Apache.
>www.launchpad.net (thanks to Vladislav Rastrusny)
If someone wants to make a tutorial how yo use it, it would be nice.


Interesting links:
> http://www.alltogetherasawhole.org/profiles/blogs/time-for-a-new-language-file?id=4128374
> http://hojtsy.hu/blog/2010-may-05/using-drupal-collaborative-software-translation-tool
=> May be a way to do it with Drupal. I'm going to test.
> http://code.google.com/p/narro/
=> Nice project to remember
 
I have moved this to other resources as it is not a language resource as such,.
 
I will send a pm ... really use .po editor is the best to translate :)
* I already ask in another thread .. but you have a full [populated] xml english file?
Thanks
 
The password has been sent. I don't understand for the full XML English file. You've already got it, it's the default xF XML language file. If you want to have the PO file, I can send it to you, but it's easier to use the xF XML language file then use the macro xf2po :)
 
Does this script support converting .po files with custom plural forms? For example for russian I have this expression:
nplurals=3; plural=(n%10==1 && n%100!=11) ? 0 : ((n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20)) ? 1 : 2);
 
Does this script support converting .po files with custom plural forms? For example for russian I have this expression:
No. I've checked on Internet how do theses plurals forms appear inside the po file. It seems to be like that:
Code:
#, php-format
msgid "%d year"
msgid_plural "%d years"
msgstr[0] "%d Jahr"
msgstr[1] "%d Jahre"

The macros above won't support this, neither xenForo XML file. If xenForo XML file did, I guess It would be possible. Of course the easier way would be that xF support PO files :D



www.launchpad.net allows collaborative translations using po files.
Thanks. I remember to have tried but didn't succeed didn't understand how to make it work ^^.
Is it a system similar to transifex?
 
hello :
I don't give up ;)
another service to study
https://amanuens.com/

all the best
On-line Computer-assisted translation (CAT) Services:
P.S : I still don't manage to find one CAT service with Translation Memory option

>www.crowdin.net
Working fine... but can't delete a project after its creation. I don't like this.
>www.transifex.net
It takes me quite a lot of time to understand how to use it. With this system, you will need to know how to use the "repository" system" in order to upload your files. For example, Google Code uses the "Mercurial" protocol (bless you)... A nice software will help you a little: http://tortoisehg.bitbucket.org/, but you will still need to understand how the repository sytem works. Good luck ! ^^
>http://mygengo.com/string/about
I've tried... Doesn't work.
>https://webtranslateit.com/
I've tried. It's expensive, the upload is long, and it deletes the translated phrases. May be I did something wrong. I don't know.
>Pottle
Should be an interesting solution, but you need to have a dedicated server and to know how to install python files with Apache.
>www.launchpad.net (thanks to Vladislav Rastrusny)
If someone wants to make a tutorial how yo use it, it would be nice.


Interesting links:
> http://www.alltogetherasawhole.org/profiles/blogs/time-for-a-new-language-file?id=4128374
> http://hojtsy.hu/blog/2010-may-05/using-drupal-collaborative-software-translation-tool
=> May be a way to do it with Drupal. I'm going to test.
> http://code.google.com/p/narro/
=> Nice project to remember
 
Top Bottom