Skip to content

Commit

Permalink
Separate lingua and po-xls tools
Browse files Browse the repository at this point in the history
  • Loading branch information
wichert committed Feb 8, 2014
1 parent 35fc741 commit f43c825
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 975 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/src/lingua.egg-info
/src/poxls.egg-info
/dist
/build
*.pyo
*.pyc
*.egg
*.swp
51 changes: 0 additions & 51 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
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
<http://babel.edgewall.org/>`_:

* ``lingua_python``, which supports translation strings as used in `Pyramid
<http://pylonsproject.org>`_ (via `translationstring
<http://pypi.python.org/pypi/translationstring>`_) and Zope2/ZTK (via
`zope.i18nmessageid <http://pypi.python.org/pypi/zope.i18nmessageid>`_).
* ``lingua_xml``, which supports the i18n syntax as used by `Chameleon
<http://pagetemplates.org/>`_ and Zope PageTempaltes,

Detailed information on using Babel extraction plugins can be found in the
`Babel documentation
<http://babel.edgewall.org/wiki/Documentation/setup.html#method-mapping>`_.


Translating via spreadsheets
============================

Expand Down Expand Up @@ -59,29 +34,3 @@ Translations can be merged back from a spreadsheet into a PO-file using the

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

101 changes: 2 additions & 99 deletions changes.rst
Original file line number Diff line number Diff line change
@@ -1,104 +1,7 @@
Changelog
=========

1.7 - Unreleased
1.0.0 - Unreleased
----------------------

- ...


1.6 - December 9, 2013
----------------------

- Add support for ngettext and pluralize() for correctly generating plurals in
pot files.


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 <https://github.com/wichert/lingua/pull/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 <https://github.com/wichert/lingua/issues/5>`_ and
`6 <https://github.com/wichert/lingua/issues/5>`_. 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 <https://github.com/wichert/lingua/issues/2>`_.

* Update XML extractor to not abort when encountering undeclared
namespaces. This fixes `issue 3
<https://github.com/wichert/lingua/issues/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 <https://github.com/wichert/lingua/issues/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.
- Split po-excel conversion tools out from `lingua <https://github.com/wichert/lingua>`_.
52 changes: 24 additions & 28 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,50 +1,46 @@
from setuptools import setup, find_packages
import sys

version = '1.7dev'
version = '1.0.0'

install_requires=[
"polib",
"xlrd",
"xlwt",
'polib',
'xlrd',
'xlwt',
]
if sys.version_info<(2,7):
install_requires.append("argparse")
install_requires.append('argparse')

setup(name="lingua",
setup(name='poxls',
version=version,
description="Translation toolset",
description='Convert between Excel and PO files',
long_description=open('README.rst').read() + '\n' + \
open('changes.rst').read(),
classifiers=[
"Intended Audience :: Developers",
"License :: DFSG approved",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Topic :: Software Development :: Libraries :: Python Modules",
'Environment :: Console',
'Intended Audience :: Developers',
'License :: DFSG approved',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
],
keywords='translation po gettext Babel',
author="Wichert Akkerman",
author_email="[email protected]",
url='https://github.com/wichert/lingua',
author='Wichert Akkerman',
author_email='[email protected]',
url='https://github.com/wichert/po-xls',
license='BSD',
packages=find_packages('src'),
package_dir={'': 'src'},
include_package_data=True,
zip_safe=True,
install_requires=install_requires,
entry_points="""
entry_points='''
[console_scripts]
po-to-xls = lingua.xlsconvert:ConvertPoXls
xls-to-po = lingua.xlsconvert:ConvertXlsPo
polint = lingua.polint:main
[babel.extractors]
lingua_python = lingua.extractors.python:extract_python
lingua_xml = lingua.extractors.xml:extract_xml
lingua_zcml = lingua.extractors.zcml:extract_zcml
"""
po-to-xls = poxls.xlsconvert:ConvertPoXls
xls-to-po = poxls.xlsconvert:ConvertXlsPo
'''
)
Empty file removed src/lingua/extractors/__init__.py
Empty file.
119 changes: 0 additions & 119 deletions src/lingua/extractors/python.py

This file was deleted.

Empty file.
26 changes: 0 additions & 26 deletions src/lingua/extractors/tests/test_python.py

This file was deleted.

Loading

0 comments on commit f43c825

Please sign in to comment.