]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - support/doc/plugins/guide.md
Merge branch 'master' into develop
[github/Chocobozzz/PeerTube.git] / support / doc / plugins / guide.md
index 1aae65a1c11961a9d76fa8c8d1c8c35e5d7f69ed..8e720e94b1f3ac6a168f92bafc423ea3fa425d35 100644 (file)
 - [Tips](#tips)
   - [Compatibility with PeerTube](#compatibility-with-peertube)
   - [Spam/moderation plugin](#spammoderation-plugin)
+  - [Other plugin examples](#other-plugin-examples)
 
 <!-- END doctoc generated TOC please keep comment here to allow auto update -->
 
 ## Concepts
 
-Themes are exactly the same than plugins, except that:
+Themes are exactly the same as plugins, except that:
  * Their name starts with `peertube-theme-` instead of `peertube-plugin-`
  * They cannot declare server code (so they cannot register server hooks or settings)
  * CSS files are loaded by client only if the theme is chosen by the administrator or the user
@@ -323,6 +324,15 @@ If you want to translate strings of your plugin (like labels of your registered
 The key should be one of the locales defined in [i18n.ts](https://github.com/Chocobozzz/PeerTube/blob/develop/shared/models/i18n/i18n.ts).
 You **must** use the complete locales (`fr-FR` instead of `fr`).
 
+Translation files are just objects, with the english sentence as the key and the translation as the value.
+`fr.json` could contain for example:
+
+```json
+{
+  "Hello world": "Hello le monde"
+}
+```
+
 ### Test your plugin/theme
 
 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
  * `filter:api.video-thread-comments.list.result`: to change/hide the text of replies
  * `filter:video.auto-blacklist.result`: to automatically blacklist local or remote videos
  
+### Other plugin examples
+
+You can take a look to "official" PeerTube plugins if you want to take inspiration from them: https://framagit.org/framasoft/peertube/official-plugins