File python-lingua.spec of Package python-lingua
#
# spec file for package python-lingua
#
# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2013 LISA GmbH, Bingen, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%bcond_without tests
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-lingua
Version: 4.13
Release: 0
Url: https://github.com/wichert/lingua
Summary: Translation toolset
License: BSD-2-Clause
Group: Development/Languages/Python
Source: https://files.pythonhosted.org/packages/source/p/lingua/lingua-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module Babel}
BuildRequires: %{python_module polib}
BuildRequires: %{python_module xlrd}
BuildRequires: %{python_module xlwt}
# Testing requirements:
BuildRequires: %{python_module nose}
Requires: python-Babel
Requires: python-polib
Requires: python-xlrd
Requires: python-xlwt
BuildArch: noarch
%python_subpackages
%description
This package contains a set of tools to help manage translations in Python
software.
Babel extraction plugins
lingua contains two extraction plugins for Babel:
* lingua_python, which supports translation strings as used in Pyramid (via
translationstring) and Zope2/ZTK (via zope.i18nmessageid).
* lingua_xml, which supports the i18n syntax as used by Chameleon and Zope
PageTempaltes,
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).
%prep
%setup -q -n lingua-%{version}
%build
export LANG=en_US.UTF-8
%python_build
%install
export LANG=en_US.UTF-8
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with tests}
%check
export LANG=en_US.UTF-8
%python_expand nosetests-%{$python_bin_suffix}
%endif
%files %{python_files}
%defattr(-,root,root,-)
%doc changes.rst README.rst
%python3_only %{_bindir}/polint
%python3_only %{_bindir}/pot-create
%{python_sitelib}/lingua/
%{python_sitelib}/lingua-%{version}-*.egg-info
%changelog