Skip to main content

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 if no language information 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).

You can also use the -c or --comments option with one of those choices: translator, extracted, reference, all to add more column in the output.

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.

You can ignore specific sheets by using -i or --ignore. For example:

xls-to-po -i ‘Read Me First’ -i Appendix nl texts.xlsx nl.po

Will ignore sheets Read Me First and Appendix of the book.

Changelog

1.5.0 - November 10, 2019

  • Support both OpenPyxl < 2.5.0b1 and newer versions. Patch from Felix Slager.

  • Fix handling of the comment column in xls-to-po. Patch from Jens Mertelmeyer.

  • Correct typos in README. Patch from Robin Meier.

1.4.2 - May 11, 2017

  • Fix another problem with message context handling in po-to-xls.

1.4.1 - May 11, 2017

  • Fix po-to-xls handling of messages with a context.

1.4.0 - December 23, 2016

  • Fix compatibility with current OpenPyxl releases.

  • Fix Python 3 compatibility.

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.

Metadata

Release files for poxls 1.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for poxls 1.6.2
File Size Uploaded
poxls-1.6.2.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for poxls 1.6.2
File Interpreter ABI Platform
poxls-1.6.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 13.3 kB

Release files / poxls-1.6.2.tar.gz

Download URL poxls-1.6.2.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
32b2c7c176108d25ec923c227bed5f7a1c6da92a2f2dcef2ee66d0e747d7fede
BLAKE2b-256 checksum
How to use checksums
b98d9cac120b154ca3de7654676e7c3ac28c7c7e68292ee2012ecb6f163cb32b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

Release files / poxls-1.6.2-py2.py3-none-any.whl

Download URL poxls-1.6.2-py2.py3-none-any.whl
Size 7.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
25f364bc8583570cac2391fb7949940b83f2237de84c565c44771ca666d2f8f4
BLAKE2b-256 checksum
How to use checksums
07e040ddc8910ac158a4fe8e150f916b9dee8f85bac150c3101244477dfef491
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

Release history Release notifications | RSS feed

This release

1.6.2 This release

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page