Skip to content

Commit 0aaa47a

Browse files
authored
Merge pull request #1 from panlatent/master
Fixed translation source and added Chinese translation(zh)
2 parents f590692 + c89b9c8 commit 0aaa47a

File tree

5 files changed

+51
-5
lines changed

5 files changed

+51
-5
lines changed

src/Webhook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function(string $attribute, array $params = null, Validator $validator) {
118118
}
119119
}
120120
if (!$foundEvent) {
121-
$validator->addError($this, $attribute, Craft::t('webhooks', "Class {$this->class} doesn’t appear to have a {value} event."));
121+
$validator->addError($this, $attribute, Craft::t('webhooks', 'Class {class} doesn’t appear to have a {value} event.', ['class' => $this->class]));
122122
}
123123
}
124124
}

src/controllers/WebhooksController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function actionEdit(int $id = null, int $groupId = null, Webhook $webhook
7878

7979
// Groups
8080
$groupOptions = [
81-
['value' => null, 'label' => '(Ungrouped)']
81+
['value' => null, 'label' => Craft::t('webhooks', '(Ungrouped)')]
8282
];
8383

8484
foreach ($manager->getAllGroups() as $group) {

src/templates/_edit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
{% endif %}
150150

151151
{{ forms.lightswitchField({
152-
label: 'Enabled',
152+
label: 'Enabled'|t('webhooks'),
153153
id: 'enabled',
154154
name: 'enabled',
155155
on: webhook.enabled

src/templates/_index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
{% block actionButton %}
88
{% set newWebhookUrl = url('webhooks/new', (groupId is defined ? { groupId: groupId } : null)) %}
9-
<a href="{{ newWebhookUrl }}" class="submit btn add icon">{{ "New webhook"|t('app') }}</a>
9+
<a href="{{ newWebhookUrl }}" class="submit btn add icon">{{ "New webhook"|t('webhooks') }}</a>
1010
{% endblock %}
1111

1212
{% block sidebar %}
1313
<nav>
1414
<ul id="groups">
15-
<li><a href="{{ url('webhooks') }}"{% if not groupId %} class="sel"{% endif %}>{{ 'Ungrouped'|t('app') }}</a></li>
15+
<li><a href="{{ url('webhooks') }}"{% if not groupId %} class="sel"{% endif %}>{{ 'Ungrouped'|t('webhooks') }}</a></li>
1616
{% for group in groups %}
1717
<li><a href="{{ url('webhooks/group/'~group.id) }}"{% if groupId is defined and group.id == groupId %} class="sel"{% endif %} data-id="{{ group.id }}">{{ group.name|t('site') }}</a></li>
1818
{% endfor %}

src/translations/zh/webhooks.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
return [
4+
'Delete webhook' => '删除 webhook',
5+
'Name' => '名称',
6+
'Sender Class' => '发送者类名',
7+
'Event Name' => '事件名称',
8+
'Request Type & URL' => '请求类型&URL',
9+
'Extra User Attributes' => '额外用户属性',
10+
'Extra Sender Attributes' => '额外发送者属性',
11+
'Extra Event Attributes' => '额外事件属性',
12+
'What the webhook will be called within the Control Panel.' => 'Webhook 在控制面板中称呼。',
13+
'The class name the sender must be an instance of.' => '发送者必须是一个实例的类名。',
14+
'The name of the event that must be triggered.' => '一定会被触发的事件名称。',
15+
'The request type and URL that the webhook should send. (The URL will be provided by your [task automation tool][1].)' => 'Webhook 应发送的请求类型和URL。(该URL将由您的[任务自动化工具] [1]提供。)',
16+
'List of additional attributes for the logged-in user that should be included in the webhook body.' => '应包含在 webhook 请求体中的登录用户的附加属性列表。',
17+
'List of additional attributes for the event sender that should be included in the webhook body.' => '应包含在 webhook 请求体中的事件发件者的附加属性列表。',
18+
'List of additional attributes for the event properties that should be included in the webhook body.' => '应包含在 webhook 请求体中的事件属性的附加属性列表。',
19+
'(Place separate attributes on new lines.)' => '(一个属性一行)',
20+
'Group' => '群组',
21+
'Ungrouped' => '未分组',
22+
'(Ungrouped)' => '(未分组)',
23+
'Webhook' => 'Webhook',
24+
'Webhooks' => 'Webhooks',
25+
'Enabled' => '已启用',
26+
'No webhooks exist yet.' => '没有 webhook 存在。',
27+
'Sending webhook “{name}”' => '发送 webhook “{name}”',
28+
'Sending webhook' => '发送 webhook',
29+
'Class {value} doesn’t exist.' => '类 {value} 不存在。',
30+
'Class {class} doesn’t appear to have a {value} event.' => '类 {class} 似乎没有 {value} 事件。',
31+
'{value} isn’t a valid attribute.' => '{value} 不是一个有效属性。',
32+
'Group created.' => '群组已添加。',
33+
'Group deleted.' => '群组已删除。',
34+
'New webhook' => '创建 webhook',
35+
'Edit Webhook' => '编辑 Webhook',
36+
'Create a new webhook' => '创建 webhook',
37+
'Couldn’t save webhook.' => '不能保存 webhook。',
38+
'Webhook saved.' => 'Webhook 已保存。',
39+
'Webhook enabled.' => 'Webhook 已启用。',
40+
'Webhook disabled.' => 'Webhook 已禁用。',
41+
'Could not create the group:' => '不能创建该组:',
42+
'Group renamed.' => '群组已重命名',
43+
'Could not rename the group:' => '不能重命名该组',
44+
'What do you want to name the group?' => '您想如何命名该组?',
45+
'Are you sure you want to delete this group?' => '你确定要删除该组吗?',
46+
];

0 commit comments

Comments
 (0)