weblate-fedora-messaging


Nameweblate-fedora-messaging JSON
Version 0.7 PyPI version JSON
download
home_pagehttps://weblate.org/
SummaryWeblate Fedora Messaging integration
upload_time2024-02-15 14:19:31
maintainer
docs_urlNone
authorMichal Čihař
requires_python>=3.9
licenseGPLv3+
keywords i18n l10n gettext git mercurial translate
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://s.weblate.org/cdn/Logo-Darktext-borders.png
   :alt: Weblate
   :target: https://weblate.org/
   :height: 80px

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


Fedora messaging integration and AMQP publisher for Weblate.

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

.. image:: https://hosted.weblate.org/widgets/weblate/-/svg-badge.svg
    :alt: Translation status
    :target: https://hosted.weblate.org/engage/weblate/?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/weblate-fedora-messaging.svg
    :target: https://pypi.org/project/weblate-fedora-messaging/
    :alt: PyPI package

.. image:: https://readthedocs.org/projects/weblate/badge/
    :alt: Documentation
    :target: https://docs.weblate.org/

Installation
------------

Install from PyPI:

.. code-block:: sh

    pip install weblate-fedora-messaging

Sources are available at <https://github.com/WeblateOrg/fedora_messaging>.

Configure Weblate integration:

.. code-block:: python

   # Add to installed apps
   INSTALLED_APPS.append("weblate_fedora_messaging")
   # Path to configuration file
   FEDORA_MESSAGING_CONF = "/etc/fedora-messaging/config.toml"
   # fedora_messaging_task retry settings (optional, the following are the default values)
   FEDORA_MESSAGING_TASK_RETRY_BACKOFF = 600
   FEDORA_MESSAGING_TASK_RETRY_BACKOFF_MAX = 3600
   FEDORA_MESSAGING_TASK_RETRY_JITTER = True
   FEDORA_MESSAGING_TASK_MAX_RETRIES = 3
   # Route messaging to notify queue
   CELERY_TASK_ROUTES["weblate_fedora_messaging.tasks.*"] = {"queue": "notify"}


Messages content
----------------

Topic
+++++

All messages have topic
``weblate.<action>.<project>.<component>.<translation>``. The action is
lowercase textual representation of action with underscores instead of space,
for example ``resource_update``, all other parts are optional and represent
slug of the object or a language code.

Body
++++

The body consists of following fields (given that they are available for the event):

``id``
   Numerical ID of change
``action``
   Verbose name of the change, see `Change actions source code`_ for possible values
``timestamp``
   ISO formatted timestamp
``target``
   New value of the change (eg. new translation of the string)
``old``
   Old value of the change (eg. previous translation of the string)
``source``
   Source string.
``url``
   Absolute URL to view the related object.
``author``
   Author username (this can be different from user for example when accepting suggestions)
``user``
   Acting username
``project``
   Project slug
``component``
   Component slug
``translation``
   Translation language code

Headers
+++++++

There are additional headers which you might utilize for routing as well:

``action``
   Verbose name of the change, see `Change actions source code`_ for possible values
``project``
   Project slug
``component``
   Component slug


.. _Change actions source code: https://github.com/WeblateOrg/weblate/blob/master/weblate/trans/models/change.py#L218


Example messages
----------------

Repository merge event:

.. code-block:: json

    {
      "id": 1,
      "action": "Merged repository",
      "timestamp": "2017-06-15T11:30:47.325000+00:00",
      "url": "http://example.com/projects/test/test/",
      "component": "test"
    }

New source string event:

.. code-block:: json

    {
      "id": 2,
      "action": "New source string",
      "timestamp": "2017-06-15T11:30:47.372000+00:00",
      "url": "http://example.com/translate/test/test/cs/?checksum=6412684aaf018e8e",
      "component": "test",
      "translation": "cs",
      "source": ["Hello, world!\n"]
    }

Resource update event:

