Add translations
This commit is contained in:
parent
9c37c5e7f6
commit
e763baddf3
@ -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) {
|
||||
|
4
peertube-plugin-hello-world/languages/fr.json
Normal file
4
peertube-plugin-hello-world/languages/fr.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"User name": "Nom d'utilisateur",
|
||||
"Admin name": "Nom d'administrateur"
|
||||
}
|
@ -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 () {
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -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": {}
|
||||
}
|
||||
|
@ -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": {}
|
||||
}
|
||||
|
@ -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": {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user