Add German translation, add own price source selection

This commit is contained in:
Djuri Baars 2024-05-08 23:38:56 +02:00
parent dcdf98964a
commit e47fc066b0
9 changed files with 167 additions and 8 deletions

View File

@ -6,6 +6,7 @@ const defaultLocale = 'en';
register('en', () => import('../locales/en.json'));
register('nl', () => import('../locales/nl.json'));
register('es', () => import('../locales/es.json'));
register('de', () => import('../locales/de.json'));
init({
fallbackLocale: defaultLocale,

88
src/lib/locales/de.json Normal file
View File

@ -0,0 +1,88 @@
{
"section": {
"settings": {
"title": "Einstellungen",
"textColor": "Textfarbe",
"backgroundColor": "Hintergrundfarbe",
"ledPowerOnTest": "LED-Einschalttest",
"ledFlashOnBlock": "LED blinkt bei neuem Block",
"timePerScreen": "Zeit pro Bildschirm",
"ledBrightness": "LED-Helligkeit",
"flMaxBrightness": "Displaybeleuchtung Helligkeit",
"timezoneOffset": "Zeitzonenoffset",
"timeBetweenPriceUpdates": "Zeit zwischen Preisaktualisierungen",
"fullRefreshEvery": "Vollständige Aktualisierung alle",
"mempoolnstance": "Mempool Instance",
"hostnamePrefix": "Hostnamen-Präfix",
"StealFocusOnNewBlock": "Steal focus on new block",
"useBigCharsMcap": "Verwende große Zeichen für die Marktkapitalisierung",
"useBlkCountdown": "Blocks Countdown zur Halbierung",
"useSatsSymbol": "Sats-Symbol verwenden",
"suffixPrice": "Suffix-Preisformat",
"disableLeds": "Alle LED-Effekte deaktivieren",
"otaUpdates": "OTA updates",
"enableMdns": "mDNS",
"fetchEuroPrice": "€-Preis abrufen",
"shortAmountsWarning": "Geringe Beträge können die Lebensdauer der Displays verkürzen",
"tzOffsetHelpText": "Ein Neustart ist erforderlich, um den TZ-Offset anzuwenden.",
"screens": "Bildschirme",
"wifiTxPowerText": "In den meisten Fällen muss dies nicht eingestellt werden.",
"wifiTxPower": "WiFi-TX-Leistung",
"settingsSaved": "Einstellungen gespeichert",
"errorSavingSettings": "Fehler beim Speichern der Einstellungen",
"ownPriceSource": "BTClock-Preisquelle verwenden",
"flAlwaysOn": "Displaybeleuchtung immer an"
},
"control": {
"systemInfo": "Systeminfo",
"version": "Version",
"buildTime": "Build time",
"ledColor": "LED-Farbe",
"turnOff": "Ausschalten",
"setColor": "Farbe festlegen",
"showText": "Text anzeigen",
"text": "Text",
"title": "Kontrolle",
"hostname": "Hostname",
"frontlight": "Displaybeleuchtung",
"turnOn": "Einschalten"
},
"status": {
"title": "Status",
"screenCycle": "Bildschirmzyklus",
"memoryFree": "Speicher frei",
"wsPriceConnection": "WS-Preisverbindung",
"wsMempoolConnection": "WS Mempool.space-Verbindung",
"fetchEuroNote": "If you use \"Fetch € price\" the WS Price connection will show ❌ since it uses another data source.",
"uptime": "Betriebszeit",
"wifiSignalStrength": "WiFi-Signalstärke"
}
},
"colors": {
"black": "Schwarz",
"white": "Weiss"
},
"time": {
"minutes": "Minuten",
"seconds": "Sekunden"
},
"restartRequired": "Neustart erforderlich",
"button": {
"save": "Speichern",
"reset": "Zurücksetzen",
"restart": "Neustart",
"forceFullRefresh": "Vollständige Aktualisierung erzwingen"
},
"timer": {
"running": "läuft",
"stopped": "gestoppt"
},
"sections": {
"control": {
"keepSameColor": "Gleiche Farbe beibehalten"
}
},
"rssiBar": {
"tooltip": "Werte > -67 dBm gelten als gut. > -30 dBm ist erstaunlich"
}
}

View File

@ -28,7 +28,10 @@
"wifiTxPowerText": "In most cases this does not need to be set.",
"wifiTxPower": "WiFi TX power",
"settingsSaved": "Settings saved",
"errorSavingSettings": "Error saving settings"
"errorSavingSettings": "Error saving settings",
"ownPriceSource": "Use BTClock price source",
"flMaxBrightness": "Frontlight brightness",
"flAlwaysOn": "Frontlight always on"
},
"control": {
"systemInfo": "System info",
@ -40,7 +43,9 @@
"showText": "Show text",
"text": "Text",
"title": "Control",
"hostname": "Hostname"
"hostname": "Hostname",
"frontlight": "Frontlight",
"turnOn": "Turn on"
},
"status": {
"title": "Status",

View File

@ -27,7 +27,10 @@
"otaUpdates": "Actualización por aire",
"wifiTxPowerText": "En la mayoría de los casos no es necesario configurar esto.",
"settingsSaved": "Configuración guardada",
"errorSavingSettings": "Error al guardar la configuración"
"errorSavingSettings": "Error al guardar la configuración",
"ownPriceSource": "Usar fuente de precios BTClock",
"flMaxBrightness": "Brillo de luz de la pantalla",
"flAlwaysOn": "Luz de la pantalla siempre encendida"
},
"control": {
"turnOff": "Apagar",
@ -39,7 +42,9 @@
"text": "Texto",
"title": "Control",
"buildTime": "Tiempo de compilación",
"hostname": "Nombre del host"
"hostname": "Nombre del host",
"turnOn": "Encender",
"frontlight": "Luz de la pantalla"
},
"status": {
"memoryFree": "Memoria RAM libre",

View File

@ -28,7 +28,10 @@
"wifiTxPower": "WiFi TX power",
"wifiTxPowerText": "Meestal hoeft dit niet aangepast te worden.",
"settingsSaved": "Instellingen opgeslagen",
"errorSavingSettings": "Fout bij opslaan instellingen"
"errorSavingSettings": "Fout bij opslaan instellingen",
"ownPriceSource": "Gebruik BTClock prijs bron",
"flMaxBrightness": "Displaylicht helderheid",
"flAlwaysOn": "Displaylicht altijd aan"
},
"control": {
"systemInfo": "Systeeminformatie",
@ -39,7 +42,9 @@
"ledColor": "LED kleur",
"showText": "Toon tekst",
"text": "Tekst",
"title": "Besturing"
"title": "Besturing",
"frontlight": "Displaylicht",
"turnOn": "Aanzetten"
},
"status": {
"title": "Status",

View File

@ -24,7 +24,8 @@
const flagMap: { [key: string]: string } = {
en: '🇬🇧', // English flag emoji
nl: '🇳🇱', // Dutch flag emoji
es: '🇪🇸' // Spanish flag emoji
es: '🇪🇸', // Spanish flag emoji
de: '🇩🇪' // German flag emoji
};
// Convert the language code to lowercase for case-insensitive matching

View File

@ -75,7 +75,7 @@
</script>
<svelte:head>
<title>&#8383;TClock</title>
<title>BTClock</title>
</svelte:head>
<Container fluid>

View File

@ -55,6 +55,14 @@
fetch(`${PUBLIC_BASE_URL}/api/lights/off`).catch(() => {});
};
const turnOnFrontlight = () => {
fetch(`${PUBLIC_BASE_URL}/api/frontlight/on`).catch(() => {});
};
const turnOffFrontlight = () => {
fetch(`${PUBLIC_BASE_URL}/api/frontlight/off`).catch(() => {});
};
const restartClock = () => {
fetch(`${PUBLIC_BASE_URL}/api/restart`).catch(() => {});
};
@ -146,6 +154,14 @@
</Form>
<hr />
{/if}
{#if $settings.hasFrontlight}
<h3>{$_('section.control.frontlight')}</h3>
<Button color="secondary" id="turnOffFrontlightBtn" on:click={turnOffFrontlight}
>{$_('section.control.turnOff')}</Button
>
<Button color="primary" on:click={turnOnFrontlight}>{$_('section.control.turnOn')}</Button>
<hr />
{/if}
<h3>{$_('section.control.systemInfo')}</h3>
<ul class="small system_info">
<li>{$_('section.control.version')}: {$settings.gitRev}</li>

View File

@ -193,6 +193,24 @@
/>
</Col>
</Row>
{#if $settings.hasFrontlight}
<Row>
<Label md={6} for="flMaxBrightness" size="sm"
>{$_('section.settings.flMaxBrightness')}</Label
>
<Col md="6">
<Input
type="range"
name="flMaxBrightness"
id="flMaxBrightness"
bind:value={$settings.flMaxBrightness}
min={0}
max={4095}
step={1}
/>
</Col>
</Row>
{/if}
<Row>
<Label md={6} for="mempoolInstance" size="sm"
>{$_('section.settings.mempoolnstance')}</Label
@ -341,6 +359,26 @@
label={$_('section.settings.disableLeds')}
/>
</Col>
<Col md="6">
<Input
id="ownPriceSource"
bind:checked={$settings.ownPriceSource}
type="switch"
bsSize="sm"
label="{$_('section.settings.ownPriceSource')} ({$_('restartRequired')})"
/>
</Col>
{#if $settings.hasFrontlight}
<Col md="6">
<Input
id="flAlwaysOn"
bind:checked={$settings.flAlwaysOn}
type="switch"
bsSize="sm"
label={$_('section.settings.flAlwaysOn')}
/>
</Col>
{/if}
</Row>
<Row>