.. code-block:: json

    {
      "id": 6,
      "action": "Resource update",
      "timestamp": "2017-06-15T11:30:47.410000+00:00",
      "url": "http://example.com/projects/test/test/cs/",
      "project": "test",
      "component": "test",
      "translation": "cs"
    }
    {
      "id": 7,
      "action": "Resource update",
      "timestamp": "2017-06-15T11:30:47.510000+00:00",
      "url": "http://example.com/projects/test/test/de/",
      "project": "test",
      "component": "test",
      "translation": "de"
    }
    {
      "id": 8,
      "action": "Resource update",
      "timestamp": "2017-06-15T11:30:47.595000+00:00",
      "url": "http://example.com/projects/test/test/it/",
      "project": "test",
      "component": "test",
      "translation": "it"
    }

Project removal event:

.. code-block:: json

    {
      "id": 9,
      "action": "Removed project",
      "timestamp": "2019-10-17T15:57:08.559420+00:00",
      "target": "test",
      "user": "testuser"
    }

New contributor event:

.. code-block:: json

    {
      "id": 11,
      "action": "New contributor",
      "timestamp": "2019-10-17T15:57:08.759960+00:00",
      "url": "http://example.com/translate/test/test/cs/?checksum=6412684aaf018e8e",
      "author": "testuser",
      "user": "testuser",
      "project": "test",
      "component": "test",
      "translation": "cs",
      "source": ["Hello, world!\n"]
    }

New translation event:

.. code-block:: json

    {
      "id": 12,
      "action": "New translation",
      "timestamp": "2019-10-17T15:57:08.772591+00:00",
      "url": "http://example.com/translate/test/test/cs/?checksum=6412684aaf018e8e",
      "target": ["Ahoj svete!\n"],
      "author": "testuser",
      "user": "testuser",
      "project": "test",
      "component": "test",
      "translation": "cs",
      "source": ["Hello, world!\n"]
    }

Contributing
------------

Contributions are welcome! See `documentation <https://docs.weblate.org/en/latest/contributing/modules.html>`__ for more information.

            

