Merge branch 'develop'

This commit is contained in:
John Livingston 2023-03-06 12:05:27 +01:00
commit 58456b8fb4
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
22 changed files with 968 additions and 187 deletions

View File

@ -4,6 +4,11 @@
"extends": [],
"globals": {},
"plugins": [],
"ignorePatterns": ["node_modules/", "dist/", "webpack.config.js", "build/", "vendor/"],
"ignorePatterns": [
"node_modules/", "dist/", "webpack.config.js",
"build/",
"vendor/",
"support/documentation",
"build-*js"],
"rules": {}
}

View File

@ -2,6 +2,13 @@
## ??? (Not Released Yet)
### New Features
* Settings page translations:
* english,
* french,
* german (thanks [Gamemap](https://github.com/Gamemap))
### Minor changes and fixes
* Updating a link to the documentation in the settings page.

154
build-languages.js Normal file
View File

@ -0,0 +1,154 @@
/**
* This script is used to build the translations files.
*
* Indeed, some strings used in plugin settings are not easy to write
* in JSON format (contains html, double quotes, line breaks, ...).
* So we use YAML files to translates these strings,
* including the english version.
*
* This scripts takes the standard JSON files, the YAML translation files,
* and mixes everything up in dist/languages/xx.json.
*/
const fs = require('fs')
const path = require('path')
const YAML = require('yaml')
class BuildLanguages {
destinationDir = null
langs = []
translationsStrings = {}
monoLingualReferences = {}
constructor () {
this.destinationDir = path.resolve(__dirname, 'dist', 'languages')
}
async generateFiles () {
await this.loadLangs()
await this.initTranslationStrings()
await this.readJSONTranslations()
await this.readSettingsTranslations()
await this.ensureDestinationDir()
await this.writeJSONTranslations()
await this.writeMonoLingualReferences()
}
loadLangs () {
const packagejson = require('./package.json')
const translations = packagejson.translations || {}
this.langs = Object.values(translations).map(filename => {
return filename.match(/^.*\/(\w+)\.json$/)[1]
})
console.log('Existing languages: ', this.langs)
}
initTranslationStrings () {
console.log('Initializing translations strings...')
const translationsStrings = {}
for (const l of this.langs) {
translationsStrings[l] = {}
}
this.translationsStrings = translationsStrings
}
async readJSONTranslations () {
console.log('Reading standard JSON translation strings...')
const translationsStrings = this.translationsStrings
for (const l of this.langs) {
const filePath = path.resolve(__dirname, 'languages', l + '.json')
if (!fs.existsSync(filePath)) {
console.warn(`File ${filePath} missing, ignoring.`)
continue
}
const t = require(filePath)
for (const k in t) {
const v = t[k]
if (k in translationsStrings[l]) {
throw new Error(`Duplicate translation for key ${k} in lang ${l}.`)
}
translationsStrings[l][k] = v
}
}
}
async readSettingsTranslations () {
console.log('Reading Settings Yaml translation strings...')
// First we must get the english reference file,
// that will give us the keys to use in final JSON.
const reference = await this.getYmlFileContent(path.resolve(__dirname, 'languages', 'settings', 'en.yml'))
this.monoLingualReferences['settings'] = reference
const translationsStrings = this.translationsStrings
for (const l of this.langs) {
const filePath = path.resolve(__dirname, 'languages', 'settings', l + '.yml')
const o = await this.getYmlFileContent(filePath)
for (const k in o) {
if (!(k in reference)) {
throw new Error(`File ${filePath} contains unknown keys. Key=${k}.`)
}
const newKey = reference[k]
this.translationsStrings[l][newKey] = o[k]
}
}
}
async getYmlFileContent (filePath) {
if (!fs.existsSync(filePath)) {
console.warn(`File ${filePath} missing, ignoring.`)
return {}
}
const content = await fs.promises.readFile(filePath, 'utf8')
const o = YAML.parse(content) || {}
for (const k in o) {
let v = o[k]
if (v === null) {
// this value is ok!
continue
}
if ((typeof v) !== 'string') {
throw new Error(`File ${filePath} contains strings that are not strings! Key=${k}`)
}
// We are normalizing the string, to avoid problems.
// As it is supposed to be html, we will strip newlines and multiple adjacent spaces.
v = v.replace(/\n/g, ' ')
v = v.replace(/\s\s+/g, ' ')
v = v.trim()
o[k] = v
}
return o
}
async ensureDestinationDir () {
if (!fs.existsSync(this.destinationDir)) {
await fs.promises.mkdir(this.destinationDir)
}
}
async writeJSONTranslations () {
console.log('Writing JSON files...')
for (const l of this.langs) {
const filePath = path.resolve(this.destinationDir, l + '.json')
await fs.promises.writeFile(filePath, JSON.stringify(this.translationsStrings[l]))
}
}
async writeMonoLingualReferences () {
console.log('Writing JSON reference files...')
for (const name in this.monoLingualReferences) {
const filePath = path.resolve(this.destinationDir, name + '.reference.json')
await fs.promises.writeFile(filePath, JSON.stringify(this.monoLingualReferences[name]))
}
}
}
const bl = new BuildLanguages()
bl.generateFiles().then(() => {}, (err) => {
console.error(err)
throw err
})

View File

@ -99,14 +99,13 @@ function register ({ registerHook, registerSettingsScript, peertubeHelpers }: Re
const table = document.createElement('table')
table.classList.add('peertube-plugin-livechat-prosody-list-rooms')
container.append(table)
// TODO: translate labels.
const labels: any = {
RoomName: 'Room name',
RoomDescription: 'Room description',
NotFound: 'Not found',
Video: 'Video',
Channel: 'Channel',
LastActivity: 'Last activity'
RoomName: await peertubeHelpers.translate('Room name'),
RoomDescription: await peertubeHelpers.translate('Room description'),
NotFound: await peertubeHelpers.translate('Not found'),
Video: await peertubeHelpers.translate('Video'),
Channel: await peertubeHelpers.translate('Channel'),
LastActivity: await peertubeHelpers.translate('Last activity')
}
const titleLineEl = document.createElement('tr')

View File

@ -15,5 +15,11 @@
"Open": false,
"Use current theme colors": false,
"Generate an iframe to embed the chat in a website": false,
"Chat for live stream": false
"Chat for live stream": false,
"Room name": false,
"Room description": false,
"Not found": false,
"Video": false,
"Channel": false,
"Last activity": false
}

View File

@ -15,5 +15,11 @@
"Open": "Öffnen",
"Use current theme colors": "Die derzeitigen Themenfarben nutzen",
"Generate an iframe to embed the chat in a website": "IFrame-Element erstellen, um den Chat in eine Webseite zu integrieren",
"Chat for live stream": "Chat für den Livestream"
"Chat for live stream": "Chat für den Livestream",
"Room name": false,
"Room description": false,
"Not found": false,
"Video": false,
"Channel": false,
"Last activity": false
}

View File

@ -15,5 +15,11 @@
"Open": "Malfermi",
"Use current theme colors": "Uzi koloroj el la nuna etoso",
"Generate an iframe to embed the chat in a website": false,
"Chat for live stream": false
"Chat for live stream": false,
"Room name": false,
"Room description": false,
"Not found": false,
"Video": false,
"Channel": false,
"Last activity": false
}

View File

@ -15,5 +15,11 @@
"Open": "Abrir",
"Use current theme colors": "Utilizar los colores del tema actual",
"Generate an iframe to embed the chat in a website": false,
"Chat for live stream": false
"Chat for live stream": false,
"Room name": false,
"Room description": false,
"Not found": false,
"Video": false,
"Channel": false,
"Last activity": false
}

View File

@ -15,5 +15,11 @@
"Open": "Ireki",
"Use current theme colors": "Erabili uneko itxuraren koloreak",
"Generate an iframe to embed the chat in a website": false,
"Chat for live stream": false
"Chat for live stream": false,
"Room name": false,
"Room description": false,
"Not found": false,
"Video": false,
"Channel": false,
"Last activity": false
}

View File

