diff --git a/peertube-plugin-hello-world/client/common-client-plugin.js b/peertube-plugin-hello-world/client/common-client-plugin.js index c838c38..ea916c1 100644 --- a/peertube-plugin-hello-world/client/common-client-plugin.js +++ b/peertube-plugin-hello-world/client/common-client-plugin.js @@ -75,6 +75,9 @@ function onApplicationInit (peertubeHelpers) { const topLeftBlock = document.querySelector('.top-left-block') topLeftBlock.style.backgroundImage = 'url(' + imageUrl + ')' + + peertubeHelpers.translate('User name') + .then(translation => console.log('Translated User name by ' + translation)) } function addSymbolToVideoNameResult (result, symbol) { diff --git a/peertube-plugin-hello-world/languages/fr.json b/peertube-plugin-hello-world/languages/fr.json new file mode 100644 index 0000000..65003d5 --- /dev/null +++ b/peertube-plugin-hello-world/languages/fr.json @@ -0,0 +1,4 @@ +{ + "User name": "Nom d'utilisateur", + "Admin name": "Nom d'administrateur" +} diff --git a/peertube-plugin-hello-world/main.js b/peertube-plugin-hello-world/main.js index 06ac973..7da2f01 100644 --- a/peertube-plugin-hello-world/main.js +++ b/peertube-plugin-hello-world/main.js @@ -1,4 +1,12 @@ -async function register ({ registerHook, registerSetting, settingsManager, storageManager }) { +async function register ({ + registerHook, + registerSetting, + settingsManager, + storageManager, + videoCategoryManager, + videoLicenceManager, + videoLanguageManager +}) { const defaultAdmin = 'PeerTube admin' registerHook({ @@ -30,6 +38,15 @@ async function register ({ registerHook, registerSetting, settingsManager, stora console.log(value) await storageManager.storeData('toto', 'hello' + new Date()) + + videoLanguageManager.addLanguage('al_bhed', 'Al Bhed') + videoLanguageManager.deleteLanguage('fr') + + videoCategoryManager.addCategory(42, 'Best category') + videoCategoryManager.deleteCategory(1) // Music + + videoLicenceManager.addLicence(42, 'Best licence') + videoLicenceManager.deleteLicence(7) // Public domain } async function unregister () { diff --git a/peertube-plugin-hello-world/package.json b/peertube-plugin-hello-world/package.json index 3ff4760..a97b111 100644 --- a/peertube-plugin-hello-world/package.json +++ b/peertube-plugin-hello-world/package.json @@ -1,6 +1,6 @@ { "name": "peertube-plugin-hello-world", - "version": "0.0.12", + "version": "0.0.13", "description": "Hello world PeerTube plugin example", "engine": { "peertube": ">=1.3.0" @@ -33,5 +33,8 @@ "script": "client/search-client-plugin.js", "scopes": [ "search" ] } - ] + ], + "translations": { + "fr-FR": "./languages/fr.json" + } } diff --git a/peertube-plugin-matomo/package.json b/peertube-plugin-matomo/package.json index 4613625..7a7dc72 100644 --- a/peertube-plugin-matomo/package.json +++ b/peertube-plugin-matomo/package.json @@ -1,6 +1,6 @@ { "name": "peertube-plugin-matomo", - "version": "0.0.1", + "version": "0.0.2", "description": "Hello world PeerTube plugin example", "engine": { "peertube": ">=1.3.0" @@ -20,5 +20,6 @@ "script": "client/common-client-plugin.js", "scopes": [ "common" ] } - ] + ], + "translations": {} } diff --git a/peertube-theme-background-red/package.json b/peertube-theme-background-red/package.json index 9276211..28ad8f5 100644 --- a/peertube-theme-background-red/package.json +++ b/peertube-theme-background-red/package.json @@ -1,6 +1,6 @@ { "name": "peertube-theme-background-red", - "version": "0.0.3", + "version": "0.0.4", "description": "Example PeerTube theme", "engine": { "peertube": ">=1.3.1" @@ -24,5 +24,6 @@ "script": "client/video-watch-client-plugin.js", "scopes": [ "video-watch" ] } - ] + ], + "translations": {} } diff --git a/peertube-theme-dark/package.json b/peertube-theme-dark/package.json index 708951a..2b6e829 100644 --- a/peertube-theme-dark/package.json +++ b/peertube-theme-dark/package.json @@ -1,6 +1,6 @@ { "name": "peertube-theme-dark", - "version": "0.0.1", + "version": "0.0.2", "description": "PeerTube dark theme", "engine": { "peertube": ">=1.3.0" @@ -16,5 +16,6 @@ "css": [ "assets/style.css" ], - "clientScripts": [] + "clientScripts": [], + "translations": {} }