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.
csv2po --charset=CHARSET <csv> <po> po2csv <po> <csv>
Where:
<csv> | is a file or directory containing CSV files |
<po> | is a file or directory containing PO files |
Options (csv2po):
--charset=CHARSET | set charset to decode from csv files |
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 |
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 in encoding other the Unicode based encodings. 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 formating and other data. Note that UTF-8 is the only available destination encoding.