diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-26 15:29:28 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-07-26 15:29:28 +0200 |
commit | 112be80ebdf96ef6a27420c1c6a10097388731a9 (patch) | |
tree | 0d175892bfd93a8127d9a7bec2d01e8e8f28e074 /support/doc | |
parent | 7545a0941c2a41c65e567ed8bf181f98d0f6f633 (diff) | |
download | PeerTube-112be80ebdf96ef6a27420c1c6a10097388731a9.tar.gz PeerTube-112be80ebdf96ef6a27420c1c6a10097388731a9.tar.zst PeerTube-112be80ebdf96ef6a27420c1c6a10097388731a9.zip |
Improve translation plugin guide
Diffstat (limited to 'support/doc')
-rw-r--r-- | support/doc/plugins/guide.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md index 1aae65a1c..b4f3e6638 100644 --- a/support/doc/plugins/guide.md +++ b/support/doc/plugins/guide.md | |||
@@ -30,6 +30,7 @@ | |||
30 | - [Tips](#tips) | 30 | - [Tips](#tips) |
31 | - [Compatibility with PeerTube](#compatibility-with-peertube) | 31 | - [Compatibility with PeerTube](#compatibility-with-peertube) |
32 | - [Spam/moderation plugin](#spammoderation-plugin) | 32 | - [Spam/moderation plugin](#spammoderation-plugin) |
33 | - [Other plugin examples](#other-plugin-examples) | ||
33 | 34 | ||
34 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> | 35 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> |
35 | 36 | ||
@@ -323,6 +324,15 @@ If you want to translate strings of your plugin (like labels of your registered | |||
323 | The key should be one of the locales defined in [i18n.ts](https://github.com/Chocobozzz/PeerTube/blob/develop/shared/models/i18n/i18n.ts). | 324 | The key should be one of the locales defined in [i18n.ts](https://github.com/Chocobozzz/PeerTube/blob/develop/shared/models/i18n/i18n.ts). |
324 | You **must** use the complete locales (`fr-FR` instead of `fr`). | 325 | You **must** use the complete locales (`fr-FR` instead of `fr`). |
325 | 326 | ||
327 | Translation files are just objects, with the english sentence as the key and the translation as the value. | ||
328 | `fr.json` could contain for example: | ||
329 | |||
330 | ```json | ||
331 | { | ||
332 | "Hello world": "Hello le monde" | ||
333 | } | ||
334 | ``` | ||
335 | |||
326 | ### Test your plugin/theme | 336 | ### Test your plugin/theme |
327 | 337 | ||
328 | You'll need to have a local PeerTube instance: | 338 | You'll need to have a local PeerTube instance: |
@@ -410,3 +420,6 @@ If you want to create an antispam/moderation plugin, you could use the following | |||
410 | * `filter:api.video-thread-comments.list.result`: to change/hide the text of replies | 420 | * `filter:api.video-thread-comments.list.result`: to change/hide the text of replies |
411 | * `filter:video.auto-blacklist.result`: to automatically blacklist local or remote videos | 421 | * `filter:video.auto-blacklist.result`: to automatically blacklist local or remote videos |
412 | 422 | ||
423 | ### Other plugin examples | ||
424 | |||
425 | You can take a look to "official" PeerTube plugins if you want to take inspiration from them: https://framagit.org/framasoft/peertube/official-plugins | ||