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:
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:
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 ^^
----------------------------------------------
>>>Version history
----------------------------------------------
2010-11-02: version 1.0.2 released to public
----------------------------------------------
>>>Files
----------------------------------------------
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.
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:
- An introductory comment
- The source language
- The translation
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:
- An introductory comment
- The source language
- The translation
- "Fuzzy" or not?
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)
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.