weblate-fedora-messaging


Nameweblate-fedora-messaging JSON
Version 0.8 PyPI version JSON
download
home_pagehttps://weblate.org/
SummaryWeblate Fedora Messaging integration
upload_time2024-08-15 10:50:29
maintainerNone
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": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "i18n l10n gettext git mercurial translate",
    "author": "Michal \u010ciha\u0159",
    "author_email": "michal@cihar.com",
    "download_url": "https://files.pythonhosted.org/packages/91/1b/a4bb542f143da0fad0c12117320f4a6b5149d49758a8bb9affaf99f4e4fa/weblate_fedora_messaging-0.8.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.8",
    "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": "5a3dab4d04160f4762c078fad3f8579f6db7d0b179db199e32a69c440779a837",
                "md5": "9e72ac6827cccf4d2e6556722a067069",
                "sha256": "3a050125772a45b01f0bca8f12ced244f8894749dc6746ceba573d06fe14669c"
            },
            "downloads": -1,
            "filename": "weblate_fedora_messaging-0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9e72ac6827cccf4d2e6556722a067069",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 20928,
            "upload_time": "2024-08-15T10:50:27",
            "upload_time_iso_8601": "2024-08-15T10:50:27.516453Z",
            "url": "https://files.pythonhosted.org/packages/5a/3d/ab4d04160f4762c078fad3f8579f6db7d0b179db199e32a69c440779a837/weblate_fedora_messaging-0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "911ba4bb542f143da0fad0c12117320f4a6b5149d49758a8bb9affaf99f4e4fa",
                "md5": "d1734edf2f2cb1c43c61c0e01850c133",
                "sha256": "67eaff433b5372daba868b313bd55dce3ca69d1fb1cb8c00a57139f3d604bb88"
            },
            "downloads": -1,
            "filename": "weblate_fedora_messaging-0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "d1734edf2f2cb1c43c61c0e01850c133",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 20854,
            "upload_time": "2024-08-15T10:50:29",
            "upload_time_iso_8601": "2024-08-15T10:50:29.468790Z",
            "url": "https://files.pythonhosted.org/packages/91/1b/a4bb542f143da0fad0c12117320f4a6b5149d49758a8bb9affaf99f4e4fa/weblate_fedora_messaging-0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-15 10:50:29",
    "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: 1.66013s