跳转到主要内容

Weblate Fedora Messaging集成

项目描述

Weblate

Weblate是一个开源的基于Web的持续本地化系统,在全球165个国家的2500多个开源项目和公司中使用。

Fedora消息集成和AMQP发布者,用于Weblate。

Website Translation status CII Best Practices PyPI package Documentation

安装

从PyPI安装

pip install weblate-fedora-messaging

源代码可在 <https://github.com/WeblateOrg/fedora_messaging> 获取。

配置Weblate集成

# 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"}

消息内容

主题

所有消息都具有主题 weblate.<action>.<project>.<component>.<translation>。动作是动作的下划线文本表示,而不是空格,例如 resource_update,其他部分都是可选的,表示对象的缩写或语言代码。

正文

正文包含以下字段(假设它们对事件可用)

id

变更的数字ID

action

变更的详细名称,请参阅变更动作源代码了解可能的值

时间戳

ISO格式的时间戳

目标

变更的新值(例如,字符串的新翻译)

旧值

变更的旧值(例如,字符串的先前翻译)

源字符串。

URL

查看相关对象的绝对URL。

作者

作者用户名(例如,在接受建议时可能不同于用户名)

用户

操作用户名

项目

项目别名

组件

组件别名

翻译

翻译语言代码

头部

还有其他可能用于路由的附加头部

action

变更的详细名称,请参阅变更动作源代码了解可能的值

项目

项目别名

组件

组件别名

示例消息

仓库合并事件

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

新源字符串事件

{
  "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"]
}

资源更新事件

{
  "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"
}

项目删除事件

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

新贡献者事件

{
  "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"]
}

新翻译事件

{
  "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"]
}

贡献

欢迎贡献!有关更多信息,请参阅文档

项目详细信息


下载文件

下载您平台上的文件。如果您不确定要选择哪个,请了解更多关于安装包的信息。

源分布

weblate_fedora_messaging-0.8.tar.gz (20.9 kB 查看哈希值)

上传时间

构建分布

weblate_fedora_messaging-0.8-py3-none-any.whl (20.9 kB 查看哈希值)

上传时间 Python 3

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面