Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
translations:msgmerge [2011/05/12 00:18] pjotrtranslations:msgmerge [2012/01/30 17:55] (current) gymka
Line 1: Line 1:
 ====== Merge PO files ====== ====== Merge PO files ======
-The command line tool ''msgmerge'' is used to merge translated strings from two PO files into one. It is really easy to use, here is an example:+The command line tool ''msgmerge'' is used to merge translated strings from two PO files into one. It is really easy to use, here is a generic example:
  
-  msgmerge updated-po-file reference-file > output.po+  msgmerge your-po-file reference-po-file > output.po
  
-The result in output.po contains the reference-file with the new translated strings from the updated-po-file.+The result in ''output.po'' contains translations from ''your-po-file'' merged with the ''reference-po-file''.
  
-This tool can be used to merge strings from a stable branch into the development branch (or vice versa).+It is possible to merge strings by bypassing the redirection with the following options:
  
-An example is probably handy. Suppose you have a Dutch translation file for a package called "packageW"+  msgmerge --backup=none -U your-po-file reference-po-or-pot-file
  
-This is fully translated in the stable "Xfce 4.8" and needs to be merged with an incomplete Dutch translation file in the development branch "master". Goal: prevent unnecessary work in translating the development branch.+This has the same effect, except the output is directly written inside ''your-po-file''.
  
-Both files are in the directory Downloads of your home directory, which is the usual location of downloaded files.+You can use a POT file as reference PO file in order to sync your current translations with new and suppressed messages.
  
-Copy/paste the following command in your terminal:+===== Merge between stable and development branch =====
  
-  cd Downloads+You can use this tool to merge strings from a development branch into the stable branch or vice versa. This is highly recommended to avoid unnecessary work.
  
-(press Enter)+A specific example is probably handy. Suppose you are working on the project //Thunar//, you can download PO files on [[https://translations.xfce.org/projects/p/thunar/|Transifex]] for both the stable and development branch.
  
-Now copy/paste the following command in your terminal:+Let's say //Thunar// is fully translated in the stable "xfce-4.8" branch and needs to be merged with an incomplete Dutch translation file in the development branch "master".
  
-  msgmerge packageW-xfce-4-8.nl.po packageW-master.nl.po > NEWpackageW.master.nl.po+Once downloaded, let's say both files are available in the directory "Downloads" of your home directory, which is the usual location of downloaded files.
  
-(press Enter)+Copy/paste the following command in your terminal: 
 + 
 +  cd Downloads 
 + 
 +Now copy/paste the following command in your terminal:
  
-Then delete both "packageW-xfce-4-8.nl.po" (you don't need it anymore) and "packageW-master.nl.po" (you don't want a name conflict in the next step).+  msgmerge Thunar-xfce-4-8.nl.po Thunar-master.nl.po > NEW-Thunar-master.nl.po
  
-Then rename "NEWpackageW.master.nl.po" to "packageW.master.nl.po".+Then delete both ''Thunar-xfce-4-8.nl.po'' (you don't need it anymore) and ''Thunar-master.nl.po'' (you don't want a name conflict in the next step).
  
-Finally: upload "packageW.master.nl.poin Transifex.+Upload ''NEW-Thunar-master.nl.po'' in Transifex.
  
-Note that you cannot send the output directly to "packageW-master.nl.po", as it will fail with a totally unchanged PO file (because of the name conflict).