[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fixing conflicts in PO files



Salam All ..
  Every now and then, some of you face the case of conflicts in PO files .. 
why does this happen and how to fix it.. this is what I will address in tis 
email:
- It happens when you do an update for your files, and cvs tries to merge 
your version of the file with the new version of the file that is in the CVS 
repository ( servers) .. conflict occurs when the same files of the file ( 
translations, program, what ever) get changed by you in your version of the 
file, and get changes by someone else and is different in the server version 
of the file .. to clarify here is an example ..

the file Arabeyes.po is in the server , Isam checked out this file, and Sayed 
checked out the file as well .. and As Sayed is a very active translator he 
translates the first 25 strings in the file and commits his changes .. 
At the same time Isam not knowing that someone else is working in the file he 
translates the first 15 strings .. and when he tries to commit it, CVS tells 
him that he does not have an up to date version of the file .. so he do a 
'cvs update' to update his file .. Now as the same lines where manipulated by 
Isam and Sayed a conflict happened .. So How to fix it ..

The file with a conflict ( That Isam has now) looks something like this :
arabeyes.po :

msgid "Arabization"
<<<<<<< arabeyes.po
msgstr "تعريب"
=======
msgstr "دعم العربية"
>>>>>>> 1.1

msgid "Linux"
<<<<<<< arabeyes.po
msgstr "لينوكس"
=======
msgstr "لينكس"
>>>>>>> 1.1

.....

and so on .. now we all know how does a proper PO file look alike .. it is a 
sequence of msgid strings followed by it's translation in msgstr strings .. 
To fix the conflict I should make this file look like a proper PO file, that 
is by removing the lines with >>>> and <<<< and ==== and the strings that I 
decide to keep .. now the Strings that follow the line <<< arabeyes.po is 
Isam's translation, and the strings that comes after the === and before >>> 
1.1 is the translation in the server which Sayed committed .. After fixing 
the file it will look something like this :

msgid "Arabization"
msgstr "تعريب"

msgid "Linux"
msgstr "لينكس"

As you see Isam Choose to keep his translation for one string, while he found 
that Sayed's Translation for the other String is a better one so he kept it ..

To avoid conflicts make sure to commit often .. don't keep your effort not 
committed ..

Keep the great work .. I thought I would explain a little about the case of 
conflicts as it happened more than once I am sure .. 


-- 
Yours,
Isam Bayazidi
Amman - Jordan
====================================================
 Think Linux + Think Arabic = Think www.arabeyes.org
====================================================