@ -15,5 +15,11 @@
"Open": "Ouvrir",
"Use current theme colors": "Utiliser les couleurs du thème courant",
"Generate an iframe to embed the chat in a website": "Générer une iframe pour intégrer le tchat dans un site web",
"Chat for live stream:": "Tchat pour le direct :"
"Chat for live stream:": "Tchat pour le direct :",
"Room name": "Nom du salon",
"Room description": "Description du salon",
"Not found": "Non trouvé",
"Video": "Vidéo",
"Channel": "Chaîne",
"Last activity": "Dernière activité"
}

View File

@ -15,5 +15,11 @@
"Open": false,
"Use current theme colors": false,
"Generate an iframe to embed the chat in a website": false,
"Chat for live stream": false
"Chat for live stream": false,
"Room name": false,
"Room description": false,
"Not found": false,
"Video": false,
"Channel": false,
"Last activity": false
}

View File

@ -15,5 +15,11 @@
"Open": "開く",
"Use current theme colors": "現在のテーマカラーを使用する",
"Generate an iframe to embed the chat in a website": false,
"Chat for live stream": false
"Chat for live stream": false,
"Room name": false,
"Room description": false,
"Not found": false,
"Video": false,
"Channel": false,
"Last activity": false
}

View File

@ -15,5 +15,11 @@
"Open": "Dobrir",
"Use current theme colors": "Utilizar las colors del tèma actual" ,
"Generate an iframe to embed the chat in a website": false,
"Chat for live stream": false
"Chat for live stream": false,
"Room name": false,
"Room description": false,
"Not found": false,
"Video": false,
"Channel": false,
"Last activity": false
}

View File

@ -15,5 +15,11 @@
"Open": false,
"Use current theme colors": false,
"Generate an iframe to embed the chat in a website": false,
"Chat for live stream": false
"Chat for live stream": false,
"Room name": false,
"Room description": false,
"Not found": false,
"Video": false,
"Channel": false,
"Last activity": false
}

181
languages/settings/de.yml Normal file
View File

