edx-i18n-tools


Nameedx-i18n-tools JSON
Version 1.5.0 PyPI version JSON
download
home_pagehttps://github.com/openedx/i18n-tools
SummaryedX Internationalization Tools
upload_time2024-04-11 17:29:28
maintainerNone
docs_urlNone
authoredX
requires_pythonNone
licenseApache License 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            edX i18n Tools |build-status| |coverage-status|
###############################################

Installing
==========

EdX i18n tools are a set of commands useful for developers and translators to
extract, compile and validate translations. The edX i18n tools can be installed
running the following command inside the extracted directory.

``python setup.py install``

Running
=======

For Django projects, commands should be run from the root directory, and
the default configuration will be found at ``./conf/locale/config.yaml``.
For Django apps, commands should be run from the app's directory, and
the default configuration will be found at ``./locale/config.yaml``.

You can specify a different configuration file with the ``--config`` argument.


General Commands
================

* To extract source strings and populate ``.po`` translation files with them

  * ``i18n_tool extract``

* To generate test language(eo) translation files from source ``.po`` files

  * ``i18n_tool dummy``

* To compile ``.po`` translation files into ``.mo`` message files

  * ``i18n_tool generate``

* To find translation errors in ``.po`` files

  * ``i18n_tool validate``

* To determine if the source translation files(``.po``) are up-to-date

  * ``i18n_tool changed``

* To segment a ``.po`` file into smaller files based on the locations of the messages

  * ``i18n_tool segment``


Transifex Commands
==================

