Files
webspeak3/web/src/i18n.tsx
T
MoepchiandClaude Sonnet 5 330ecccadb Add kick and ban to the client context menu
Wires up "Aus dem Channel kicken", "Vom Server kicken", and "Bannen"
(previously disabled placeholders). Kick uses tsclientlib's typed
Client::kick() builder; ban has no typed wrapper so it's built as a
raw "banclient" command (same OutCommand::write_arg approach used for
the connection-info requests). Both use send_with_result() so a
missing-permission rejection surfaces as a visible error.

"Channel-Gruppe zuweisen"/"Server-Gruppe zuweisen" remain disabled -
they need the server's group list threaded through first, left for a
follow-up.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-05 11:21:52 +02:00

782 lines
32 KiB
TypeScript

import { createContext, useContext, useEffect, useState, type ReactNode } from "react";
export type Lang = "de" | "en";
export type LangPref = "auto" | Lang;
const LANGUAGE_KEY = "webspeak3:language";
// Keyed flat dictionary. Every user-facing string in the app should have an
// entry here in both languages - falls back to the English string (or the
// raw key) if a translation is missing, so a partial dictionary never blanks
// out the UI.
const translations: Record<Lang, Record<string, string>> = {
de: {
"menu.connections": "Verbindungen",
"menu.connections.connect": "Verbinden",
"menu.connections.disconnectCurrent": "Aktuelle Verbindung trennen",
"menu.connections.disconnectAll": "Alle Verbindungen trennen",
"menu.favorites": "Favoriten",
"menu.favorites.add": "Zu Favoriten hinzufügen",
"menu.favorites.manage": "Favoriten verwalten",
"menu.self": "Selbst",
"menu.rights": "Rechte",
"menu.extras": "Extras",
"menu.help": "Hilfe",
"menu.extras.identities": "Identitäten",
"menu.extras.contacts": "Kontakte",
"menu.extras.collectedUrls": "Gesammelte URLs",
"menu.extras.inviteFriend": "Freund einladen",
"menu.extras.whisperLists": "Whisperlisten",
"menu.extras.whisperHistory": "Whisper Verlauf",
"menu.extras.clientLog": "Client Protokoll",
"menu.extras.banList": "Bannliste",
"menu.extras.complaintList": "Beschwerdeliste",
"menu.extras.serverQueryLogin": "ServerQuery Login",
"menu.extras.serverLog": "Server Protokoll",
"menu.extras.startRecording": "Aufnahme starten",
"menu.extras.startMultitrackRecording": "Start Multitrack Recording",
"menu.extras.stopRecording": "Aufnahme beenden",
"menu.extras.options": "Optionen",
"toolbar.setAway": "Als abwesend markieren",
"toolbar.backOnline": "Wieder online",
"toolbar.awayOptions": "Abwesenheitsoptionen",
"toolbar.whisper": "Whisper-Ziele",
"whisper.channels": "Channels",
"whisper.clients": "Clients",
"whisper.clearAll": "Alle Whisper-Ziele entfernen",
"toolbar.micEnable": "Mikrofon aktivieren",
"toolbar.micMute": "Mikrofon stummschalten",
"toolbar.micUnmute": "Mikrofon aktivieren (unmute)",
"toolbar.vadSensitivity": "Empfindlichkeit der Sprachaktivierung",
"toolbar.muteSound": "Ton stummschalten (Ausgabe stumm)",
"toolbar.unmuteSound": "Ton aktivieren (Ausgabe an)",
"toolbar.chooseOutputDevice": "Wiedergabegerät wählen",
"toolbar.toggleTheme": "Design wechseln",
"away.setGlobal": "Global abwesend setzen",
"away.setGlobalStatus": "Abwesenheit-Status global setzen",
"connect.title": "Verbinden",
"connect.serverAddress": "Server Nickname oder Adresse:",
"connect.serverPassword": "Server Passwort:",
"connect.nickname": "Nickname:",
"connect.phoneticNickname": "Phonetischer Nickname:",
"connect.identity": "Identität:",
"connect.defaultChannel": "Standard Channel:",
"connect.recordingProfile": "Aufnahmeprofil:",
"connect.channelPassword": "Channel Passwort:",
"connect.playbackProfile": "Wiedergabeprofil:",
"connect.onetimeGrant": "Einmalige Berechtigung:",
"connect.hotkeyProfile": "Hotkeyprofil:",
"connect.sendMyTeamSpeakId": "myTeamSpeak ID senden",
"connect.soundPack": "Sound Pack:",
"connect.more": "Mehr",
"connect.less": "Weniger",
"connect.connect": "Verbinden",
"connect.connecting": "Verbinde…",
"connect.newTab": "In neuem Tab",
"connect.cancel": "Abbrechen",
"collectedUrls.title": "Gesammelte URLs",
"collectedUrls.search": "Suchen:",
"collectedUrls.url": "URL",
"collectedUrls.count": "Anzahl",
"collectedUrls.lastSeen": "Zuletzt erwähnt",
"collectedUrls.mentionedBy": "Erwähnt von",
"collectedUrls.clearList": "Liste löschen",
"inviteFriend.title": "Freund einladen",
"inviteFriend.type": "Art der Einladung",
"inviteFriend.includeChannel": "Aktuellen Channel einfügen",
"inviteFriend.link": "Link",
"inviteFriend.addPermissionKey": "Berechtigungsschlüssel hinzufügen",
"inviteFriend.copyToClipboard": "In Zwischenablage kopieren",
"inviteFriend.copied": "Kopiert!",
"clientLog.title": "Client Protokoll",
"clientLog.level.critical": "Kritisch",
"clientLog.level.error": "Fehler",
"clientLog.level.warning": "Warnungen",
"clientLog.level.info": "Info",
"clientLog.level.debug": "Debug",
"clientLog.search": "Suchen:",
"clientLog.filter": "Filter:",
"clientLog.caseSensitive": "Groß-/Kleinschreibung",
"clientLog.mark": "Markieren",
"whisperHistory.title": "Whisper Verlauf - {server}",
"whisperHistory.empty": "Kein Whisper-Verlauf vorhanden.",
"whisperHistory.started": "Whispern an: {targets}",
"whisperHistory.stopped": "Whispern beendet",
"whisperHistory.clear": "Löschen",
"whisperHistory.options": "Optionen",
"whisperLists.title": "Whisperlisten",
"whisperLists.namePlaceholder": "Name der Liste",
"whisperLists.saveCurrent": "Aktuelle Auswahl speichern",
"whisperLists.itemDetail": "{channels} Channel, {clients} Clients",
"whisperLists.activate": "Aktivieren",
"whisperLists.delete": "Löschen",
"whisperLists.empty": "Keine Whisperlisten gespeichert. Wähle Whisper-Ziele aus und speichere sie hier als Liste.",
"identities.title": "Identitäten",
"identities.activate": "Aktivieren",
"identities.add": "Neue Identität",
"identities.delete": "Löschen",
"identities.newName": "Neue Identität",
"identities.generated": "Erstellt",
"identities.pending": "Wird bei der nächsten Verbindung erstellt",
"connectionInfo.clientTitle": "Verbindungsinformationen - {name}",
"connectionInfo.serverTitle": "Serververbindungsinformationen",
"connectionInfo.loading": "Wird geladen…",
"connectionInfo.unavailable": "Keine Antwort vom Server (fehlende Berechtigung?).",
"connectionInfo.ping": "Ping:",
"connectionInfo.connectedSince": "Verbunden seit:",
"connectionInfo.ip": "IP-Adresse:",
"connectionInfo.packetLoss": "Paketverlust:",
"connectionInfo.packetsSent": "Pakete gesendet:",
"connectionInfo.packetsReceived": "Pakete empfangen:",
"connectionInfo.bytesSent": "Daten gesendet:",
"connectionInfo.bytesReceived": "Daten empfangen:",
"connectionInfo.bandwidthSent": "Bandbreite gesendet:",
"connectionInfo.bandwidthReceived": "Bandbreite empfangen:",
"menu.self.recordingProfile": "Aufnahmeprofil",
"menu.self.playbackProfile": "Wiedergabeprofil",
"menu.self.hotkeyProfile": "Hotkeyprofil",
"menu.self.soundPack": "Sound Pack",
"menu.self.setAway": "Abwesend setzen",
"menu.self.enableMic": "Mikrofon aktivieren",
"menu.self.disableMic": "Mikrofon ausschalten",
"menu.self.muteOutput": "Lautsprecher/Kopfhörer ausschalten",
"menu.self.unmuteOutput": "Lautsprecher/Kopfhörer einschalten",
"menu.self.changeNickname": "Nickname ändern",
"menu.self.requestTalkPower": "Talk Power anfordern",
"menu.self.setAvatar": "Avatar setzen",
"menu.self.setPhoneticNickname": "Phonetischen Nicknamen setzen",
"menu.self.connectionInfo": "Verbindungsinformationen",
"contacts.title": "Kontakte",
"contacts.addOnlineClient": "Online-Client auswählen...",
"contacts.add": "Hinzufügen",
"contacts.remove": "Entfernen",
"contacts.empty": "Noch keine Kontakte.",
"contacts.customName": "Benutzerdefinierter Name:",
"contacts.category.acquaintance": "Bekannter",
"contacts.category.blocked": "Blockiert",
"contacts.category.friend": "Freund",
"contacts.phoneticName": "Phonetischer Name:",
"contacts.show": "Anzeige",
"contacts.ignore": "Ignorieren",
"contacts.unignore": "Nicht mehr ignorieren",
"contacts.whisper": "Whispern",
"contacts.preferences": "Voreinstellungen",
"favorites.title": "🔖 myTeamSpeak Favoriten",
"favorites.synced": "Synchronisierte Favoriten",
"favorites.notLoggedIn": "Nicht angemeldet",
"favorites.local": "Lokale Favoriten",
"favorites.unnamed": "(unbenannt)",
"favorites.bookmarkName": "Bookmark Name:",
"favorites.newFavoriteName": "Neuer Favorit",
"favorites.showServerQueryClients": "ServerQuery Clients anzeigen",
"favorites.connectOnStartup": "Beim Start verbinden",
"favorites.enableMyTeamSpeak": "Aktiviere myTeamSpeak Funktionen",
"favorites.new": "Neuer Favorit",
"favorites.newFolder": "Neuer Ordner",
"favorites.remove": "Entfernen",
"favorites.ok": "OK",
"favorites.cancel": "Abbrechen",
"favorites.apply": "Anwenden",
"away.dialog.title": "Abwesenheit-Nachricht setzen",
"away.dialog.message": "Nachricht:",
"away.dialog.template": "Vorlage:",
"away.dialog.none": "<Keine>",
"away.dialog.ok": "OK",
"away.dialog.save": "Speichern",
"away.dialog.cancel": "Abbrechen",
"options.title": "Optionen",
"options.ok": "OK",
"options.cancel": "Abbrechen",
"options.notImplemented": "Diese Einstellungen sind noch nicht implementiert.",
"options.section.anwendung": "Anwendung",
"options.section.wiedergabe": "Wiedergabe",
"options.section.aufnahme": "Aufnahme",
"options.section.design": "Design",
"options.section.erweiterungen": "Erweiterungen",
"options.section.hotkeys": "Hotkeys",
"options.section.whispern": "Whispern",
"options.section.downloads": "Downloads",
"options.section.chat": "Chat",
"options.section.sicherheit": "Sicherheit",
"options.section.nachrichten": "Nachrichten",
"options.section.meldungen": "Meldungen",
"options.section.sounds": "Sounds",
"app.title": "Anwendung",
"app.subtitle": "Allgemeine Anwendungseinstellungen",
"app.language": "Sprache",
"app.language.auto": "Systemvorgabe",
"app.language.de": "Deutsch",
"app.language.en": "English",
"playback.title": "Wiedergabe",
"playback.subtitle": "Ändern der Wiedergabeeinstellungen",
"playback.profile": "Profile",
"playback.default": "Standard",
"playback.device": "Wiedergabegerät:",
"playback.systemDefault": "System default",
"playback.quiet": "Leise",
"playback.loud": "Laut",
"playback.voiceVolume": "Sprachlautstärke",
"playback.playTestTone": "▶ Test Ton abspielen",
"playback.options": "Optionen",
"playback.autoVolume": "Automatische Lautstärkeanpassung",
"playback.ownMicClicks": "Eigener Client spielt Mikro Klicks",
"playback.otherMicClicks": "Andere Clients spielen Mikro Klicks",
"recording.title": "Aufnahme",
"recording.subtitle": "Ändern der Aufnahmeeinstellungen",
"recording.device": "Aufnahmegerät:",
"recording.activation": "Aktivierung",
"recording.pushToTalk": "Push-To-Talk",
"recording.continuous": "Dauersenden",
"recording.voiceActivation": "Automatische Spracherkennung",
"recording.testStart": "Test starten",
"recording.testStop": "Test beenden",
"recording.hangoverDelay": "Abschaltverzögerung:",
"recording.secondsUnit": "Sek",
"recording.dsp": "Digital Signal Processing",
"recording.typingAttenuation": "Typing attenuation",
"recording.echoCancellation": "Echo Dämpfung",
"recording.noiseSuppression": "Hintergrundgeräusche entfernen",
"info.address": "Adresse:",
"info.version": "Version:",
"info.license": "Lizenz:",
"info.currentClients": "Aktuelle Clients:",
"info.currentChannels": "Aktuelle Channel:",
"info.topic": "Topic:",
"info.audioCodec": "Audio Codec:",
"info.passwordProtected": "Passwort geschützt:",
"info.clients": "Clients:",
"info.yes": "Ja",
"info.no": "Nein",
"tree.notConnected": "Nicht verbunden",
"tree.clickToSelect": "Klicken zum Auswählen, Doppelklick zum Beitreten",
"tree.passwordProtected": "Passwortgeschützt",
"tree.privateChatWith": "Privater Chat mit",
"tree.poke": "Anstupsen",
"tree.channelCommander": "Channel Commander",
"tree.away": "Abwesend",
"tree.micMuted": "Mikrofon stummgeschaltet",
"tree.soundMuted": "Ton stummgeschaltet (deafened)",
"chat.server": "Server",
"chat.channel": "Channel",
"chat.notConnected": "Nicht verbunden",
"chat.messageChannel": "Nachricht an Channel...",
"chat.messageServer": "Nachricht an Server...",
"chat.messagePartner": "Nachricht an {name}...",
"chat.send": "Senden",
"chat.you": "Du",
"serverLog.clientJoin": "{client} loggte sich in Channel \"{channel}\" ein",
"serverLog.clientLeave": "{client} hat die Verbindung getrennt (Verlassen)",
"serverLog.clientChannelSwitch": "{client} ging von Channel \"{fromChannel}\" in \"{toChannel}\"",
"serverLog.clientChannelGroupAssigned": "Die Channel-Gruppe \"{group}\" wurde {client} zugewiesen",
"serverLog.channelCreated": "Channel \"{channel}\" wurde erstellt",
"serverLog.channelDeleted": "Channel \"{channel}\" wurde gelöscht",
"serverLog.channelEdited": "Channel \"{channel}\" wurde bearbeitet",
"serverLog.serverEdited": "Die Servereinstellungen wurden geändert",
"serverLog.permissionError": "Fehlende Berechtigung: {action}",
"poke.title": "Anstupsen",
"poke.optionalMessage": "Optionale Nachricht...",
"poke.send": "Anstupsen",
"poke.cancel": "Abbrechen",
"poke.pokedYou": "hat dich angestupst",
"poke.dismiss": "Schließen",
"kick.title": "Kicken:",
"kick.reasonPlaceholder": "Grund (optional)...",
"kick.confirm": "Kicken",
"kick.cancel": "Abbrechen",
"ban.title": "Bannen:",
"ban.reasonPlaceholder": "Grund (optional)...",
"ban.duration": "Dauer:",
"ban.durationPermanent": "Permanent",
"ban.duration1h": "1 Stunde",
"ban.duration1d": "1 Tag",
"ban.duration1w": "1 Woche",
"ban.confirm": "Bannen",
"ban.cancel": "Abbrechen",
"clientContext.privateChat": "Privater Chat",
"clientContext.poke": "Anstupsen",
"clientContext.copyName": "Namen kopieren",
"clientContext.connectionInfo": "Verbindungsinformationen anzeigen",
"clientContext.addWhisperTarget": "Als Whisper-Ziel hinzufügen",
"clientContext.removeWhisperTarget": "Als Whisper-Ziel entfernen",
"clientContext.assignChannelGroup": "Channel-Gruppe zuweisen",
"clientContext.assignServerGroup": "Server-Gruppe zuweisen",
"clientContext.kickChannel": "Aus dem Channel kicken",
"clientContext.kick": "Vom Server kicken",
"clientContext.ban": "Bannen",
"clientContext.notSupported": "Im Web-Client noch nicht unterstützt",
"connectError.dismiss": "Schließen",
"dialog.close": "Schließen",
"sounds.title": "Sounds",
"sounds.subtitle": "Sound-Benachrichtigungen für Ereignisse festlegen",
"sounds.enable": "Sounds aktivieren",
"sounds.volume": "Lautstärke",
"sounds.eventEnable": "Diesen Sound aktivieren",
"sounds.event.connect": "Verbunden",
"sounds.event.disconnect": "Getrennt",
"sounds.event.clientJoin": "Client kommt",
"sounds.event.clientLeave": "Client geht",
"sounds.event.message": "Nachricht empfangen",
"sounds.event.poke": "Anstupsen erhalten",
"sounds.default": "Standard",
"sounds.custom": "Eigene Datei: {name}",
"sounds.test": "▶ Testen",
"sounds.upload": "Hochladen",
"sounds.reset": "Zurücksetzen",
"sounds.importSoundpack": "Soundpack importieren (.ts3soundpack)",
"sounds.importResult": "{matched} Sound(s) übernommen, {unmatched} Datei(en) nicht zugeordnet",
"nachrichten.title": "Nachrichten",
"nachrichten.subtitle": "Nachrichten anpassen",
"nachrichten.disconnectMessage": "Verbindung trennen:",
"nachrichten.disconnectMessagePlaceholder": "verlassen",
"nachrichten.presetsTitle": "Voreingestellte Nachrichten",
"nachrichten.type": "Typ",
"nachrichten.type.away": "Abwesend",
"nachrichten.templateName": "Vorlagenname",
"nachrichten.message": "Nachricht",
"nachrichten.add": "Hinzufügen",
"nachrichten.delete": "Löschen",
},
en: {
"menu.connections": "Connections",
"menu.connections.connect": "Connect",
"menu.connections.disconnectCurrent": "Disconnect from current server",
"menu.connections.disconnectAll": "Disconnect from all servers",
"menu.favorites": "Bookmarks",
"menu.favorites.add": "Add bookmark",
"menu.favorites.manage": "Manage bookmarks",
"menu.self": "Self",
"menu.rights": "Permissions",
"menu.extras": "Tools",
"menu.help": "Help",
"menu.extras.identities": "Identities",
"menu.extras.contacts": "Contacts",
"menu.extras.collectedUrls": "Collected URLs",
"menu.extras.inviteFriend": "Invite a friend",
"menu.extras.whisperLists": "Whisper Lists",
"menu.extras.whisperHistory": "Whisper History",
"menu.extras.clientLog": "Client Log",
"menu.extras.banList": "Ban List",
"menu.extras.complaintList": "Complaint List",
"menu.extras.serverQueryLogin": "ServerQuery Login",
"menu.extras.serverLog": "Server Log",
"menu.extras.startRecording": "Start Recording",
"menu.extras.startMultitrackRecording": "Start Multitrack Recording",
"menu.extras.stopRecording": "Stop Recording",
"menu.extras.options": "Options",
"toolbar.setAway": "Set away",
"toolbar.backOnline": "Back online",
"toolbar.awayOptions": "Away options",
"toolbar.whisper": "Whisper targets",
"whisper.channels": "Channels",
"whisper.clients": "Clients",
"whisper.clearAll": "Clear all whisper targets",
"toolbar.micEnable": "Enable microphone",
"toolbar.micMute": "Mute microphone",
"toolbar.micUnmute": "Unmute microphone",
"toolbar.vadSensitivity": "Voice activation sensitivity",
"toolbar.muteSound": "Mute sound (deafen)",
"toolbar.unmuteSound": "Unmute sound (undeafen)",
"toolbar.chooseOutputDevice": "Choose output device",
"toolbar.toggleTheme": "Toggle theme",
"away.setGlobal": "Set globally away",
"away.setGlobalStatus": "Set global away status",
"connect.title": "Connect",
"connect.serverAddress": "Server nickname or address:",
"connect.serverPassword": "Server password:",
"connect.nickname": "Nickname:",
"connect.phoneticNickname": "Phonetic nickname:",
"connect.identity": "Identity:",
"connect.defaultChannel": "Default channel:",
"connect.recordingProfile": "Capture profile:",
"connect.channelPassword": "Channel password:",
"connect.playbackProfile": "Playback profile:",
"connect.onetimeGrant": "One-time privilege key:",
"connect.hotkeyProfile": "Hotkey profile:",
"connect.sendMyTeamSpeakId": "Send myTeamSpeak ID",
"connect.soundPack": "Sound pack:",
"connect.more": "More",
"connect.less": "Less",
"connect.connect": "Connect",
"connect.connecting": "Connecting…",
"connect.newTab": "In new tab",
"connect.cancel": "Cancel",
"collectedUrls.title": "Collected URLs",
"collectedUrls.search": "Search:",
"collectedUrls.url": "URL",
"collectedUrls.count": "Count",
"collectedUrls.lastSeen": "Last mentioned",
"collectedUrls.mentionedBy": "Mentioned by",
"collectedUrls.clearList": "Clear list",
"inviteFriend.title": "Invite a friend",
"inviteFriend.type": "Invitation type",
"inviteFriend.includeChannel": "Insert current channel",
"inviteFriend.link": "Link",
"inviteFriend.addPermissionKey": "Add permission key",
"inviteFriend.copyToClipboard": "Copy to clipboard",
"inviteFriend.copied": "Copied!",
"clientLog.title": "Client Log",
"clientLog.level.critical": "Critical",
"clientLog.level.error": "Errors",
"clientLog.level.warning": "Warnings",
"clientLog.level.info": "Info",
"clientLog.level.debug": "Debug",
"clientLog.search": "Search:",
"clientLog.filter": "Filter:",
"clientLog.caseSensitive": "Case sensitive",
"clientLog.mark": "Mark",
"whisperHistory.title": "Whisper History - {server}",
"whisperHistory.empty": "No whisper history yet.",
"whisperHistory.started": "Whispering to: {targets}",
"whisperHistory.stopped": "Stopped whispering",
"whisperHistory.clear": "Clear",
"whisperHistory.options": "Options",
"whisperLists.title": "Whisper Lists",
"whisperLists.namePlaceholder": "List name",
"whisperLists.saveCurrent": "Save current selection",
"whisperLists.itemDetail": "{channels} channels, {clients} clients",
"whisperLists.activate": "Activate",
"whisperLists.delete": "Delete",
"whisperLists.empty": "No whisper lists saved yet. Select whisper targets and save them here as a list.",
"identities.title": "Identities",
"identities.activate": "Activate",
"identities.add": "New Identity",
"identities.delete": "Delete",
"identities.newName": "New Identity",
"identities.generated": "Generated",
"identities.pending": "Will be generated on next connection",
"connectionInfo.clientTitle": "Connection Info - {name}",
"connectionInfo.serverTitle": "Server Connection Info",
"connectionInfo.loading": "Loading…",
"connectionInfo.unavailable": "No response from the server (missing permission?).",
"connectionInfo.ping": "Ping:",
"connectionInfo.connectedSince": "Connected since:",
"connectionInfo.ip": "IP address:",
"connectionInfo.packetLoss": "Packet loss:",
"connectionInfo.packetsSent": "Packets sent:",
"connectionInfo.packetsReceived": "Packets received:",
"connectionInfo.bytesSent": "Data sent:",
"connectionInfo.bytesReceived": "Data received:",
"connectionInfo.bandwidthSent": "Bandwidth sent:",
"connectionInfo.bandwidthReceived": "Bandwidth received:",
"menu.self.recordingProfile": "Recording Profile",
"menu.self.playbackProfile": "Playback Profile",
"menu.self.hotkeyProfile": "Hotkey Profile",
"menu.self.soundPack": "Sound Pack",
"menu.self.setAway": "Set Away",
"menu.self.enableMic": "Enable Microphone",
"menu.self.disableMic": "Disable Microphone",
"menu.self.muteOutput": "Mute Speakers/Headphones",
"menu.self.unmuteOutput": "Unmute Speakers/Headphones",
"menu.self.changeNickname": "Change Nickname",
"menu.self.requestTalkPower": "Request Talk Power",
"menu.self.setAvatar": "Set Avatar",
"menu.self.setPhoneticNickname": "Set Phonetic Nickname",
"menu.self.connectionInfo": "Connection Info",
"contacts.title": "Contacts",
"contacts.addOnlineClient": "Select an online client...",
"contacts.add": "Add",
"contacts.remove": "Remove",
"contacts.empty": "No contacts yet.",
"contacts.customName": "Custom Name:",
"contacts.category.acquaintance": "Acquaintance",
"contacts.category.blocked": "Blocked",
"contacts.category.friend": "Friend",
"contacts.phoneticName": "Phonetic Name:",
"contacts.show": "Show",
"contacts.ignore": "Ignore",
"contacts.unignore": "Unignore",
"contacts.whisper": "Whisper",
"contacts.preferences": "Preferences",
"favorites.title": "🔖 myTeamSpeak Bookmarks",
"favorites.synced": "Synced Bookmarks",
"favorites.notLoggedIn": "Not logged in",
"favorites.local": "Local Bookmarks",
"favorites.unnamed": "(unnamed)",
"favorites.bookmarkName": "Bookmark name:",
"favorites.newFavoriteName": "New bookmark",
"favorites.showServerQueryClients": "Show ServerQuery clients",
"favorites.connectOnStartup": "Connect on startup",
"favorites.enableMyTeamSpeak": "Enable myTeamSpeak features",
"favorites.new": "New bookmark",
"favorites.newFolder": "New folder",
"favorites.remove": "Remove",
"favorites.ok": "OK",
"favorites.cancel": "Cancel",
"favorites.apply": "Apply",
"away.dialog.title": "Set away message",
"away.dialog.message": "Message:",
"away.dialog.template": "Template:",
"away.dialog.none": "<None>",
"away.dialog.ok": "OK",
"away.dialog.save": "Save",
"away.dialog.cancel": "Cancel",
"options.title": "Options",
"options.ok": "OK",
"options.cancel": "Cancel",
"options.notImplemented": "This setting isn't implemented yet.",
"options.section.anwendung": "Application",
"options.section.wiedergabe": "Playback",
"options.section.aufnahme": "Capture",
"options.section.design": "Appearance",
"options.section.erweiterungen": "Addons",
"options.section.hotkeys": "Hotkeys",
"options.section.whispern": "Whisper",
"options.section.downloads": "Downloads",
"options.section.chat": "Chat",
"options.section.sicherheit": "Security",
"options.section.nachrichten": "Messages",
"options.section.meldungen": "Notifications",
"options.section.sounds": "Sounds",
"app.title": "Application",
"app.subtitle": "General application settings",
"app.language": "Language",
"app.language.auto": "System default",
"app.language.de": "Deutsch",
"app.language.en": "English",
"playback.title": "Playback",
"playback.subtitle": "Change your playback settings",
"playback.profile": "Profile",
"playback.default": "Default",
"playback.device": "Playback device:",
"playback.systemDefault": "System default",
"playback.quiet": "Quiet",
"playback.loud": "Loud",
"playback.voiceVolume": "Voice volume",
"playback.playTestTone": "▶ Play test sound",
"playback.options": "Options",
"playback.autoVolume": "Automatic volume adjustment",
"playback.ownMicClicks": "Play mic clicks for own client",
"playback.otherMicClicks": "Play mic clicks for other clients",
"recording.title": "Capture",
"recording.subtitle": "Change your capture settings",
"recording.device": "Capture device:",
"recording.activation": "Activation",
"recording.pushToTalk": "Push-To-Talk",
"recording.continuous": "Continuous transmission",
"recording.voiceActivation": "Voice activation detection",
"recording.testStart": "Start test",
"recording.testStop": "Stop test",
"recording.hangoverDelay": "Delay before deactivation:",
"recording.secondsUnit": "sec",
"recording.dsp": "Digital Signal Processing",
"recording.typingAttenuation": "Typing attenuation",
"recording.echoCancellation": "Echo cancellation",
"recording.noiseSuppression": "Remove background noise",
"info.address": "Address:",
"info.version": "Version:",
"info.license": "License:",
"info.currentClients": "Current clients:",
"info.currentChannels": "Current channels:",
"info.topic": "Topic:",
"info.audioCodec": "Audio codec:",
"info.passwordProtected": "Password protected:",
"info.clients": "Clients:",
"info.yes": "Yes",
"info.no": "No",
"tree.notConnected": "Not connected",
"tree.clickToSelect": "Click to select, double-click to join",
"tree.passwordProtected": "Password protected",
"tree.privateChatWith": "Private chat with",
"tree.poke": "Poke",
"tree.channelCommander": "Channel commander",
"tree.away": "Away",
"tree.micMuted": "Microphone muted",
"tree.soundMuted": "Sound muted (deafened)",
"chat.server": "Server",
"chat.channel": "Channel",
"chat.notConnected": "Not connected",
"chat.messageChannel": "Message channel...",
"chat.messageServer": "Message server...",
"chat.messagePartner": "Message {name}...",
"chat.send": "Send",
"chat.you": "You",
"serverLog.clientJoin": "{client} entered channel \"{channel}\"",
"serverLog.clientLeave": "{client} disconnected (Left)",
"serverLog.clientChannelSwitch": "{client} moved from channel \"{fromChannel}\" to \"{toChannel}\"",
"serverLog.clientChannelGroupAssigned": "Channel group \"{group}\" was assigned to {client}",
"serverLog.channelCreated": "Channel \"{channel}\" was created",
"serverLog.channelDeleted": "Channel \"{channel}\" was deleted",
"serverLog.channelEdited": "Channel \"{channel}\" was edited",
"serverLog.serverEdited": "Server settings were changed",
"serverLog.permissionError": "Missing permission: {action}",
"poke.title": "Poke",
"poke.optionalMessage": "Optional message...",
"poke.send": "Poke",
"poke.cancel": "Cancel",
"poke.pokedYou": "poked you",
"poke.dismiss": "Dismiss",
"kick.title": "Kick:",
"kick.reasonPlaceholder": "Reason (optional)...",
"kick.confirm": "Kick",
"kick.cancel": "Cancel",
"ban.title": "Ban:",
"ban.reasonPlaceholder": "Reason (optional)...",
"ban.duration": "Duration:",
"ban.durationPermanent": "Permanent",
"ban.duration1h": "1 hour",
"ban.duration1d": "1 day",
"ban.duration1w": "1 week",
"ban.confirm": "Ban",
"ban.cancel": "Cancel",
"clientContext.privateChat": "Private chat",
"clientContext.poke": "Poke",
"clientContext.copyName": "Copy name",
"clientContext.connectionInfo": "Show connection info",
"clientContext.addWhisperTarget": "Add as whisper target",
"clientContext.removeWhisperTarget": "Remove as whisper target",
"clientContext.assignChannelGroup": "Assign channel group",
"clientContext.assignServerGroup": "Assign server group",
"clientContext.kickChannel": "Kick from channel",
"clientContext.kick": "Kick from server",
"clientContext.ban": "Ban",
"clientContext.notSupported": "Not yet supported in the web client",
"connectError.dismiss": "Dismiss",
"dialog.close": "Close",
"sounds.title": "Sounds",
"sounds.subtitle": "Configure sound notifications for events",
"sounds.enable": "Enable sounds",
"sounds.volume": "Volume",
"sounds.eventEnable": "Enable this sound",
"sounds.event.connect": "Connected",
"sounds.event.disconnect": "Disconnected",
"sounds.event.clientJoin": "Client joins",
"sounds.event.clientLeave": "Client leaves",
"sounds.event.message": "Message received",
"sounds.event.poke": "Poke received",
"sounds.default": "Default",
"sounds.custom": "Custom file: {name}",
"sounds.test": "▶ Test",
"sounds.upload": "Upload",
"sounds.reset": "Reset",
"sounds.importSoundpack": "Import soundpack (.ts3soundpack)",
"sounds.importResult": "{matched} sound(s) imported, {unmatched} file(s) not matched",
"nachrichten.title": "Messages",
"nachrichten.subtitle": "Customize messages",
"nachrichten.disconnectMessage": "Disconnect:",
"nachrichten.disconnectMessagePlaceholder": "leaving",
"nachrichten.presetsTitle": "Preset messages",
"nachrichten.type": "Type",
"nachrichten.type.away": "Away",
"nachrichten.templateName": "Template name",
"nachrichten.message": "Message",
"nachrichten.add": "Add",
"nachrichten.delete": "Delete",
},
};
function detectSystemLang(): Lang {
const nav = typeof navigator !== "undefined" ? navigator.language : "en";
return nav?.toLowerCase().startsWith("de") ? "de" : "en";
}
export function resolveLang(pref: LangPref): Lang {
return pref === "auto" ? detectSystemLang() : pref;
}
export function loadLangPref(): LangPref {
const raw = localStorage.getItem(LANGUAGE_KEY);
return raw === "de" || raw === "en" || raw === "auto" ? raw : "auto";
}
export function saveLangPref(pref: LangPref) {
localStorage.setItem(LANGUAGE_KEY, pref);
}
type TranslateFn = (key: string, vars?: Record<string, string>) => string;
function interpolate(template: string, vars?: Record<string, string>): string {
if (!vars) return template;
return template.replace(/\{(\w+)\}/g, (match, name) => vars[name] ?? match);
}
const LanguageContext = createContext<{ lang: Lang; langPref: LangPref; setLangPref: (p: LangPref) => void; t: TranslateFn }>({
lang: "en",
langPref: "auto",
setLangPref: () => {},
t: (key) => translations.en[key] ?? key,
});
export function LanguageProvider({ children }: { children: ReactNode }) {
const [langPref, setLangPrefState] = useState<LangPref>(() => loadLangPref());
const lang = resolveLang(langPref);
useEffect(() => {
saveLangPref(langPref);
}, [langPref]);
const t: TranslateFn = (key, vars) =>
interpolate(translations[lang][key] ?? translations.en[key] ?? key, vars);
return (
<LanguageContext.Provider value={{ lang, langPref, setLangPref: setLangPrefState, t }}>
{children}
</LanguageContext.Provider>
);
}
export function useLanguage() {
return useContext(LanguageContext);
}
export function useT() {
return useContext(LanguageContext).t;
}