@ -0,0 +1,181 @@
important_note_title: "<h3>Wichtige Hinweise</h3>"
important_note_text: |
Sie können die Dokumentation hier finden:
<a href="https://johnxlivingston.github.io/peertube-plugin-livechat/de/" target="_blank">
Peertube Plugin Livechat Dokumentation
</a>.
diagnostic: |
Bevor Sie um Hilfe bitten, verwenden Sie bitte das Diagnosetool:
<a class="peertube-plugin-livechat-launch-diagnostic">Diagnose starten</a>
(wenn dieser Knopf kein neues Fenster öffnet, versuchen Sie bitte, die Seite zu aktualisieren).
chat_title: "<h3>Chat</h3>"
list_rooms_label: "Bestehende Räume auflisten"
list_rooms_description: |
<a class="peertube-plugin-livechat-prosody-list-rooms-btn">Räume auflisten</a>
chat_behaviour_description: "<h3>Chatverhalten</h3>"
room_type_label: "Raumtyp"
room_type_description: "Sie können hier wählen, ob Sie für jedes Video einen eigenen Raum haben möchten oder ob Sie sie nach Kanälen gruppieren möchten."
room_type_option_video: "Eigenen Webchat-Raum für jedes Video"
room_type_option_channel: "Webchat-Räume nach Kanal gruppieren"
auto_display_label: "Chat automatisch öffnen"
auto_display_description: "Wenn ausgewählt wird der Chat geladen, sobald Sie auf der Videoseite sind."
open_blank_label: "Zeige den «Chat in neuem Fenster öffnen» Knopf"
open_blank_description: "Es wird einen Knopf zum Öffnen des Webchats in einem neuen Fenster geben."
share_url_label: "Zeige den «Chat Link teilen» Knopf"
share_url_description: "Es wird einen Knopf für das Teilen des Chat Links geben (könnte z.B. für die Integration in OBS verwendet werden)."
share_url_option_nobody: "Niemandem zeigen"
share_url_option_everyone: "Jedem zeigen"
share_url_option_owner: "Videobesitzer zeigen"
share_url_option_owner_moderators: "Videobesitzern, Instanzmoderatoren zeigen"
per_live_video_label: "Nutzer können den Chat für ihre Live-Videos aktivieren"
per_live_video_description: |
Wenn diese Option aktiviert ist, haben alle Live-Videos in ihren Eigenschaften ein Feld zur Aktivierung des Webchats.
Der Videoeigentümer kann Webchats aktivieren.
per_live_video_warning_description: |
<span class="peertube-plugin-livechat-warning">
Sie haben die Einstellung «Nutzer können den Chat für ihre Livestreams aktivieren» aktiviert.
Die Einstellung ist von der «Chats für alle Livestreams aktivieren» Einstellung abhängig.
</span>
all_lives_label: "Chat für alle Live-Videos aktivieren"
all_lives_description: "Wenn diese Option markiert ist, wird der Chat für alle Live-Videos aktiviert."
all_non_lives_label: "Chat für alle Nicht-Live-Videos aktivieren"
all_non_lives_description: "Wenn diese Option aktiviert ist, wird der Chat für alle Videos aktiviert, die keine Live-Videos sind."
videos_list_label: "Chat für diese Videos aktivieren"
videos_list_description: |
Videos UUIDs, für die wir einen Webchat wollen.
Es können auch Nicht-Livestream-Videos sein. Ein Video pro Zeile. <br />
Sie können Kommentare hinzufügen: alles nach dem #-Zeichen wird entfernt, und leere Zeilen werden ignoriert. <br />
Fügen Sie keine privaten Videos hinzu, die UUIDs werden an das Frontend gesendet.
no_anonymous_label: "Chat für anonyme Benutzer ausblenden"
no_anonymous_description: "Wenn die Option aktiviert ist, können anonyme Peertube-Nutzer den Chat nicht sehen."
theming_advanced_description: "<h3>Themen</h3>"
converse_theme_label: "ConverseJS Thema"
converse_theme_description: "Bitte wählen Sie, welches ConverseJS Thema Sie nutzen möchten."
converse_theme_option_peertube: "Peertube Thema"
converse_theme_option_default: "Default ConverseJS Thema"
converse_theme_option_concord: "ConverseJS Concord Thema"
autocolors_label: "Automatische Farberkennung"
autocolors_description: |
Versucht, die Farben des aktuellen Themas des Benutzers automatisch zu erkennen.<br>
Wenn diese Einstellung aktiviert ist, versucht das Plugin, die Farben für das Chat-Thema automatisch zu erkennen.<br>
Wenn dies für einige Ihrer Peertube-Themen nicht korrekt funktioniert, können Sie diese Option deaktivieren.
Sie können den Fehler im offiziellen
<a href="https://github.com/JohnXLivingston/peertube-plugin-livechat/issues" target="_blank">
Issue Tracker
</a> melden. Vergessen Sie nicht anzugeben, welches Thema nicht funktioniert.
chat_style_label: "Webchat Iframe Stil-Attribut"
chat_style_description: |
Sie können einige benutzerdefinierte Stile hinzufügen, die dem Iframe hinzugefügt werden.
Zum Beispiel eine benutzerdefinierte Breite: width:400px;
prosody_advanced_description: "<h3>Erweiterte Einstellungen des Chatservers</h3>"
help_builtin_prosody_label: "Prosody Server"
help_builtin_prosody_description: |
Dieses Plugin verwendet den Prosody XMPP-Server zur Verwaltung von Chaträumen.<br>
Dieses Plugin wird mit einem Prosody AppImage geliefert, das zur Ausführung des Dienstes verwendet wird.
system_prosody_label: "System Prosody benutzen"
system_prosody_description: |
Warnung: Aktivieren Sie diese Einstellungen nicht, wenn Sie nicht sicher sind, was Sie tun.<br>
Wenn Sie diese Einstellungen aktivieren, wird Ihr Peertube den Prosody-Server verwenden, der mit Ihrem System geliefert wird,
und nicht das eingebettete AppImage.<br>
Nutzen Sie diese Einstellung nur, wenn Sie Probleme mit dem eingebetteten Prosody haben.
disable_websocket_label: "Websocket deaktivieren"
disable_websocket_description: |
Mit Peertube &gt;= 5.0.0 versucht dieses Plugin, eine Websocket-Verbindung zum Chatten zu verwenden.
Wenn der Browser oder die Verbindung des Benutzers nicht kompatibel ist, wird der Browser automatisch auf das BOSH-Protokoll zurückgreifen.
<br>
Aber in seltenen Fällen kann dies fehlschlagen. Zum Beispiel, wenn Sie einen Reverse Proxy vor Peertube haben, der keine
Websocket-Verbindung für Plugins erlaubt.
In diesem Fall können Sie diese Einstellungen überprüfen, um Websocket-Verbindungen zu deaktivieren.
prosody_port_label: "Prosody port"
prosody_port_description: |
Der Port, der vom integrierten Prosody-Server verwendet wird.<br>
Ändern Sie ihn, wenn dieser Port bereits auf Ihrem Server verwendet wird.<br>
Sie können diesen Port auf Ihrer Firewall schließen, es wird nicht von der Außenwelt darauf zugegriffen.
prosody_peertube_uri_label: "Peertube-URL für API-Aufrufe"
prosody_peertube_uri_description: |
Bitte lassen Sie diese Einstellungen leer, wenn Sie nicht wissen, was Sie tun.<br>
In einigen seltenen Fällen kann Prosody die API von Peertube nicht von seiner öffentlichen URI aufrufen.
Sie können dieses Feld verwenden, um die URI von Peertube für Prosody-Module anzupassen
(z.B. mit «http://localhost:9000» oder «http://127.0.0.1:9000»).
prosody_muc_log_by_default_label: "Standardmäßig Inhalte von Räumen protokollieren"
prosody_muc_log_by_default_description: |
Wenn diese Option aktiviert ist, werden die Rauminhalte standardmäßig gespeichert.
Jeder Benutzer, der einem Raum beitritt, sieht, was bereits geschrieben wurde, bevor er dem Chat beitrat.<br>
Bitte beachten Sie, dass es immer möglich ist, die Inhaltsarchivierung für einen bestimmten Raum zu aktivieren/deaktivieren, indem Sie seine Eigenschaften bearbeiten.
prosody_muc_expiration_label: "Ablaufzeit von Raumprotokollen"
prosody_muc_expiration_description: |
Sie können hier auswählen, wie lange der Inhalt des Chatrooms vom Server aufbewahrt wird. Der Wert kann sein:
<ul>
<li><b>60</b>: Der Inhalt wird 60 <b>Sekunden</b> gespeichert. Sie können 60 durch einen beliebigen ganzzahligen Wert ersetzen.</li>
<li><b>1d</b>: Der Inhalt wird für 1 <b>Tag</b> gespeichert. Sie können 1 durch einen beliebigen ganzzahligen Wert ersetzen.</li>
<li><b>1w</b>: Der Inhalt wird für 1 <b>Woche</b> gespeichert. Sie können 1 durch einen beliebigen ganzzahligen Wert ersetzen.</li>
<li><b>1m</b>: Der Inhalt wird für 1 <b>Monat</b> gespeichert. Sie können 1 durch einen beliebigen ganzzahligen Wert ersetzen.</li>
<li><b>1y</b>: Der Inhalt wird für 1 <b>Jahr</b> gespeichert. Sie können 1 durch einen beliebigen ganzzahligen Wert ersetzen.</li>
<li><b>nie</b>: Der Inhalt läuft nie ab und wird für immer aufbewahrt.</li>
</ul>
prosody_c2s_label: "Aktivieren von Client-Server-Verbindungen"
prosody_c2s_description: |
Ermöglichen Sie XMPP-Clients die Verbindung zum integrierten Prosody-Server.<br>
Diese Option allein lässt nur Verbindungen von localhost-Clients zu.
prosody_c2s_port_label: "Prosody Client-Server-Verbindungsport"
prosody_c2s_port_description: |
Der Port, der vom c2s-Modul des integrierten Prosody-Servers verwendet wird.<br>
XMPP-Clients müssen diesen Port zum Verbinden verwenden.<br>
Ändern Sie ihn, wenn dieser Port bereits auf Ihrem Server verwendet wird.<br>
Sie können diesen Port auf Ihrer Firewall vorerst geschlossen halten, es wird nicht von der Außenwelt darauf zugegriffen.
prosody_components_label: "Aktivieren externer XMPP-Komponenten"
prosody_components_description: |
Aktivieren Sie die Verwendung externer XMPP-Komponenten.<br>
Diese Option allein erlaubt nur Verbindungen von localhost.<br>
Diese Funktion kann beispielsweise verwendet werden, um einige Bots mit den Chatrooms zu verbinden.
prosody_components_port_label: "Port für externe Komponenten zur Verbindung mit Prosody"
prosody_components_port_description: |
Der Port, der von XMPP-Komponenten verwendet wird, um sich mit dem Prosody-Server zu verbinden.<br>
Ändern Sie ihn, wenn dieser Port bereits auf Ihrem Server verwendet wird.<br>
Sie können diesen Port auf Ihrer Firewall vorerst geschlossen halten, es wird nicht von Außerhelb darauf zugegriffen.
prosody_components_list_label: "Externe Komponenten"
prosody_components_list_description: |
Die zu erstellenden externen Komponenten:
<ul>
<li>Eine pro Zeile.</li>
<li>Verwenden Sie das Format «Komponentenname:Komponenten_Geheimnis» (Leerzeichen werden entfernt)</li>
<li>Sie können Kommentare hinzufügen: alles nach dem #-Zeichen wird entfernt und leere Zeilen werden ignoriert</li>
<li>Der Name darf nur alphanumerische Zeichen und Punkte enthalten</li>
<li>
Wenn der Name nur alphanumerische Zeichen enthält, wird ihm die XMPP-Domäne angehängt.
Aus «bridge» wird zum Beispiel «bridge.your_domain.tld».
Sie können auch einen vollständigen Domänennamen angeben, müssen jedoch sicherstellen, dass Ihr DNS korrekt konfiguriert ist.
</li>
<li>Verwenden Sie nur alphanumerische Zeichen in der geheimen Passphrase (verwenden Sie mindestens 15 Zeichen).</li>
</ul>

186
languages/settings/en.yml Normal file
View File

@ -0,0 +1,186 @@
important_note_title: "<h3>Important notes</h3>"
important_note_text: |
You can find the plugin documentation here:
<a href="https://johnxlivingston.github.io/peertube-plugin-livechat/" target="_blank">
Peertube Plugin Livechat documentation
</a>.
diagnostic: |
Before asking for help, please use the diagnostic tool:
<a class="peertube-plugin-livechat-launch-diagnostic">Launch diagnostic</a>
(if this button is not opening a new window, please try to refresh the page).
chat_title: "<h3>Chat</h3>"
list_rooms_label: "List existing rooms"
list_rooms_description: |
<a class="peertube-plugin-livechat-prosody-list-rooms-btn">List rooms</a>
chat_behaviour_description: "<h3>Chat behaviour</h3>"
room_type_label: "Room type"
room_type_description: "You can choose here to have separate rooms for each video, or to group them by channel."
room_type_option_video: "Each video has its own webchat room"
room_type_option_channel: "Webchat rooms are grouped by channel"
auto_display_label: "Automatically open the chat"
auto_display_description: "When watching a video, the chatbox will automatically open."
open_blank_label: "Show the «open in new window» button"
open_blank_description: "There will be a button for opening the web chat in a new window."
share_url_label: "Show the «share chat link» button"
share_url_description: "There will be a button for sharing a chat url (could be used to intregrated in OBS for example)."
share_url_option_nobody: "Show for nobody"
share_url_option_everyone: "Show for everyone"
share_url_option_owner: "Show for the video owner"
share_url_option_owner_moderators: "Show for the video owner and instance's moderators"
per_live_video_label: "Users can activate the chat for their lives"
per_live_video_description: "If checked, all live videos will have a checkbox in their properties for enabling the web chat."
per_live_video_warning_description: |
<span class="peertube-plugin-livechat-warning">
You have enabled the setting «Users can activate the chat for their lives».
It is redundant with the «Activate chat for all lives» setting.
</span>
all_lives_label: "Activate chat for all lives"
all_lives_description: "If checked, the chat will be enabled for all lives."
all_non_lives_label: "Activate chat for all non-lives"
all_non_lives_description: "If checked, the chat will be enable for all video that are not lives."
videos_list_label: "Activate chat for these videos"
videos_list_description: |
Videos UUIDs for which we want a web chat.
Can be non-live videos. One per line. <br />
You can add comments: everything after the # character will be stripped off, and empty lines ignored.<br />
Don't add private videos, the UUIDs will be send to frontend.
no_anonymous_label: "Hide the chat for anonymous users"
no_anonymous_description: "If checked, anonymous Peertube users won't see the chat."
theming_advanced_description: "<h3>Theming</h3>"
converse_theme_label: "ConverseJS theme"
converse_theme_description: "Please choose the converseJS theme you want to use."
converse_theme_option_peertube: "Peertube theme"
converse_theme_option_default: "Default ConverseJS theme"
converse_theme_option_concord: "ConverseJS concord theme"
autocolors_label: "Automatic color detection"
autocolors_description: |
Try to auto detect colors from user's current theme.<br>
When this settings is enabled, the plugin tries to auto-detect colors to apply to the chat theme.<br>
If this is not correctly working for some of your Peertube theme, you can disable this option.
You can report the bug on the official
<a href="https://github.com/JohnXLivingston/peertube-plugin-livechat/issues" target="_blank">
issue tracker
</a>. Don't forget to specify which theme is not working.
chat_style_label: "Webchat iframe style attribute"
chat_style_description: |
Additional styles to be added on the iframe style attribute. <br>
Example: height:400px;
prosody_advanced_description: "<h3>Chat server advanced settings</h3>"
help_builtin_prosody_label: "Prosody server"
help_builtin_prosody_description: |
This plugin uses the Prosody XMPP server to handle chat rooms.<br>
This plugin comes with a Prosody AppImage, that will be used to run the service.
system_prosody_label: "Use system Prosody"
system_prosody_description: |
Warning: don't check this settings if you are not sure of what you are doing.<br>
By checking this settings, your Peertube will use the Prosody server that comes with your system,
and not the embeded AppImage.<br>
Only use this if you encounter problems with the embedded Prosody.
disable_websocket_label: "Disable Websocket"
disable_websocket_description: |
With Peertube &gt;= 5.0.0, this plugin try to use Websocket connection for chatting.
If the user's browser or connection is not compatible, the browser will automatically fallback on the BOSH protocol.
<br>
But in rare case, this can fail. For example if you have a reverse proxy in front of Peertube that does not
allow Websocket connection for plugins.
In this case, you can check this settings to disable Websocket connections.
prosody_port_label: "Prosody port"
prosody_port_description: |
The port that will be used by the Prosody server.<br>
Change it if this port is already in use on your server.<br>
You can close this port on your firewall, it will not be accessed from the outer world.<br>
Note: this might change in a near feature, as it is planned to add feature to activate external connections.
prosody_peertube_uri_label: "Peertube url for API calls"
prosody_peertube_uri_description: |
Please let this settings empty if you don't know what you are doing.<br>
In some rare case, Prosody can't call Peertube's API from its public URI.
You can use this field to customise Peertube's URI for Prosody modules
(for example with «http://localhost:9000» or «http://127.0.0.1:9000»).
prosody_muc_log_by_default_label: "Log rooms content by default"
prosody_muc_log_by_default_description: |
If checked, room contents will be saved by default.
Any user that join a room will see what was written before he joins.<br>
Please note that it is always possible to enable/disable the content
archiving for a specific room, by editing its properties.
prosody_muc_expiration_label: "Room logs expiration"
prosody_muc_expiration_description: |
You can choose here how long the chatting room's content is kept by the server. The value can be:
<ul>
<li><b>60</b>: the content will be saved for 60 <b>seconds</b>. You can replace 60 by any integer value.</li>
<li><b>1d</b>: the content will be saved for 1 <b>day</b>. You can replace 1 by any integer value.</li>
<li><b>1w</b>: the content will be saved for 1 <b>week</b>. You can replace 1 by any integer value.</li>
<li><b>1m</b>: the content will be saved for 1 <b>month</b>. You can replace 1 by any integer value.</li>
<li><b>1y</b>: the content will be saved for 1 <b>year</b>. You can replace 1 by any integer value.</li>
<li><b>never</b>: the content will never expire, and will be kept forever.</li>
</ul>
prosody_c2s_label: "Enable client to server connections"
prosody_c2s_description: |
Enable XMPP clients to connect to the builtin Prosody server.<br>
This option alone only allows connections from localhost clients.
prosody_c2s_port_label: "Prosody client to server port"
prosody_c2s_port_description: |
The port that will be used by the c2s module of the builtin Prosody server.<br>
XMPP clients shall use this port to connect.<br>
Change it if this port is already in use on your server.<br>
You can keep this port closed on your firewall for now, it will not be accessed from the outer world.<br>
Note: this might change in a near feature, as it is planned to add feature to activate external connections.
prosody_components_label: "Enable custom Prosody external components"
prosody_components_description: |
Enable the use of external XMPP components.<br>
This option alone only allows connections from localhost.<br>
This feature can for example be used to connect some bots to the chatting rooms.
prosody_components_port_label: "Prosody external components port"
prosody_components_port_description: |
The port that will be used by XMPP components to connect to the Prosody server.<br>
Change it if this port is already in use on your server.<br>
You can keep this port closed on your firewall for now, it will not be accessed from the outer world.<br>
Note: this might change in a near feature, as it is planned to add feature to activate external connections.
prosody_components_list_label: "External components"
prosody_components_list_description: |
The external components to declare:
<ul>
<li>One per line.</li>
<li>Use the format «component_name:component_secret» (spaces will be trimmed).</li>
<li>
You can add comments: everything after the # character will be stripped off,
and empty lines ignored.
</li>
<li>The name can only contain latin alphanumeric characters and dots.</li>
<li>
If the name contains only alphanumeric characters, it will be suffixed with the XMPP domain.
For exemple «bridge» will become «bridge.your_domain.tld».
You can also specify a full domain name, but you have to make sure to configure your DNS correctly.
</li>
<li>Only use alphanumeric characters in the secret passphrase (use at least 15 characters).</li>
</ul>

204
languages/settings/fr.yml Normal file
View File

@ -0,0 +1,204 @@
important_note_title: "<h3>Note importante</h3>"
important_note_text: |
Vous pouvez trouver la documentation du plugin ici:
<a href="https://johnxlivingston.github.io/peertube-plugin-livechat/fr/" target="_blank">
Documentation du Plugin Peertube Livechat
</a>.
diagnostic: |
Avant de demander de l'aide, merci d'utiliser l'outils de diagnostic:
<a class="peertube-plugin-livechat-launch-diagnostic">Lancer le diagnostique</a>
(si ce bouton n'ouvre pas une nouvelle fenêtre, merci d'essayer de raffraichir la page).
chat_title: "<h3>Tchat</h3>"
list_rooms_label: "Lister les salons de tchat existants"
list_rooms_description: |
<a class="peertube-plugin-livechat-prosody-list-rooms-btn">Lister les salons</a>
chat_behaviour_description: "<h3>Comportement du tchat</h3>"
room_type_label: "Type de salon"
room_type_description: "Vous pouvez choisir d'avoir des salons séparés pour chaque vidéo, ou de les grouper par chaîne."
room_type_option_video: "Chaque video a son propre salon de discussion"
room_type_option_channel: "Les salons sont regroupés par chaîne"
auto_display_label: "Ouvrir automatiquement le tchat"
auto_display_description: "Quand on regarde une vidéo, le tchat va s'ouvrir automatiquement."
open_blank_label: "Montrer le bouton «ouvrir dans une nouvelle fenêtre»"
open_blank_description: "Il y aura un bouton pour ouvrir le tchat dans une nouvelle fenêtre."
share_url_label: "Montrer le bouton «partager le lien du salon»"
share_url_description: "Il y aura un bouton permettant de partager le lien vers le tchat (peut par exemple être utilisé pour l'intégration dans OBS)."
share_url_option_nobody: "Ne pas le montrer"
share_url_option_everyone: "Le montrer à tout le monde"
share_url_option_owner: "Le montrer au proriétaire de la vidéo"
share_url_option_owner_moderators: "Le montrer au propriétaire de la vidéo, et aux modérateur⋅rices de l'instance"
per_live_video_label: "Les utilisateur⋅rices peuvent activer le tchat pour leurs directs"
per_live_video_description: "Si coché, il y aura pour tous les directs une case à cocher dans les propriétés qui permettra d'activer/désactiver le tchat."
per_live_video_warning_description: |
<span class="peertube-plugin-livechat-warning">
Vous avez activé le paramètre «Les utilisateur⋅rices peuvent activer le tchat pour leurs directs».
C'est redondant avec «Activer le tchat pour tous les directs».
</span>
all_lives_label: "Activer le tchat pour tous les directs"
all_lives_description: "Si coché, il y aura un tchat pour tous les directs."
all_non_lives_label: "Activer le tchat pour toutes les vidéos «non-direct»"
all_non_lives_description: "Si coché, il y aura un tchat pour toutes les vidéos qui ne sont pas des directs."
videos_list_label: "Activer le tchat pour ces vidéos"
videos_list_description: |
Mettez ici les UUIDs des vidéos pour lequelles vous voulez forcer l'activation
du tchat.
Cela peut être des directs, ou non.
Un UUID par ligne. <br />
Vous pouvez ajouter des commentaires: tout ce qui se trouve après le caractère #
sera retiré, et les lignes vides ignorées. <br />
N'ajoutez pas de vidéos privées, les UUIDs fuiteraient.
no_anonymous_label: "Masque les tchats pour les utilisateur⋅rices anonymes"
no_anonymous_description: "Si coché, les utilisteur⋅rices non connecté⋅es ne verront pas les tchats."
theming_advanced_description: "<h3>Personnalisation des thèmes</h3>"
converse_theme_label: "Thème ConverseJS"
converse_theme_description: "Merci de choisir le thème ConverseJS que vous voulez utiliser."
converse_theme_option_peertube: "Thème Peertube"
converse_theme_option_default: "Thème par défaut de ConverseJS"
converse_theme_option_concord: "Thème concord de ConverseJS"
autocolors_label: "Détection automatique des couleurs"
autocolors_description: |
Essaie de détecter automatiquement les couleurs du thème courant de l'utilisateur⋅rice.
<br>
Quand ce paramètre est activé, le plugin essaie de détecter automatiquement les
couleurs à appliquer au thème du tchat.
<br>
Si cela ne fonctionne pas correctement pour certains de vos thèmes Peertube,
vous pouvez désactiver cette option.
Vous pouvez rapporter les bugs sur le <a href="https://github.com/JohnXLivingston/peertube-plugin-livechat/issues" target="_blank">
gestionnaire de ticket
</a>. N'oubliez pas de préciser pour quel thème cela ne fonctionne pas.
chat_style_label: "Attribut de style de l'iframe du tchat"
chat_style_description: |
Styles additionnels à appliquer sur l'iframe du tchat.<br>
Exemple: height:400px;
prosody_advanced_description: "<h3>Paramètres avancés du serveur de tchat</h3>"
help_builtin_prosody_label: "Serveur Prosody"
help_builtin_prosody_description: |
Ce plugin utilise le serveur XMPP Prosody pour gérer les salons de discussion.<br>
Ce plugin inclu une AppImage de Prosody, qui va être utilisée pour faire tourner le service.
system_prosody_label: "Utiliser le serveur Prosody installé sur le système"
system_prosody_description: |
Attention: ne cocher pas ce paramètre si vous n'êtes pas sûr de ce que vous faites.<br>
En cochant ce paramètre, Peertube va utiliser l'exécutable Prosody fourni
par le système, et non l'AppImage intégrée.<br>
N'utiliser cette option que si vous rencontrez des problèmes pour utiliser l'AppImage intégrée.
disable_websocket_label: "Désactiver Websocket"
disable_websocket_description: |
Avec Peertube &gt;= 5.0.0, ce plugin va essayer d'utiliser Websocket pour les connections au tchat.
Si le navigateur de l'utilisateur⋅rice ou sa connection n'est pas compatible, le navigateur va
automatiquement passer au protocole BOSH.
<br>
Mais dans de rare cas, ça pourrait échouer. Par exemple si vous avez un reverse proxy devant votre Peertube
qui ne permettrait pas les connection Websocket.
Dans ce cas, vous pouvez cocher cette option pour désactiver les connections Websocket.
prosody_port_label: "Port Prosody"
prosody_port_description: |
Le port qui va être utilisé par le serveur Prosody.<br>
Changer le si ce port est déjà utilisé sur votre serveur.<br>
Vous pouvez fermer ce port sur votre pare-feu, il ne sera pas accéder par le monde extérieur.<br>
Note: cela pourrait changer dans un futur proche, car il est prévu d'ajouter des paramètres pour autoriser les connections externes.
prosody_peertube_uri_label: "Url Peertube pour les appels d'API"
prosody_peertube_uri_description: |
Merci de ne pas toucher à ce paramètre si vous ne savez pas ce que vous faites.<br>
Dans de rare cas, le serveur Prosody ne peut appeler l'API de Peertube en utilisant l'url publique.
Vous pouvez utiliser ce paramètre pour personnaliser l'url que les modules Prosody utiliseront pour
les API Peertube (par exemple en mettant «http://localhost:9000» ou «http://127.0.0.1:9000»).
prosody_muc_log_by_default_label: "Enregistrer les salons par défaut"
prosody_muc_log_by_default_description: |
Si coché, le contenu des salons sera enregistré par défaut.
Quand un⋅e utilisateur⋅rice rejoint un salon, iel pourra voir ce qui a été dit avant.
<br>
À noter qu'il est toujours possible d'activer/désactiver cette fonctionnalité
pour un salon spécifique, en changeant ses paramètres.
prosody_muc_expiration_label: "Expiration des journaux de salon"
prosody_muc_expiration_description: |
Vous pouvez choisir combien de temps le contenu des salons est gardé sur le serveur.
La valeur peut être:
<ul>
<li><b>60</b>: le contenu sera sauvegardé pour 60 <b>secondes</b>. Vous pouvez remplacer 60 par n'importe quelle valeur entière.</li>
<li><b>1d</b>: le contenu sera sauvegardé pour 1 <b>jour</b>. Vous pouvez remplacer 1 par n'importe quelle valeur entière.</li>
<li><b>1w</b>: le contenu sera sauvegardé pour 1 <b>semaine</b>. Vous pouvez remplacer 1 par n'importe quelle valeur entière.</li>
<li><b>1m</b>: le contenu sera sauvegardé pour 1 <b>mois</b>. Vous pouvez remplacer 1 par n'importe quelle valeur entière.</li>
<li><b>1y</b>: le contenu sera sauvegardé pour 1 <b>année</b>. Vous pouvez remplacer 1 par n'importe quelle valeur entière.</li>
<li><b>never</b>: le contenu ne sera jamais effacé.</li>
</ul>
prosody_c2s_label: "Activer les connections client vers serveur"
prosody_c2s_description: |
Autoriser les clients XMPP à se connecter au serveur Prosody.<br>
Cette option seule n'autorise que les connections de clients sur le localhost.
prosody_c2s_port_label: "Port Prosody client vers serveur"
prosody_c2s_port_description: |
Le port à utiliser pour les connections XMPP c2s (client to server).<br>
Les clients XMPP devront utiliser ce port pour se connecter.<br>
Changez ce port si le port est déjà utilisé sur votre serveur.<br>
Pour l'instant, vous pouvez garder ce port fermé sur votre pare-feu,
il ne sera pas accessible du monde extérieur (Prosody n'écoute que sur localhost).<br>
Note: cela pourrait changer dans un futur proche, car il est prévu d'ajouter des paramètres pour autoriser les connections externes.
prosody_components_label: "Activer les composants externe personnalisés Prosody"
prosody_components_description: |
Active l'utilisation des «External XMPP components».<br>
Cette option seule n'autorise que les connections depuis localhost.<br>
Cette fonctionnalité peut par exemple être utilisée pour connecter des bots aux salons.
prosody_components_port_label: "Port pour les composants externe Prosody"
prosody_components_port_description: |
Le port à utiliser pour les XMPP components.<br>
Changez ce port s'il est déjà utilisé sur votre serveur.<br>
Pour l'instant, vous pouvez garder ce port fermé sur votre pare-feu,
il ne sera pas accessible du monde extérieur (Prosody n'écoute que sur localhost).<br>
Note: cela pourrait changer dans un futur proche, car il est prévu d'ajouter des paramètres pour autoriser les connections externes.
prosody_components_list_label: "Composants externes"
prosody_components_list_description: |
Les composants externes à déclarer :
<ul>
<li>Un par ligne.</li>
<li>Utilisez le format «nom_du_composant:passphrase_secrete» (les espaces seront retirés).</li>
<li>
Vous pouvez ajouter des commentaires: tout ce qui se trouve après un caractère # sera retiré,
et les lignes vides ignorées.
</li>
<li>Le nom ne peut contenir que des caractères alphanumériques latins et des points.</li>
<li>
Si le nom ne contient que des caractères alphanumériques, il sera suffixé avec
le domaine XMPP.
Par exemple «bridge» deviendra «bridge.votre_domaine.tld».
Vous pouvez aussi spécifier un nom de domaine complet,
mais vous devrez vous assurer que votre configuration DNS est
correctement paramétrée.
</li>
<li>
N'utilisez que des caractères alphanumériques dans la passphrase secrète
(utilisez au moins 15 caractères).
</li>
</ul>

34
package-lock.json generated
View File

@ -42,7 +42,8 @@
"stylelint-config-recommended-scss": "^5.0.1",
"stylelint-config-standard-scss": "^2.0.1",
"svgo": "^2.8.0",
"typescript": "^4.3.5"
"typescript": "^4.3.5",
"yaml": "^2.2.1"
},
"engines": {
"npm": ">=7"
@ -4690,6 +4691,15 @@
"node": ">=10"
}
},
"node_modules/cosmiconfig/node_modules/yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"dev": true,
"engines": {
"node": ">= 6"
}
},
"node_modules/cron-parser": {
"version": "4.7.0",
"resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-4.7.0.tgz",
@ -11504,12 +11514,12 @@
"dev": true
},
"node_modules/yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz",
"integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==",
"dev": true,
"engines": {
"node": ">= 6"
"node": ">= 14"
}
}
},
@ -15332,6 +15342,14 @@
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
},
"dependencies": {
"yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"dev": true
}
}
},
"cron-parser": {
@ -20483,9 +20501,9 @@
"dev": true
},
"yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz",
"integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==",
"dev": true
}
}