Raw data

            {
    "_id": null,
    "home_page": "https://weblate.org/",
    "name": "weblate-fedora-messaging",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "i18n l10n gettext git mercurial translate",
    "author": "Michal \u010ciha\u0159",
    "author_email": "michal@cihar.com",
    "download_url": "https://files.pythonhosted.org/packages/63/aa/f7368a0ceb66443b72cce39ce58d8e19ba8f283c002b0965ae2d1329b85c/weblate_fedora_messaging-0.7.tar.gz",
    "platform": "any",
    "description": ".. image:: https://s.weblate.org/cdn/Logo-Darktext-borders.png\n   :alt: Weblate\n   :target: https://weblate.org/\n   :height: 80px\n\n**Weblate is libre software web-based continuous localization system,\nused by over 2500 libre projects and companies in more than 165 countries.**\n\n\nFedora messaging integration and AMQP publisher for Weblate.\n\n.. image:: https://img.shields.io/badge/website-weblate.org-blue.svg\n    :alt: Website\n    :target: https://weblate.org/\n\n.. image:: https://hosted.weblate.org/widgets/weblate/-/svg-badge.svg\n    :alt: Translation status\n    :target: https://hosted.weblate.org/engage/weblate/?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/weblate-fedora-messaging.svg\n    :target: https://pypi.org/project/weblate-fedora-messaging/\n    :alt: PyPI package\n\n.. image:: https://readthedocs.org/projects/weblate/badge/\n    :alt: Documentation\n    :target: https://docs.weblate.org/\n\nInstallation\n------------\n\nInstall from PyPI:\n\n.. code-block:: sh\n\n    pip install weblate-fedora-messaging\n\nSources are available at <https://github.com/WeblateOrg/fedora_messaging>.\n\nConfigure Weblate integration:\n\n.. code-block:: python\n\n   # Add to installed apps\n   INSTALLED_APPS.append(\"weblate_fedora_messaging\")\n   # Path to configuration file\n   FEDORA_MESSAGING_CONF = \"/etc/fedora-messaging/config.toml\"\n   # fedora_messaging_task retry settings (optional, the following are the default values)\n   FEDORA_MESSAGING_TASK_RETRY_BACKOFF = 600\n   FEDORA_MESSAGING_TASK_RETRY_BACKOFF_MAX = 3600\n   FEDORA_MESSAGING_TASK_RETRY_JITTER = True\n   FEDORA_MESSAGING_TASK_MAX_RETRIES = 3\n   # Route messaging to notify queue\n   CELERY_TASK_ROUTES[\"weblate_fedora_messaging.tasks.*\"] = {\"queue\": \"notify\"}\n\n\nMessages content\n----------------\n\nTopic\n+++++\n\nAll messages have topic\n``weblate.<action>.<project>.<component>.<translation>``. The action is\nlowercase textual representation of action with underscores instead of space,\nfor example ``resource_update``, all other parts are optional and represent\nslug of the object or a language code.\n\nBody\n++++\n\nThe body consists of following fields (given that they are available for the event):\n\n``id``\n   Numerical ID of change\n``action``\n   Verbose name of the change, see `Change actions source code`_ for possible values\n``timestamp``\n   ISO formatted timestamp\n``target``\n   New value of the change (eg. new translation of the string)\n``old``\n   Old value of the change (eg. previous translation of the string)\n``source``\n   Source string.\n``url``\n   Absolute URL to view the related object.\n``author``\n   Author username (this can be different from user for example when accepting suggestions)\n``user``\n   Acting username\n``project``\n   Project slug\n``component``\n   Component slug\n``translation``\n   Translation language code\n\nHeaders\n+++++++\n\nThere are additional headers which you might utilize for routing as well:\n\n``action``\n   Verbose name of the change, see `Change actions source code`_ for possible values\n``project``\n   Project slug\n``component``\n   Component slug\n\n\n.. _Change actions source code: https://github.com/WeblateOrg/weblate/blob/master/weblate/trans/models/change.py#L218\n\n\nExample messages\n----------------\n\nRepository merge event:\n\n.. code-block:: json\n\n    {\n      \"id\": 1,\n      \"action\": \"Merged repository\",\n      \"timestamp\": \"2017-06-15T11:30:47.325000+00:00\",\n      \"url\": \"http://example.com/projects/test/test/\",\n      \"component\": \"test\"\n    }\n\nNew source string event:\n\n.. code-block:: json\n\n    {\n      \"id\": 2,\n      \"action\": \"New source string\",\n      \"timestamp\": \"2017-06-15T11:30:47.372000+00:00\",\n      \"url\": \"http://example.com/translate/test/test/cs/?checksum=6412684aaf018e8e\",\n      \"component\": \"test\",\n      \"translation\": \"cs\",\n      \"source\": [\"Hello, world!\\n\"]\n    }\n\nResource update event:\n\n.. code-block:: json\n\n    {\n      \"id\": 6,\n      \"action\": \"Resource update\",\n      \"timestamp\": \"2017-06-15T11:30:47.410000+00:00\",\n      \"url\": \"http://example.com/projects/test/test/cs/\",\n      \"project\": \"test\",\n      \"component\": \"test\",\n      \"translation\": \"cs\"\n    }\n    {\n      \"id\": 7,\n      \"action\": \"Resource update\",\n      \"timestamp\": \"2017-06-15T11:30:47.510000+00:00\",\n      \"url\": \"http://example.com/projects/test/test/de/\",\n      \"project\": \"test\",\n      \"component\": \"test\",\n      \"translation\": \"de\"\n    }\n    {\n      \"id\": 8,\n      \"action\": \"Resource update\",\n      \"timestamp\": \"2017-06-15T11:30:47.595000+00:00\",\n      \"url\": \"http://example.com/projects/test/test/it/\",\n      \"project\": \"test\",\n      \"component\": \"test\",\n      \"translation\": \"it\"\n    }\n\nProject removal event:\n\n.. code-block:: json\n\n    {\n      \"id\": 9,\n      \"action\": \"Removed project\",\n      \"timestamp\": \"2019-10-17T15:57:08.559420+00:00\",\n      \"target\": \"test\",\n      \"user\": \"testuser\"\n    }\n\nNew contributor event:\n\n.. code-block:: json\n\n    {\n      \"id\": 11,\n      \"action\": \"New contributor\",\n      \"timestamp\": \"2019-10-17T15:57:08.759960+00:00\",\n      \"url\": \"http://example.com/translate/test/test/cs/?checksum=6412684aaf018e8e\",\n      \"author\": \"testuser\",\n      \"user\": \"testuser\",\n      \"project\": \"test\",\n      \"component\": \"test\",\n      \"translation\": \"cs\",\n      \"source\": [\"Hello, world!\\n\"]\n    }\n\nNew translation event:\n\n.. code-block:: json\n\n    {\n      \"id\": 12,\n      \"action\": \"New translation\",\n      \"timestamp\": \"2019-10-17T15:57:08.772591+00:00\",\n      \"url\": \"http://example.com/translate/test/test/cs/?checksum=6412684aaf018e8e\",\n      \"target\": [\"Ahoj svete!\\n\"],\n      \"author\": \"testuser\",\n      \"user\": \"testuser\",\n      \"project\": \"test\",\n      \"component\": \"test\",\n      \"translation\": \"cs\",\n      \"source\": [\"Hello, world!\\n\"]\n    }\n\nContributing\n------------\n\nContributions are welcome! See `documentation <https://docs.weblate.org/en/latest/contributing/modules.html>`__ for more information.\n",
    "bugtrack_url": null,
    "license": "GPLv3+",
    "summary": "Weblate Fedora Messaging integration",
    "version": "0.7",
    "project_urls": {
        "Documentation": "https://docs.weblate.org/",
        "Download": "https://github.com/WeblateOrg/fedora_mesaging",
        "Homepage": "https://weblate.org/",
        "Issue Tracker": "https://github.com/WeblateOrg/fedora_messaging/issues",
        "Source Code": "https://github.com/WeblateOrg/fedora_messaging",
        "Twitter": "https://twitter.com/WeblateOrg"
    },
    "split_keywords": [
        "i18n",
        "l10n",
        "gettext",
        "git",
        "mercurial",
        "translate"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d41d16363e3772a69bdf5783dc5642c823f33552a9be2d90875d3d3201529dcd",
                "md5": "1743fa4c80a87fbadbab8513aeb20358",
                "sha256": "d70bc90677948f8b4f28043b607984ca8079c2894fc4a3b3142ffb0f6dafc238"
            },
            "downloads": -1,
            "filename": "weblate_fedora_messaging-0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1743fa4c80a87fbadbab8513aeb20358",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 20901,
            "upload_time": "2024-02-15T14:19:29",
            "upload_time_iso_8601": "2024-02-15T14:19:29.912655Z",
            "url": "https://files.pythonhosted.org/packages/d4/1d/16363e3772a69bdf5783dc5642c823f33552a9be2d90875d3d3201529dcd/weblate_fedora_messaging-0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "63aaf7368a0ceb66443b72cce39ce58d8e19ba8f283c002b0965ae2d1329b85c",
                "md5": "51b8b7beb4e78d958dcbb15e90b701e0",
                "sha256": "5a1f2919d11707394df4b2c08678117e3d6c07f545dbad8acf90016b6f054b5a"
            },
            "downloads": -1,
            "filename": "weblate_fedora_messaging-0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "51b8b7beb4e78d958dcbb15e90b701e0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 20832,
            "upload_time": "2024-02-15T14:19:31",
            "upload_time_iso_8601": "2024-02-15T14:19:31.600968Z",
            "url": "https://files.pythonhosted.org/packages/63/aa/f7368a0ceb66443b72cce39ce58d8e19ba8f283c002b0965ae2d1329b85c/weblate_fedora_messaging-0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-15 14:19:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "WeblateOrg",
    "github_project": "fedora_mesaging",
    "github_not_found": true,
    "lcname": "weblate-fedora-messaging"
}
        
Elapsed time: 0.19196s