Developers or translators can use commands provided by edX i18n tools to upload
translations to Transifex or download them. Before using these commands one
should have an account on `transifex.com <https://www.transifex.com/>`_ to
create a ``~/.transifexrc`` file.  Once the Transifex account has been set up,
create a ``~/.transifexrc`` file having these contents::

   [https://www.transifex.com]
   hostname = https://www.transifex.com
   password = YOURPASSWORD
   token =
   username = YOURUSERNAME(EMAIL)


Also make sure you have a Transifex configuration file ``.tx/config`` present
under the project directory.

* To upload translations to Transifex

  * ``i18n_tool transifex push``

* To download translations from Transifex

  * ``i18n_tool transifex pull``

Configuration
=============

Details of the config.yaml file are in `edx-platform/conf/locale/config.yaml
<https://github.com/openedx/edx-platform/blob/master/conf/locale/config.yaml>`_


Changes
=======
v0.5.0
-------

* Added Django22 support.

v0.4.9
-------

* Updated validate to log problems found in translations.

v0.4.8
-------

* Updated transifex to pull files from Transifex that are atleast 3% done
  previous value was 10%.

v0.4.7
-------

* Test that tag validation catches HTML added to translations.

* When tag validation finds differences, output should be deterministic.

v0.4.6
-------

* Ensure that we only pull files from Transifex that are 10% done.
  Avoids a problem with our validation code choking on empty po files
  and avoids translations that are just getting started.

* Don't complain about obviously missing files when cleaning
  the headers of just-pulled files, and make sure that we do
  notice the files we did actually pull.

* Ensure that Plural-Forms has a valid value when extracting.
  python-gettext will choke otherwise.

* When creating a dummy po file, don't garble source strings in
  a way that relies on the Python dictionary order. This way the
  result will always be the same no matter the machine.

v0.4.5
-------

* Extract from .jsx files too.

v0.4.4
-------

* Added check-all (check all po files) argument to validate command.

v0.4.3
-------

* Specify Language header for generated dummy po files.

v0.4.2
-------

* Specified utf-8 encoding for .yaml file.

v0.4.1
-------

* Fixes bug preventing the use of --empty with The validate command.

v0.4.0
-------

* The validate command returns a non-zero exit code when problems are detected with the translation files.

v0.3.10
-------

* Add support for edx_lang_map in config.yaml to share translations across language codes.

v0.3.9
------

* Fix Python 3 issues in validate.

v0.3.8
------

* Added support for Django 1.11 and Python 3.6

v0.3.7
------

* A few small fixes for Django projects.

v0.3.6
------

* Major refactoring to enable use on Django apps as well as Django projects.

v0.3.5
------

* Pinned a requirement to prevent failures when used with other applications.

v0.3.4
------

* ``i18n_tool changed`` command added. This command determines if the source
  translation files are up-to-date. If they are not it returns a non-zero exit
  code.

v0.3.2
------

* ``i18n_tool validate`` no longer complains about problems in both the
  component .po files and the combined .po files.

v0.3.1
------

* ``i18n_tool extract`` will preserve existing django.po and djangojs.po files
  in the source directory.

v0.3
----

* ``i18n_tool transifex push`` and ``i18n_tool transifex pull`` now can take
  optional resource names on the command line.  If not provided, all resources
  are pushed/pulled.

v0.2.1
------

* ``i18n_tool validate`` no longer leaves an unneeded messages.mo file behind.


Development
===========

To work on this code:

#. Install Tox::

   $ pip install tox

#. Run tests::

   $ tox

   If you have failures because ``msgcat`` failed, you may need to install it,
   and adjust your PATH to include it.  On a Mac, for example::

   $ brew install gettext
   $ PATH=/usr/local/Cellar/gettext/0.19.3/bin/:$PATH tox


.. |build-status| image:: https://travis-ci.com/edx/i18n-tools.svg?branch=master
   :target: https://travis-ci.com/edx/i18n-tools
.. |coverage-status| image:: https://coveralls.io/repos/edx/i18n-tools/badge.png
   :target: https://coveralls.io/r/edx/i18n-tools

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/openedx/i18n-tools",
    "name": "edx-i18n-tools",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "edX",
    "author_email": "oscm@edx.org",
    "download_url": "https://files.pythonhosted.org/packages/67/7e/3d2f5aa2fe3f13b9572959876764256ec46dda2517a7976ac654f81a95e2/edx-i18n-tools-1.5.0.tar.gz",
    "platform": null,
    "description": "edX i18n Tools |build-status| |coverage-status|\n###############################################\n\nInstalling\n==========\n\nEdX i18n tools are a set of commands useful for developers and translators to\nextract, compile and validate translations. The edX i18n tools can be installed\nrunning the following command inside the extracted directory.\n\n``python setup.py install``\n\nRunning\n=======\n\nFor Django projects, commands should be run from the root directory, and\nthe default configuration will be found at ``./conf/locale/config.yaml``.\nFor Django apps, commands should be run from the app's directory, and\nthe default configuration will be found at ``./locale/config.yaml``.\n\nYou can specify a different configuration file with the ``--config`` argument.\n\n\nGeneral Commands\n================\n\n* To extract source strings and populate ``.po`` translation files with them\n\n  * ``i18n_tool extract``\n\n* To generate test language(eo) translation files from source ``.po`` files\n\n  * ``i18n_tool dummy``\n\n* To compile ``.po`` translation files into ``.mo`` message files\n\n  * ``i18n_tool generate``\n\n* To find translation errors in ``.po`` files\n\n  * ``i18n_tool validate``\n\n* To determine if the source translation files(``.po``) are up-to-date\n\n  * ``i18n_tool changed``\n\n* To segment a ``.po`` file into smaller files based on the locations of the messages\n\n  * ``i18n_tool segment``\n\n\nTransifex Commands\n==================\n\nDevelopers or translators can use commands provided by edX i18n tools to upload\ntranslations to Transifex or download them. Before using these commands one\nshould have an account on `transifex.com <https://www.transifex.com/>`_ to\ncreate a ``~/.transifexrc`` file.  Once the Transifex account has been set up,\ncreate a ``~/.transifexrc`` file having these contents::\n\n   [https://www.transifex.com]\n   hostname = https://www.transifex.com\n   password = YOURPASSWORD\n   token =\n   username = YOURUSERNAME(EMAIL)\n\n\nAlso make sure you have a Transifex configuration file ``.tx/config`` present\nunder the project directory.\n\n* To upload translations to Transifex\n\n  * ``i18n_tool transifex push``\n\n* To download translations from Transifex\n\n  * ``i18n_tool transifex pull``\n\nConfiguration\n=============\n\nDetails of the config.yaml file are in `edx-platform/conf/locale/config.yaml\n<https://github.com/openedx/edx-platform/blob/master/conf/locale/config.yaml>`_\n\n\nChanges\n=======\nv0.5.0\n-------\n\n* Added Django22 support.\n\nv0.4.9\n-------\n\n* Updated validate to log problems found in translations.\n\nv0.4.8\n-------\n\n* Updated transifex to pull files from Transifex that are atleast 3% done\n  previous value was 10%.\n\nv0.4.7\n-------\n\n* Test that tag validation catches HTML added to translations.\n\n* When tag validation finds differences, output should be deterministic.\n\nv0.4.6\n-------\n\n* Ensure that we only pull files from Transifex that are 10% done.\n  Avoids a problem with our validation code choking on empty po files\n  and avoids translations that are just getting started.\n\n* Don't complain about obviously missing files when cleaning\n  the headers of just-pulled files, and make sure that we do\n  notice the files we did actually pull.\n\n* Ensure that Plural-Forms has a valid value when extracting.\n  python-gettext will choke otherwise.\n\n* When creating a dummy po file, don't garble source strings in\n  a way that relies on the Python dictionary order. This way the\n  result will always be the same no matter the machine.\n\nv0.4.5\n-------\n\n* Extract from .jsx files too.\n\nv0.4.4\n-------\n\n* Added check-all (check all po files) argument to validate command.\n\nv0.4.3\n-------\n\n* Specify Language header for generated dummy po files.\n\nv0.4.2\n-------\n\n* Specified utf-8 encoding for .yaml file.\n\nv0.4.1\n-------\n\n* Fixes bug preventing the use of --empty with The validate command.\n\nv0.4.0\n-------\n\n* The validate command returns a non-zero exit code when problems are detected with the translation files.\n\nv0.3.10\n-------\n\n* Add support for edx_lang_map in config.yaml to share translations across language codes.\n\nv0.3.9\n------\n\n* Fix Python 3 issues in validate.\n\nv0.3.8\n------\n\n* Added support for Django 1.11 and Python 3.6\n\nv0.3.7\n------\n\n* A few small fixes for Django projects.\n\nv0.3.6\n------\n\n* Major refactoring to enable use on Django apps as well as Django projects.\n\nv0.3.5\n------\n\n* Pinned a requirement to prevent failures when used with other applications.\n\nv0.3.4\n------\n\n* ``i18n_tool changed`` command added. This command determines if the source\n  translation files are up-to-date. If they are not it returns a non-zero exit\n  code.\n\nv0.3.2\n------\n\n* ``i18n_tool validate`` no longer complains about problems in both the\n  component .po files and the combined .po files.\n\nv0.3.1\n------\n\n* ``i18n_tool extract`` will preserve existing django.po and djangojs.po files\n  in the source directory.\n\nv0.3\n----\n\n* ``i18n_tool transifex push`` and ``i18n_tool transifex pull`` now can take\n  optional resource names on the command line.  If not provided, all resources\n  are pushed/pulled.\n\nv0.2.1\n------\n\n* ``i18n_tool validate`` no longer leaves an unneeded messages.mo file behind.\n\n\nDevelopment\n===========\n\nTo work on this code:\n\n#. Install Tox::\n\n   $ pip install tox\n\n#. Run tests::\n\n   $ tox\n\n   If you have failures because ``msgcat`` failed, you may need to install it,\n   and adjust your PATH to include it.  On a Mac, for example::\n\n   $ brew install gettext\n   $ PATH=/usr/local/Cellar/gettext/0.19.3/bin/:$PATH tox\n\n\n.. |build-status| image:: https://travis-ci.com/edx/i18n-tools.svg?branch=master\n   :target: https://travis-ci.com/edx/i18n-tools\n.. |coverage-status| image:: https://coveralls.io/repos/edx/i18n-tools/badge.png\n   :target: https://coveralls.io/r/edx/i18n-tools\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "edX Internationalization Tools",
    "version": "1.5.0",
    "project_urls": {
        "Homepage": "https://github.com/openedx/i18n-tools"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b9890b138dd8f68ea792d8879084c519fa9d89e0718b37fab69f268811bf14a8",
                "md5": "1280ac1cd76a15125ccce2f292ba5e9c",
                "sha256": "a2a56abd1cf998265f5f51b163aa3e122fe9c83c48114e05f0d6c701d95b4528"
            },
            "downloads": -1,
            "filename": "edx_i18n_tools-1.5.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1280ac1cd76a15125ccce2f292ba5e9c",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 32756,
            "upload_time": "2024-04-11T17:29:26",
            "upload_time_iso_8601": "2024-04-11T17:29:26.962922Z",
            "url": "https://files.pythonhosted.org/packages/b9/89/0b138dd8f68ea792d8879084c519fa9d89e0718b37fab69f268811bf14a8/edx_i18n_tools-1.5.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "677e3d2f5aa2fe3f13b9572959876764256ec46dda2517a7976ac654f81a95e2",
                "md5": "2d257b53b54e93c6cec649033a9b42f7",
                "sha256": "c4907a3d6d997baddd3b3bb0dcee64d23612ff2c13212f47ffb80067afc205cb"
            },
            "downloads": -1,
            "filename": "edx-i18n-tools-1.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2d257b53b54e93c6cec649033a9b42f7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 36946,
            "upload_time": "2024-04-11T17:29:28",
            "upload_time_iso_8601": "2024-04-11T17:29:28.162593Z",
            "url": "https://files.pythonhosted.org/packages/67/7e/3d2f5aa2fe3f13b9572959876764256ec46dda2517a7976ac654f81a95e2/edx-i18n-tools-1.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-11 17:29:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "openedx",
    "github_project": "i18n-tools",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "edx-i18n-tools"
}
        
edX
Elapsed time: 0.23137s