View File

@ -65,7 +65,8 @@
"stylelint-config-recommended-scss": "^5.0.1",
"stylelint-config-standard-scss": "^2.0.1",
"svgo": "^2.8.0",
"typescript": "^4.3.5"
"typescript": "^4.3.5",
"yaml": "^2.2.1"
},
"engine": {
"peertube": ">=4.2.0"
@ -94,7 +95,8 @@
"build:serverconverse": "mkdir -p dist/server/conversejs && cp conversejs/index.html dist/server/conversejs/",
"build:prosodymodules": "mkdir -p dist/server/prosody-modules && cp -r prosody-modules/* dist/server/prosody-modules/",
"build:styles": "sass assets/styles:dist/assets/styles",
"build": "npm-run-all -s clean:light check:client:tsc -p build:converse build:prosody build:images build:avatars build:client build:server build:serverconverse build:prosodymodules build:styles",
"build:languages": "node ./build-languages.js",
"build": "npm-run-all -s clean:light check:client:tsc -p build:converse build:prosody build:images build:avatars build:client build:server build:languages build:serverconverse build:prosodymodules build:styles",
"lint": "npm-run-all -s lint:script lint:styles",
"lint:script": "npx eslint --ext .js --ext .ts .",
"lint:styles": "stylelint 'conversejs/**/*.scss' 'assets/styles/**/*.css'",
@ -108,14 +110,14 @@
"settings": "dist/client/settings"
},
"translations": {
"ca-ES": "./languages/ca.json",
"fr-FR": "./languages/fr.json",
"eo": "./languages/eo.json",
"eu-ES": "./languages/eu.json",
"oc": "./languages/oc.json",
"pl-PL": "./languages/pl.json",
"de-DE": "./languages/de.json",
"it-IT": "./languages/it.json",
"ja-JP": "./languages/ja.json"
"ca-ES": "./dist/languages/ca.json",
"fr-FR": "./dist/languages/fr.json",
"eo": "./dist/languages/eo.json",
"eu-ES": "./dist/languages/eu.json",
"oc": "./dist/languages/oc.json",
"pl-PL": "./dist/languages/pl.json",
"de-DE": "./dist/languages/de.json",
"it-IT": "./dist/languages/it.json",
"ja-JP": "./dist/languages/ja.json"
}
}

