Add translations

This commit is contained in:
Chocobozzz 2019-07-26 14:45:53 +02:00
parent 9c37c5e7f6
commit e763baddf3
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
7 changed files with 39 additions and 9 deletions

View File

@ -75,6 +75,9 @@ function onApplicationInit (peertubeHelpers) {
const topLeftBlock = document.querySelector('.top-left-block') const topLeftBlock = document.querySelector('.top-left-block')
topLeftBlock.style.backgroundImage = 'url(' + imageUrl + ')' topLeftBlock.style.backgroundImage = 'url(' + imageUrl + ')'
peertubeHelpers.translate('User name')
.then(translation => console.log('Translated User name by ' + translation))
} }
function addSymbolToVideoNameResult (result, symbol) { function addSymbolToVideoNameResult (result, symbol) {

View File

@ -0,0 +1,4 @@
{
"User name": "Nom d'utilisateur",
"Admin name": "Nom d'administrateur"
}

View File

@ -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' const defaultAdmin = 'PeerTube admin'
registerHook({ registerHook({
@ -30,6 +38,15 @@ async function register ({ registerHook, registerSetting, settingsManager, stora
console.log(value) console.log(value)
await storageManager.storeData('toto', 'hello' + new Date()) 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 () { async function unregister () {

View File

@ -1,6 +1,6 @@
{ {
"name": "peertube-plugin-hello-world", "name": "peertube-plugin-hello-world",
"version": "0.0.12", "version": "0.0.13",
"description": "Hello world PeerTube plugin example", "description": "Hello world PeerTube plugin example",
"engine": { "engine": {
"peertube": ">=1.3.0" "peertube": ">=1.3.0"
@ -33,5 +33,8 @@
"script": "client/search-client-plugin.js", "script": "client/search-client-plugin.js",
"scopes": [ "search" ] "scopes": [ "search" ]
} }
] ],
"translations": {
"fr-FR": "./languages/fr.json"
}
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "peertube-plugin-matomo", "name": "peertube-plugin-matomo",
"version": "0.0.1", "version": "0.0.2",
"description": "Hello world PeerTube plugin example", "description": "Hello world PeerTube plugin example",
"engine": { "engine": {
"peertube": ">=1.3.0" "peertube": ">=1.3.0"
@ -20,5 +20,6 @@
"script": "client/common-client-plugin.js", "script": "client/common-client-plugin.js",
"scopes": [ "common" ] "scopes": [ "common" ]
} }
] ],
"translations": {}
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "peertube-theme-background-red", "name": "peertube-theme-background-red",
"version": "0.0.3", "version": "0.0.4",
"description": "Example PeerTube theme", "description": "Example PeerTube theme",
"engine": { "engine": {
"peertube": ">=1.3.1" "peertube": ">=1.3.1"
@ -24,5 +24,6 @@
"script": "client/video-watch-client-plugin.js", "script": "client/video-watch-client-plugin.js",
"scopes": [ "video-watch" ] "scopes": [ "video-watch" ]
} }
] ],
"translations": {}
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "peertube-theme-dark", "name": "peertube-theme-dark",
"version": "0.0.1", "version": "0.0.2",
"description": "PeerTube dark theme", "description": "PeerTube dark theme",
"engine": { "engine": {
"peertube": ">=1.3.0" "peertube": ">=1.3.0"
@ -16,5 +16,6 @@
"css": [ "css": [
"assets/style.css" "assets/style.css"
], ],
"clientScripts": [] "clientScripts": [],
"translations": {}
} }