Weblate Fedora Messaging integration
Project description
Weblate is a copylefted 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.
Installation
Install from PyPI:
pip install weblate-fedora-messaging
Sources are available at <https://github.com/WeblateOrg/fedora_messaging>.
Configure Weblate integration:
# Add to installed apps
INSTALLED_APPS.append("weblate_fedora_messaging")
# Path to configuration file
FEDORA_MESSAGING_CONF = "/etc/fedora-messaging/config.toml"
# 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
Example messages
Repository merge event:
{
"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:
{
"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:
{
"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:
{
"id": 9,
"action": "Removed project",
"timestamp": "2019-10-17T15:57:08.559420+00:00",
"target": "test",
"user": "testuser"
}
New contributor event:
{
"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:
{
"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"]
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for weblate_fedora_messaging-0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 825be0a8468541cadeca345057412bcc87284afe36f40ba3e2a24a06f5829e1f |
|
MD5 | d20f02a5025534ac79d61778cbb24990 |
|
BLAKE2b-256 | 6278184d61dad9119946a6a44db6bd78921822387d578de8085fc8b22865c622 |
Hashes for weblate_fedora_messaging-0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d736222e03cb1eebdef0d2c1424a9cbcd6a3123cb6e4d04e7df06e2b5e70d798 |
|
MD5 | 5f4c171f3595c19d86fe56fb86ab2170 |
|
BLAKE2b-256 | 9a16e6d892b53011e3c9967a5a9f79e591b190dfdf99ea01e3cb80ccec0b2ffe |