View File

@ -1,30 +1,65 @@
import type { RegisterServerOptions } from '@peertube/peertube-types'
import { ensureProsodyRunning } from './prosody/ctl'
import type { ConverseJSTheme } from '../../shared/lib/types'
import { existsSync, promises as fsPromises } from 'fs'
import { resolve } from 'path'
function initSettings (options: RegisterServerOptions): void {
const locContent: Map<string, string> = new Map<string, string>()
/**
* Currently, the Peertube plugin system assumes that settings strings
* are localized in english, and will be translated on front-end.
* This system make it hard to have complex strings (with html, newlines, ...).
* See https://github.com/Chocobozzz/PeerTube/issues/4523
*
* Waiting for a better solution, we implemented a custom solution:
* - We are using keys to identify setting strings
* - the `loc` function gets the english segment for the key
* - the build-languages.js script builds all needed files.
* @param key The key to translate
*/
function loc (key: string): string {
return locContent.get(key) ?? key
}
async function loadLoc (): Promise<void> {
const filePath = resolve(__dirname, '..', '..', 'languages', 'settings.reference.json')
if (!existsSync(filePath)) {
throw new Error(`File ${filePath} missing, can't load plugin settings`)
}
const content = await fsPromises.readFile(filePath, 'utf8')
const json = JSON.parse(content ?? '{}')
if (typeof json !== 'object') {
throw new Error(`File ${filePath} invalid, can't load plugin settings`)
}
for (const k in json) {
const v = json[k]
if (typeof v === 'string') {
locContent.set(k, v)
}
}
}
async function initSettings (options: RegisterServerOptions): Promise<void> {
const { peertubeHelpers, registerSetting, settingsManager } = options
await loadLoc()
// ********** IMPORTANT NOTES
registerSetting({
type: 'html',
private: true,
descriptionHTML: '<h3>Important notes</h3>'
descriptionHTML: loc('important_note_title')
})
registerSetting({
type: 'html',
private: true,
descriptionHTML: `You can find the plugin documentation here:
<a href="https://github.com/JohnXLivingston/peertube-plugin-livechat/blob/main/README.md" target="_blank">
Peertube Plugin Livechat documentation
</a>.`
descriptionHTML: loc('important_note_text')
})
registerSetting({
type: 'html',
private: true,
descriptionHTML: `Before asking for help, please use the diagnostic tool:
<a class="peertube-plugin-livechat-launch-diagnostic">Launch diagnostic</a>
(if this button is not opening a new window, please try to refresh the page).`
descriptionHTML: loc('diagnostic')
})
if (process.arch !== 'x64' && process.arch !== 'x86_64') {
@ -32,6 +67,8 @@ function initSettings (options: RegisterServerOptions): void {
name: 'prosody-arch-warning',
type: 'html',
private: true,
// Note: the following text as a variable in it.
// Not translating it: it should be very rare.
descriptionHTML: `<span class="peertube-plugin-livechat-warning">
It seems that your are using a ${process.arch} CPU,
which is not compatible with the plugin.
@ -50,13 +87,13 @@ Please read
registerSetting({
type: 'html',
private: true,
descriptionHTML: '<h3>Chat</h3>'
descriptionHTML: loc('chat_title')
})
registerSetting({
name: 'prosody-list-rooms',
label: 'List existing rooms',
label: loc('list_rooms_label'),
type: 'html',
descriptionHTML: '<a class="peertube-plugin-livechat-prosody-list-rooms-btn">List rooms</a>',
descriptionHTML: loc('list_rooms_description'),
private: true
})
@ -64,102 +101,94 @@ Please read
registerSetting({
type: 'html',
private: true,
descriptionHTML: '<h3>Chat behaviour</h3>'
descriptionHTML: loc('chat_behaviour_description')
})
registerSetting({
name: 'prosody-room-type',
label: 'Room type',
label: loc('room_type_label'),
type: 'select',
descriptionHTML: 'You can choose here to have separate rooms for each video, or to group them by channel.',
descriptionHTML: loc('room_type_description'),
private: false,
default: 'video',
options: [
{ value: 'video', label: 'Each video has its own webchat room' },
{ value: 'channel', label: 'Webchat rooms are grouped by channel' }
{ value: 'video', label: loc('room_type_option_video') },
{ value: 'channel', label: loc('room_type_option_channel') }
]
})
registerSetting({
name: 'chat-auto-display',
label: 'Automatically open the chat',
descriptionHTML: 'When watching a video, the chatbox will automatically open',
label: loc('auto_display_label'),
descriptionHTML: loc('auto_display_description'),
type: 'input-checkbox',
default: true,
private: false
})
registerSetting({
name: 'chat-open-blank',
label: 'Show the «open in new window» button',
descriptionHTML: 'There will be a button for opening the web chat in a new window.',
label: loc('open_blank_label'),
descriptionHTML: loc('open_blank_description'),
private: false,
type: 'input-checkbox',
default: true
})
registerSetting({
name: 'chat-share-url',
label: 'Show the «share chat link» button',
descriptionHTML: 'There will be a button for sharing a chat url (could be used to intregrated in OBS for example).',
label: loc('share_url_label'),
descriptionHTML: loc('share_url_description'),
private: false,
type: 'select',
default: 'owner',
options: [
{ label: 'Show for nobody', value: 'nobody' },
{ label: 'Show for everyone', value: 'everyone' },
{ label: 'Show for the video owner', value: 'owner' },
{ label: 'Show for the video owner and instance\'s moderators', value: 'owner+moderators' }
{ value: 'nobody', label: loc('share_url_option_nobody') },
{ value: 'everyone', label: loc('share_url_option_everyone') },
{ value: 'owner', label: loc('share_url_option_owner') },
{ value: 'owner+moderators', label: loc('share_url_option_owner_moderators') }
]
})
registerSetting({
name: 'chat-per-live-video',
label: 'Users can activate the chat for their lives',
label: loc('per_live_video_label'),
type: 'input-checkbox',
default: true,
descriptionHTML: 'If checked, all live videos will have a checkbox in their properties for enabling the web chat.',
descriptionHTML: loc('per_live_video_description'),
private: false
})
registerSetting({
name: 'chat-per-live-video-warning',
type: 'html',
private: true,
descriptionHTML:
`<span class="peertube-plugin-livechat-warning">
You have enabled the setting «Users can activate the chat for their lives».
It is redundant with the «Activate chat for all lives» setting.
</span>`
descriptionHTML: loc('per_live_video_warning_description')
})
registerSetting({
name: 'chat-all-lives',
label: 'Activate chat for all lives',
label: loc('all_lives_label'),
type: 'input-checkbox',
default: false,
descriptionHTML: 'If checked, the chat will be enabled for all lives.',
descriptionHTML: loc('all_lives_description'),
private: false
})
registerSetting({
name: 'chat-all-non-lives',
label: 'Activate chat for all non-lives',
label: loc('all_non_lives_label'),
type: 'input-checkbox',
default: false,
descriptionHTML: 'If checked, the chat will be enable for all video that are not lives.',
descriptionHTML: loc('all_non_lives_description'),
private: false
})
registerSetting({
name: 'chat-videos-list',
label: 'Activate chat for these videos',
label: loc('videos_list_label'),
type: 'input-textarea',
default: '',
descriptionHTML:
`Videos UUIDs for which we want a web chat.
Can be non-live videos. One per line. <br />
You can add comments: everything after the # character will be stripped off, and empty lines ignored.<br />
Don't add private videos, the UUIDs will be send to frontend.`,
descriptionHTML: loc('videos_list_description'),
private: false
})
registerSetting({
name: 'chat-no-anonymous',
label: 'Hide the chat for anonymous users',
label: loc('no_anonymous_label'),
type: 'input-checkbox',
default: false,
descriptionHTML: 'If checked, anonymous Peertube users won\'t see the chat.',
descriptionHTML: loc('no_anonymous_description'),
private: false
})
@ -168,47 +197,38 @@ Don't add private videos, the UUIDs will be send to frontend.`,
name: 'theming-advanced',
type: 'html',
private: true,
descriptionHTML: '<h3>Theming</h3>'
descriptionHTML: loc('theming_advanced_description')
})
registerSetting({
name: 'converse-theme',
label: 'ConverseJS theme',
label: loc('converse_theme_label'),
type: 'select',
default: 'peertube' as ConverseJSTheme,
private: false,
options: [
{ value: 'peertube', label: 'Peertube theme' },
{ value: 'default', label: 'Default ConverseJS theme' },
{ value: 'concord', label: 'ConverseJS concord theme' }
{ value: 'peertube', label: loc('peertube') },
{ value: 'default', label: loc('default') },
{ value: 'concord', label: loc('concord') }
] as Array<{value: ConverseJSTheme, label: string}>,
descriptionHTML: 'Please choose the converseJS theme you want to use.'
descriptionHTML: loc('converse_theme_description')
})
registerSetting({
name: 'converse-autocolors',
label: 'Automatic color detection',
label: loc('autocolors_label'),
type: 'input-checkbox',
default: true,
private: false,
descriptionHTML:
`Try to auto detect colors from user's current theme.<br>
When this settings is enabled, the plugin tries to auto-detect colors to apply to the chat theme.<br>
If this is not correctly working for some of your Peertube theme, you can disable this option.
You can report the bug on the official
<a href="https://github.com/JohnXLivingston/peertube-plugin-livechat/issues" target="_blank">
issue tracker
</a>. Don't forget to specify which theme is not working.`
descriptionHTML: loc('autocolors_description')
})
registerSetting({
name: 'chat-style',
label: 'Webchat iframe style attribute',
label: loc('chat_style_label'),
type: 'input-textarea',
default: '',
descriptionHTML:
`Additional styles to be added on the iframe style attribute. <br>
Example: height:400px;`,
descriptionHTML: loc('chat_style_description'),
private: false
})
@ -217,26 +237,22 @@ Example: height:400px;`,
name: 'prosody-advanced',
type: 'html',
private: true,
descriptionHTML: '<h3>Chat server advanced settings</h3>'
descriptionHTML: loc('prosody_advanced_description')
})
registerSetting({
name: 'chat-help-builtin-prosody',
type: 'html',
label: 'Prosody server',
descriptionHTML: `This plugin uses the Prosody XMPP server to handle chat rooms.<br>
This plugin comes with a Prosody AppImage, that will be used to run the service.`,
label: loc('help_builtin_prosody_label'),
descriptionHTML: loc('help_builtin_prosody_description'),
private: true
})
registerSetting({
name: 'use-system-prosody',
type: 'input-checkbox',
label: 'Use system Prosody',
descriptionHTML: `Warning: don't check this settings if you are not sure of what you are doing.<br>
By checking this settings, your Peertube will use the Prosody server that comes with your system,
and not the embeded AppImage.<br>
Only use this if you encounter problems with the embedded Prosody.`,
label: loc('system_prosody_label'),
descriptionHTML: loc('system_prosody_description'),
private: true,
default: false
})
@ -244,142 +260,91 @@ Only use this if you encounter problems with the embedded Prosody.`,
registerSetting({
name: 'disable-websocket',
type: 'input-checkbox',
label: 'Disable Websocket',
descriptionHTML: `With Peertube &gt;= 5.0.0, this plugin try to use Websocket connection for chatting.
If the user's browser or connection is not compatible, the browser will automatically fallback on the BOSH protocol.
<br>
But in rare case, this can fail. For example if you have a reverse proxy in front of Peertube that does not
allow Websocket connection for plugins.
In this case, you can check this settings to disable Websocket connections.`,
label: loc('disable_websocket_label'),
descriptionHTML: loc('disable_websocket_description'),
private: true,
default: false
})
registerSetting({
name: 'prosody-port',
label: 'Prosody port',
label: loc('prosody_port_label'),
type: 'input',
default: '52800',
private: true,
descriptionHTML:
`The port that will be used by the builtin Prosody server.<br>
Change it if this port is already in use on your server.<br>
You can close this port on your firewall, it will not be accessed from the outer world.`
descriptionHTML: loc('prosody_port_description')
})
registerSetting({
name: 'prosody-peertube-uri',
label: 'Peertube url for API calls',
label: loc('prosody_peertube_uri_label'),
type: 'input',
default: '',
private: true,
descriptionHTML:
`Please let this settings empty if you don't know what you are doing.<br>
In some rare case, Prosody can't call Peertube's API from its public URI.
You can use this field to customise Peertube's URI for Prosody modules
(for example with «http://localhost:9000» or «http://127.0.0.1:9000»).`
descriptionHTML: loc('prosody_peertube_uri_description')
})
registerSetting({
name: 'prosody-muc-log-by-default',
label: 'Log rooms content by default',
label: loc('prosody_muc_log_by_default_label'),
type: 'input-checkbox',
default: true,
private: true,
descriptionHTML:
`If checked, room contents will be saved by default.
Any user that join a room will see what was written before he joins.<br>
Please note that it is always possible to enable/disable the content
archiving for a specific room, by editing its properties.
`
descriptionHTML: loc('prosody_muc_log_by_default_description')
})
registerSetting({
name: 'prosody-muc-expiration',
label: 'Room logs expiration',
label: loc('prosody_muc_expiration_label'),
type: 'input',
default: '1w',
private: true,
descriptionHTML:
`You can choose here how long the chatting room's content is kept by the server. The value can be:
<ul>
<li><b>60</b>: the content will be saved for 60 <b>seconds</b>. You can replace 60 by any integer value.</li>
<li><b>1d</b>: the content will be saved for 1 <b>day</b>. You can replace 1 by any integer value.</li>
<li><b>1w</b>: the content will be saved for 1 <b>week</b>. You can replace 1 by any integer value.</li>
<li><b>1m</b>: the content will be saved for 1 <b>month</b>. You can replace 1 by any integer value.</li>
<li><b>1y</b>: the content will be saved for 1 <b>year</b>. You can replace 1 by any integer value.</li>
<li><b>never</b>: the content will never expire, and will be kept forever.</li>
</ul>`
descriptionHTML: loc('prosody_muc_expiration_description')
})
registerSetting({
name: 'prosody-c2s',
label: 'Enable client to server connections',
label: loc('prosody_c2s_label'),
type: 'input-checkbox',
default: false,
private: true,
descriptionHTML:
`Enable XMPP clients to connect to the builtin Prosody server.<br>
This option alone only allows connections from localhost clients.`
descriptionHTML: loc('prosody_c2s_description')
})
registerSetting({
name: 'prosody-c2s-port',
label: 'Prosody client to server port',
label: loc('prosody_c2s_port_label'),
type: 'input',
default: '52822',
private: true,
descriptionHTML:
`The port that will be used by the c2s module of the builtin Prosody server.<br>
XMPP clients shall use this port to connect.<br>
Change it if this port is already in use on your server.<br>
You can keep this port closed on your firewall for now, it will not be accessed from the outer world.`
descriptionHTML: loc('prosody_c2s_port_description')
})
registerSetting({
name: 'prosody-components',
label: 'Enable custom Prosody external components',
label: loc('prosody_components_label'),
type: 'input-checkbox',
default: false,
private: true,
descriptionHTML:
`Enable the use of external XMPP components.<br>
This option alone only allows connections from localhost.<br>
This feature can for example be used to connect some bots to the chatting rooms.`
descriptionHTML: loc('prosody_components_description')
})
registerSetting({
name: 'prosody-components-port',
label: 'Prosody external components port',
label: loc('prosody_components_port_label'),
type: 'input',
default: '53470',
private: true,
descriptionHTML:
`The port that will be used by XMPP components to connect to the Prosody server.<br>
Change it if this port is already in use on your server.<br>
You can keep this port closed on your firewall for now, it will not be accessed from the outer world.`
descriptionHTML: loc('prosody_components_port_description')
})
registerSetting({
name: 'prosody-components-list',
label: 'External components',
label: loc('prosody_components_list_label'),
type: 'input-textarea',
default: '',
private: true,
descriptionHTML:
`The external components to create:
<ul>
<li>One per line.</li>
<li>Use the format «component_name:component_secret» (spaces will be trimmed)</li>
<li>You can add comments: everything after the # character will be stripped off, and empty lines ignored</li>
<li>The name can only contain alphanumeric characters and dots</li>
<li>
If the name contains only alphanumeric characters, it will be suffixed with the XMPP domain.
For exemple «bridge» will become «bridge.your_domain.tld».
You can also specify a full domain name, but you have to make sure to configure your DNS correctly.
</li>
<li>Only use alphanumeric characters in the secret passphrase (use at least 15 characters).</li>
</ul>`
descriptionHTML: loc('prosody_components_list_description')
})
// ********** settings changes management

