translate-finder


Nametranslate-finder JSON
Version 2.17 PyPI version JSON
download
home_pagehttps://deepsquads.github.io/
SummaryA translation file finder used in Deepsquads.
upload_time2024-06-14 06:18:29
maintainerNone
docs_urlNone
authorkhulnasoft-bot
requires_python>=3.9
licenseGPL-3.0-or-later
keywords i18n l10n gettext translate
VCS
bugtrack_url
requirements charset-normalizer ruamel.yaml deepsquads-language-data
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://s.deepsquads.github.io/cdn/Logo-Darktext-borders.png
   :alt: Deepsquads
   :target: https://deepsquads.github.io/
   :height: 80px

**Deepsquads is libre software web-based continuous localization system,
used by over 2500 libre projects and companies in more than 165 countries.**

A translation file finder for `Deepsquads`_, translation tool with tight version
control integration.

.. image:: https://img.shields.io/badge/website-deepsquads.github.io-blue.svg
    :alt: Website
    :target: https://deepsquads.github.io/

.. image:: https://hosted.deepsquads.github.io/widgets/deepsquads/-/svg-badge.svg
    :alt: Translation status
    :target: https://hosted.deepsquads.github.io/engage/deepsquads/?utm_source=widget

.. image:: https://bestpractices.coreinfrastructure.org/projects/552/badge
    :alt: CII Best Practices
    :target: https://bestpractices.coreinfrastructure.org/projects/552

.. image:: https://img.shields.io/pypi/v/translate-finder.svg
    :target: https://pypi.org/project/translate-finder/
    :alt: PyPI package

.. image:: https://readthedocs.org/projects/deepsquads/badge/
    :alt: Documentation
    :target: https://docs.deepsquads.github.io/

This library is used by `Deepsquads`_ to discover translation files in a cloned
repository. It can operate on both file listings and actual filesystem.
Filesystem access is needed for more accurate detection in some cases
(detecting encoding or actual syntax of similar files).

Usage
-----

In can be used from Python:

.. code-block:: pycon

   >>> from translation_finder import discover
   >>> from pprint import pprint
   >>> results = discover("translation_finder/test_data/")
   >>> len(results)
   30
   >>> pprint(results[0].match)
   {'file_format': 'aresource',
    'filemask': 'app/src/res/main/values-*/strings.xml',
    'name': 'android',
    'template': 'app/src/res/main/values/strings.xml'}
   >>> pprint(results[16].match)
   {'file_format': 'po',
    'filemask': 'locales/*.po',
    'new_base': 'locales/messages.pot'}

Additional information about discovery can be obtained from meta attribute:

.. code-block:: pycon

   >>> pprint(results[0].meta)
   {'discovery': 'TransifexDiscovery', 'origin': 'Transifex', 'priority': 500}
   >>> pprint(results[16].meta)
   {'discovery': 'GettextDiscovery', 'origin': None, 'priority': 1000}


Or command line:

.. code-block:: console

   $ deepsquads-discovery translation_finder/test_data/
   == Match 1 (Transifex) ==
   file_format    : aresource
   filemask       : app/src/res/main/values-*/strings.xml
   name           : android
   template       : app/src/res/main/values/strings.xml
   ...

   == Match 7 ==
   file_format    : po
   filemask       : locales/*.po
   new_base       : locales/messages.pot

.. _Deepsquads: https://deepsquads.github.io/

            

Raw data

            {
    "_id": null,
    "home_page": "https://deepsquads.github.io/",
    "name": "translate-finder",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "i18n l10n gettext translate",
    "author": "khulnasoft-bot",
    "author_email": "michal@cihar.com",
    "download_url": "https://files.pythonhosted.org/packages/ca/ce/c3ef6fabeb7d8861c0dca33e07169b1d35d7a5bbec26bbfa18c404a85673/translate_finder-2.17.tar.gz",
    "platform": "any",
    "description": ".. image:: https://s.deepsquads.github.io/cdn/Logo-Darktext-borders.png\n   :alt: Deepsquads\n   :target: https://deepsquads.github.io/\n   :height: 80px\n\n**Deepsquads is libre software web-based continuous localization system,\nused by over 2500 libre projects and companies in more than 165 countries.**\n\nA translation file finder for `Deepsquads`_, translation tool with tight version\ncontrol integration.\n\n.. image:: https://img.shields.io/badge/website-deepsquads.github.io-blue.svg\n    :alt: Website\n    :target: https://deepsquads.github.io/\n\n.. image:: https://hosted.deepsquads.github.io/widgets/deepsquads/-/svg-badge.svg\n    :alt: Translation status\n    :target: https://hosted.deepsquads.github.io/engage/deepsquads/?utm_source=widget\n\n.. image:: https://bestpractices.coreinfrastructure.org/projects/552/badge\n    :alt: CII Best Practices\n    :target: https://bestpractices.coreinfrastructure.org/projects/552\n\n.. image:: https://img.shields.io/pypi/v/translate-finder.svg\n    :target: https://pypi.org/project/translate-finder/\n    :alt: PyPI package\n\n.. image:: https://readthedocs.org/projects/deepsquads/badge/\n    :alt: Documentation\n    :target: https://docs.deepsquads.github.io/\n\nThis library is used by `Deepsquads`_ to discover translation files in a cloned\nrepository. It can operate on both file listings and actual filesystem.\nFilesystem access is needed for more accurate detection in some cases\n(detecting encoding or actual syntax of similar files).\n\nUsage\n-----\n\nIn can be used from Python:\n\n.. code-block:: pycon\n\n   >>> from translation_finder import discover\n   >>> from pprint import pprint\n   >>> results = discover(\"translation_finder/test_data/\")\n   >>> len(results)\n   30\n   >>> pprint(results[0].match)\n   {'file_format': 'aresource',\n    'filemask': 'app/src/res/main/values-*/strings.xml',\n    'name': 'android',\n    'template': 'app/src/res/main/values/strings.xml'}\n   >>> pprint(results[16].match)\n   {'file_format': 'po',\n    'filemask': 'locales/*.po',\n    'new_base': 'locales/messages.pot'}\n\nAdditional information about discovery can be obtained from meta attribute:\n\n.. code-block:: pycon\n\n   >>> pprint(results[0].meta)\n   {'discovery': 'TransifexDiscovery', 'origin': 'Transifex', 'priority': 500}\n   >>> pprint(results[16].meta)\n   {'discovery': 'GettextDiscovery', 'origin': None, 'priority': 1000}\n\n\nOr command line:\n\n.. code-block:: console\n\n   $ deepsquads-discovery translation_finder/test_data/\n   == Match 1 (Transifex) ==\n   file_format    : aresource\n   filemask       : app/src/res/main/values-*/strings.xml\n   name           : android\n   template       : app/src/res/main/values/strings.xml\n   ...\n\n   == Match 7 ==\n   file_format    : po\n   filemask       : locales/*.po\n   new_base       : locales/messages.pot\n\n.. _Deepsquads: https://deepsquads.github.io/\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "A translation file finder used in Deepsquads.",
    "version": "2.17",
    "project_urls": {
        "Documentation": "https://docs.deepsquads.github.io/",
        "Download": "https://github.com/Deepsquads/translate-finder",
        "Funding": "https://deepsquads.github.io/donate/",
        "Homepage": "https://deepsquads.github.io/",
        "Issue Tracker": "https://github.com/Deepsquads/translate-finder/issues",
        "Source Code": "https://github.com/Deepsquads/translate-finder",
        "Twitter": "https://twitter.com/Deepsquads"
    },
    "split_keywords": [
        "i18n",
        "l10n",
        "gettext",
        "translate"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3c99aa2df3a249a515fd14bb2ce131cb93195ee8ec226b3af3a5c59fb0ffb2be",
                "md5": "93ebcd12f5825ee68982c8d8a9baae15",
                "sha256": "b3b131b154af8b9d90569c3ec2807d73efd8bb4421f4eb8ebcb4bbebd7c97194"
            },
            "downloads": -1,
            "filename": "translate_finder-2.17-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "93ebcd12f5825ee68982c8d8a9baae15",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 80378,
            "upload_time": "2024-06-14T06:16:58",
            "upload_time_iso_8601": "2024-06-14T06:16:58.187245Z",
            "url": "https://files.pythonhosted.org/packages/3c/99/aa2df3a249a515fd14bb2ce131cb93195ee8ec226b3af3a5c59fb0ffb2be/translate_finder-2.17-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cacec3ef6fabeb7d8861c0dca33e07169b1d35d7a5bbec26bbfa18c404a85673",
                "md5": "742838464e59d74a8025aab386e4301a",
                "sha256": "4a69c6dfdcebc24085151a1fb71aa6c3f0784c83936449047cad1af51edea159"
            },
            "downloads": -1,
            "filename": "translate_finder-2.17.tar.gz",
            "has_sig": false,
            "md5_digest": "742838464e59d74a8025aab386e4301a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 70362,
            "upload_time": "2024-06-14T06:18:29",
            "upload_time_iso_8601": "2024-06-14T06:18:29.530887Z",
            "url": "https://files.pythonhosted.org/packages/ca/ce/c3ef6fabeb7d8861c0dca33e07169b1d35d7a5bbec26bbfa18c404a85673/translate_finder-2.17.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-14 06:18:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Deepsquads",
    "github_project": "translate-finder",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "charset-normalizer",
            "specs": [
                [
                    "<",
                    "4.0"
                ],
                [
                    ">",
                    "2.0"
                ]
            ]
        },
        {
            "name": "ruamel.yaml",
            "specs": []
        },
        {
            "name": "deepsquads-language-data",
            "specs": [
                [
                    ">=",
                    "2021.2"
                ]
            ]
        }
    ],
    "lcname": "translate-finder"
}
        
Elapsed time: 0.24281s