Files
CT/src/translations.ts
T

85 lines
2.7 KiB
TypeScript
Raw Normal View History

2024-07-07 22:11:18 +02:00
import * as React from "bloatless-react";
2024-07-08 00:39:22 +02:00
import { currentAddress } from "./model";
2024-07-07 22:11:18 +02:00
2024-07-07 19:21:08 +02:00
const englishTranslations = {
2024-07-07 22:11:18 +02:00
// general
setInput: "Set",
connectionStatus: "Connection status",
2024-07-08 00:48:58 +02:00
connectedTo: (server: string) => `Connected to "${server}"`,
2024-07-07 22:11:18 +02:00
disconnected: "Disconnected",
2024-07-07 19:21:08 +02:00
// settings
settings: "Settings",
2024-07-07 22:11:18 +02:00
connection: "Connection",
communication: "Communication",
encryption: "Encryption",
serverAddress: "Server Address",
2024-07-08 01:53:00 +02:00
serverAddressPlaceholder: "wss://192.168.0.69:3000",
2024-07-07 22:11:18 +02:00
connectToServer: "Connect",
primaryChannel: "Primary channel",
2024-07-08 02:44:23 +02:00
leaveChannel: "Leave",
2024-07-07 22:11:18 +02:00
channelPlaceholder: "my-channel",
addSecondaryChannel: "Add secondary channel",
removeSecondaryChannel: "Remove secondary channel",
newSecondaryChannelPlaceholder: "Add secondary channel",
encryptionKey: "Encryption key",
encryptionKeyPlaceholder: "1jg028ej40d",
showEncryptionKey: "Show encryption key",
yourName: "Your Name",
yourNamePlaceholder: "Jane Doe",
2024-07-07 19:21:08 +02:00
// messages
2024-07-07 22:11:18 +02:00
messages: "Messages",
composerPlaceholder: "Type a message...",
2024-07-08 00:39:22 +02:00
sendMessage: "Send",
clearHistory: "Clear history",
encryptionUnavailableTitle: "Encryption is not available",
encryptionUnavailableMessage:
2024-07-08 02:50:10 +02:00
"Obtain this app via HTTPS or continue without encryption",
2024-07-07 19:21:08 +02:00
};
2024-07-08 02:50:10 +02:00
const allTranslations: { [key: string]: typeof englishTranslations } = {
2024-07-07 19:21:08 +02:00
en: englishTranslations,
2024-07-08 02:50:10 +02:00
de: {
// general
setInput: "OK",
connectionStatus: "Verbindungsstatus",
connectedTo: (server: string) => `Verbunden mit "${server}"`,
disconnected: "Verbindung getrennt",
// settings
settings: "Einstellungen",
connection: "Verbindung",
communication: "Kommunikation",
encryption: "Verschlüsselung",
serverAddress: "Serveraddresse",
serverAddressPlaceholder: "wss://192.168.0.69:3000",
connectToServer: "Verbinden",
primaryChannel: "Hauptkanal",
leaveChannel: "Verlassen",
channelPlaceholder: "mein-kanal",
addSecondaryChannel: "Zweitkanal hinzufügen",
removeSecondaryChannel: "Zweitkanal entfernen",
newSecondaryChannelPlaceholder: "Zweitkanal hinzufügen",
encryptionKey: "Schlüssel",
encryptionKeyPlaceholder: "1jg028ej40d",
showEncryptionKey: "Schlüssel anzeigen",
yourName: "Mein Name",
yourNamePlaceholder: "Max Mustermann",
// messages
messages: "Nachrichten",
composerPlaceholder: "Neue Nachricht...",
sendMessage: "Senden",
clearHistory: "Nachrichtenverlauf leeren",
encryptionUnavailableTitle: "Verschlüsselung nicht möglich",
encryptionUnavailableMessage:
"Um Nachrichten zu verschlüsseln, lade diese Seite über HTTPS.",
},
2024-07-07 19:21:08 +02:00
};
2024-07-07 22:11:18 +02:00
const language = navigator.language.substring(0, 2);
export const translation: typeof englishTranslations =
allTranslations[language] ?? allTranslations.en;