View File

@ -1,6 +1,6 @@
+++
title="Einstellungen"
description="Plugin Peertube Livechat settings"
description="Plugin Peertube Livechat Einstellungen"
weight=10
chapter=false
+++
@ -13,14 +13,14 @@ Dieser Abschnitt beschreibt die Einstellungsseite des Plugins.
## List existing rooms (Bestehende Räume auflisten)
Wenn der «List rooms» Knopf gedrückt wird, werden alle bestehenden Chaträume aufgelistet.
Wenn der «Bestehende Räume auflisten» («List rooms») Knopf gedrückt wird, werden alle bestehenden Chaträume aufgelistet.
Sie können die Chaträume damit finden und moderieren.
## Chat behaviour (Chatverhalten)
### Room type (Raumtyp)
Sie können hier auswählen, ob seperate Räume für jedes Video oder nach Kanal gruppiert erstellt werden.
Sie können hier wählen, ob Sie für jedes Video einen eigenen Raum haben möchten oder ob Sie sie nach Kanälen gruppieren möchten.
### Automatically open the chat (Chat automatisch öffnen)

View File

@ -9,7 +9,7 @@ Wenn Sie neue Funktionswünsche, Fehler (Bugs) oder Schwierigkeiten bei der Einr
Einen Einblick in die Roadmap für kommende Funktionen finden Sie hier:
- [github project](https://github.com/users/JohnXLivingston/projects/1).
- [milestones on github](https://github.com/JohnXLivingston/peertube-plugin-livechat/milestones).
- [Github Project](https://github.com/users/JohnXLivingston/projects/1).
- [Meilensteine auf Github](https://github.com/JohnXLivingston/peertube-plugin-livechat/milestones).
Wenn Sie ein Webdesigner oder ein ConverseJS/Prosody/XMPP-Experte sind und helfen wollen, dieses Plugin zu verbessern, sind Sie gerne willkommen.