.. 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": null,
"name": "weblate_fedora_messaging",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "gettext, git, i18n, l10n, mercurial, translate",
"author": null,
"author_email": "Michal \u010ciha\u0159 <michal@cihar.com>",
"download_url": "https://files.pythonhosted.org/packages/21/75/d813b46335aa891a3a3be7e3e387c69b103afcec351aca3650b2b2a54b6a/weblate_fedora_messaging-0.9.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": "GPL-3.0-or-later",
"summary": "Weblate Fedora Messaging integration",
"version": "0.9",
"project_urls": {
"Documentation": "https://docs.weblate.org/",
"Download": "https://github.com/WeblateOrg/fedora_mesaging",
"Funding": "https://weblate.org/donate/",
"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": [
"gettext",
" git",
" i18n",
" l10n",
" mercurial",
" translate"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "a7306ab47ceda018236436dc04efaffbc1ceb53156e25362ae7acca5a48e27c0",
"md5": "d9f297508abb51c2941bb3714385a1e2",
"sha256": "7ab2fdcdc133c4ea7039f8d355cddfe1e16221b296b9a13bc5083f2858f44813"
},
"downloads": -1,
"filename": "weblate_fedora_messaging-0.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d9f297508abb51c2941bb3714385a1e2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 8890,
"upload_time": "2025-01-21T14:52:32",
"upload_time_iso_8601": "2025-01-21T14:52:32.735416Z",
"url": "https://files.pythonhosted.org/packages/a7/30/6ab47ceda018236436dc04efaffbc1ceb53156e25362ae7acca5a48e27c0/weblate_fedora_messaging-0.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "2175d813b46335aa891a3a3be7e3e387c69b103afcec351aca3650b2b2a54b6a",
"md5": "fff05719abc283ecea3c7ab52c106473",
"sha256": "39e577c8ffe9860f2507d0fbbbfdefcad88298d1d3d89e53a648cfd4f9397ee6"
},
"downloads": -1,
"filename": "weblate_fedora_messaging-0.9.tar.gz",
"has_sig": false,
"md5_digest": "fff05719abc283ecea3c7ab52c106473",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 21777,
"upload_time": "2025-01-21T14:52:33",
"upload_time_iso_8601": "2025-01-21T14:52:33.776555Z",
"url": "https://files.pythonhosted.org/packages/21/75/d813b46335aa891a3a3be7e3e387c69b103afcec351aca3650b2b2a54b6a/weblate_fedora_messaging-0.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-21 14:52:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "WeblateOrg",
"github_project": "fedora_mesaging",
"github_not_found": true,
"lcname": "weblate_fedora_messaging"
}