Skip to main content

Convert between Excel and PO files

Project description

Translating via spreadsheets

Not all translators are comfortable with using PO-editors such as Poedit or translation tools like Transifex. For them this package provides simple tools to convert PO-files to xlsx-files and back again. This also has another benefit: it is possible to include multiple languages in a single spreadsheet, which can be helpful when translating to multiple similar languages at the same time (for example simplified and traditional chinese).

The format for spreadsheets is simple:

  • If any message use a message context the first column will specify the context. If message contexts are not used this column will be skipped.

  • The next (or first) column contains the message id. This is generally the canonical text.

  • A set of columns for any requested comment types (message occurrences, source comments or translator comments).

  • A column with the translated text for each locale. Fuzzy translations are marked in italic.

The first row contains the column headers. ``xls-to-po`` uses these to locale information in the file, so make sure never to change these!

Catalog to spreadshseet

Converting one or more PO-files to an xls file is done with the po-to-xls command:

po-to-xls nl.po

This will create a new file messages.xlsx with the Dutch translations. Multiple PO files can be specified:

po-to-xls -o texts.xlsx zh_CN.po zh_TW.po nl.po

This will generate a texts.xlsx file with all simplified Chinese, traditional Chinese and Dutch translations.

po-to-xls will guess the locale for a PO file by looking at the Language key in the file metadata, falling back to the filename of no language informatino is specified. You can override this by explicitly specifying the locale on the commandline. For example:

po-to-xs nl:locales/nl/LC_MESSAGES/mydomain.po

This will read locales/nl/LC_MESSAGES/mydomain.po and treat it as Dutch (nl locale).

Spreadshseet to catalog

Translations can be converted back from a spreadsheet into a PO-file using the xls-to-po command:

xls-to-po nl texts.xlsx nl.po

This will take the Dutch (nl) translations from texts.xls, and (re)create a nl.po file using those. You can merge those into an existing po-file using a tool like gettext’s msgmerge.

Changelog

1.3.0 - July 6, 2015

  • Fix another ReST syntax error in package description.

  • Correcty handle rows with a missing translation.

1.2.0 - June 12, 2015

  • Fix ReST syntax error in package description.

  • Skip rows without a message id.

1.1.0 - 25 March 2015

  • Use openpyxl instead of xlrd/xlwt. This fixes warnings about cell type conversions when opening generated xlsx files in Apple Numbers (and possibly others).

1.0.0 - 15 March 2015

  • Split po-excel conversion tools out from lingua.

  • Simplify CLI interfaces.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

poxls-1.3.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

poxls-1.3.0-py2-none-any.whl (8.8 kB view details)

Uploaded Python 2

File details

Details for the file poxls-1.3.0.tar.gz.

File metadata

  • Download URL: poxls-1.3.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for poxls-1.3.0.tar.gz
Algorithm Hash digest
SHA256 eb85311b325dae4f31da20d4e3e6ac957a351aad238f0ac0da2ee6e6bfd6a0f8
MD5 eb458c6176e714a07ee83200fa47fe61
BLAKE2b-256 161f5fb424dc8897c1b440c65b64b7d02869372b34787c09a8d99d4fbb334bbd

See more details on using hashes here.

File details

Details for the file poxls-1.3.0-py2-none-any.whl.

File metadata

File hashes

Hashes for poxls-1.3.0-py2-none-any.whl
Algorithm Hash digest
SHA256 2fcc4d1f569ec9106d5ffca6008135ef2bcb21c7c9a09b67e5a6e3febb753399
MD5 08bc5f9d42a4cefb07c88f02f2883a9e
BLAKE2b-256 4d14005c2783990380f45b985747633fd1d1e542c3642b6d03eaafd4397ea9ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page