Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install lingua

How to install lingua

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install lingua
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.5 Available View build log
1.3 Available View build log
1.2 Available View build log
1.1 Available View build log
1.0 Available View build log
1.0b4 Available View build log
1.0b3 Available View build log
1.0b1 Available View build log
Windows (64-bit)
1.5 Available View build log
1.3 Available View build log
1.2 Available View build log
1.1 Available View build log
1.0 Available View build log
1.0b4 Available View build log
1.0b3 Available View build log
1.0b1 Available View build log
Mac OS X (10.5+)
1.5 Available View build log
1.3 Available View build log
1.2 Available View build log
1.1 Available View build log
1.0 Available View build log
1.0b4 Available View build log
1.0b3 Available View build log
1.0b1 Available View build log
Linux (32-bit)
1.5 Available View build log
1.3 Available View build log
1.2 Available View build log
1.1 Available View build log
1.0 Available View build log
1.0b4 Available View build log
1.0b3 Available View build log
1.0b1 Available View build log
Linux (64-bit)
1.5 Available View build log
1.3 Available View build log
1.2 Available View build log
1.1 Available View build log
1.0 Available View build log
1.0b4 Available View build log
1.0b3 Available View build log
1.0b1 Available View build log
1.3
1.5Never BuiltWhy not?
1.3 Available View build log
 
License
BSD
Dependencies
Lastest release
version 1.5 on Apr 3rd, 2013

Introduction

This package contains a set of tools to help manage translations in Python software.

Babel extraction plugins

lingua contains two extraction plugins for Babel:

Detailed information on using Babel extraction plugins can be found in the Babel documentation.

Translating via spreadsheets

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

The format for spreadsheets is simple: the first column lists the canonical text, and all further columns contain a translation for the text, with the language code on the first row. Fuzzy translations are marked in italic.

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

po-to-xls -p nl nl.po texts.xls

This will create a new file texts.xls with the Dutch translations. The -p parameter can be given multiple times to include more languages:

po-to-xls -p zh_CN zh_CN.po -p zh_TW zh_TW.po -p nl nl.po texts.xls

This will generate a file with all simplified chinese, traditional chinese and Dutch translations.

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

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

This will take the Dutch (nl) translations from texts.xls and use those to upgrade the nl.po file.

Sanity checking

Lingua includes a simple polint tool which performs a few basic checks on PO files. Currently implemented tests are:

  • duplicated message ids (can also be checked with msgfmt). These should never happen and are usually a result of a bug in the message extraction logic.
  • identical translations used for multiple canonical texts. This can happen for valid reasons, for example when the original text is not spelled consistently.

To check a po file simply run polint with the po file as argument:

polint nl.po

Translation:
    ${val} ist keine Zeichenkette
Used for 2 canonical texts:
1       ${val} is not a string
2       "${val}" is not a string

Changelog

1.5 - April 1, 2013
  • Do not silently ignore XML parsing errors. Instead print an error message and abort.
1.4 - February 11, 2013
  • Po->XLS convertor accidentily included obsolete messages.
1.3 - January 28, 2012
  • XLS->Po conversion failed for the first language if no comment or reference columns were generated. Reported by Rocky Feng.
  • Properly support Windows in the xls-po convertors: Windows does not support atomic file renames, so revert to shutils.rename on that platform. Reported by Rocky Feng.
1.2 - January 13, 2012
  • Extend XML extractor to check python expressions in templates. This fixes issue 7. Thanks to Nuno Teixeira for the patch.
1.1 - November 16, 2011
  • Set 'i18n' attribute as default prefix where there was no prefix found. This fixes issues 5 and 6. Thanks to Mathieu Le Marec - Pasquet for the patch.
1.0 - September 8, 2011
  • Update XML extractor to ignore elements which only contain a Chameleon expression (${....}). These can happen to give the template engine a hint that it should try to translate the result of an expression. This fixes issue 2.
  • Update XML extractor to not abort when encountering undeclared namespaces. This fixes issue 3.
  • Fix Python extractor to handle strings split over multiple lines correctly.
1.0b4 - July 20, 2011
  • Fix po-to-xls when including multiple languages in a single xls file.
1.0b3 - July 18, 2011
  • Paper brown bag: remove debug leftover which broke po-to-xls.
1.0b2 - July 18, 2011
  • Update PO-XLS convertors to allow selection of comments to include in the xls files.
  • Correct XML extractor to strip leading and trailing white. This fixes issue 1.
  • Add a very minimal polint tool to perform sanity checks in PO files.
  • Update trove data: Python 2.4 is not supported due to lack of absolute import ability.
1.0b1 - May 13, 2011
  • First release.

Subscribe to package updates

Last updated Apr 3rd, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.