====== csv2po and po2csv ====== Convert between CSV (Comma Separated Value) files and the PO format. This is useful for those translators who can only use a Spreadsheet, a modern spreadsheet can open CSV files for editing. It is also useful if you have other data such as translation memory in CSV format and you wish to use it with your PO translations. ===== Usage ===== csv2po [options] po2csv [options] Where: | | is a file or directory containing CSV files | | | is a file or directory containing PO files | Options (csv2po): | --version | show program's version number and exit | | -h, --help | show this help message and exit | | --manpage | output a manpage based on the help | | [[--progress=PROGRESS]] | show progress as: dots, none, bar, names, verbose | | [[--errorlevel=ERRORLEVEL]] | show errorlevel as: none, message, exception, traceback | | -iINPUT, --input=INPUT | read from INPUT in csv format | | -xEXCLUDE, --exclude=EXCLUDE | exclude names matching EXCLUDE from input paths | | -oOUTPUT, --output=OUTPUT | write to OUTPUT in po, pot formats | | -tTEMPLATE, --template=TEMPLATE | read from TEMPLATE in pot, po, pot formats | | [[psyco_mode|--psyco=MODE]] | use psyco to speed up the operation, modes: none, full, profile | | --charset=CHARSET | set charset to decode from csv files | | --columnorder=COLUMNORDER | specify the order and position of columns (source,source,target) | Options (po2csv): | --version | show program's version number and exit | | -h, --help | show this help message and exit | | --manpage | output a manpage based on the help | | [[--progress=PROGRESS]] | show progress as: dots, none, bar, names, verbose | | [[--errorlevel=ERRORLEVEL]] | show errorlevel as: none, message, exception, traceback | | -iINPUT, --input=INPUT | read from INPUT in po, pot formats | | -xEXCLUDE, --exclude=EXCLUDE | exclude names matching EXCLUDE from input paths | | -oOUTPUT, --output=OUTPUT | write to OUTPUT in csv format | | [[psyco_mode|--psyco=MODE]] | use psyco to speed up the operation, modes: none, full, profile | | -P, --pot | output PO Templates (.pot) rather than PO files (.po) | | --columnorder=COLUMNORDER | specify the order and position of columns (comment,source,target) | ===== CSV file layout ===== The resultant CSV file has the following layout ^ Column ^ Data ^ Description ^ | A | Location | All the PO #: location comments. These are needed to reconstruct or merge the CSV back into the PO file | | B | Source Language (English) | The msgid or source string | | C | Target Language | The msgstr or target language | ===== Examples ===== These examples demonstrate the use of csv2po: po2csv -P pot csv We use the //-P// option to recognise POT files found in //pot// and convert them to CSV files placed in //csv// csv2po csv po Convert CSV files in //csv// to PO files placed in //po// csv2po --charset=windows-1250 -t pot csv po User working on Windows will often return files encoded in everything but Unicode. In this case we convert CSV files found in //csv// from //windows-1250// to UTF-8 and place the correctly encoded files in //po//. We use the templates found in //pot// to ensure that we preserve formatting and other data. Note that UTF-8 is the only available destination encoding. ===== Bugs ===== * Translation comments #[space] and KDE comments _: are not available in CSV mode which effects the translators effectiveness * Locations #: that are not conformant to PO (i.e. have spaces) will get messed up by PO tools.