From df80953b5efc4e8815482766a440ac250af533a5 Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Tue, 28 May 2024 23:38:17 +0200 Subject: [PATCH] Use correct units in hardware info --- webapp/src/components/HardwareInfo.vue | 6 +++--- webapp/src/locales/de.json | 4 +--- webapp/src/locales/en.json | 4 +--- webapp/src/locales/fr.json | 4 +--- webapp/src/locales/index.ts | 29 +++++++++++++++++++++++++- 5 files changed, 34 insertions(+), 13 deletions(-) diff --git a/webapp/src/components/HardwareInfo.vue b/webapp/src/components/HardwareInfo.vue index a28c4a1..ec95c98 100644 --- a/webapp/src/components/HardwareInfo.vue +++ b/webapp/src/components/HardwareInfo.vue @@ -21,13 +21,13 @@ {{ $t('hardwareinfo.CpuTemperature') }} - {{ $n(systemStatus.cputemp, 'decimalNoDigits') }} {{ $t('hardwareinfo.DegreeC') }} + {{ $n(systemStatus.cputemp, 'celsius') }} {{ $t('hardwareinfo.FlashSize') }} - {{ $n(systemStatus.flashsize) }} {{ $t('hardwareinfo.Bytes') }} - ({{ $n(systemStatus.flashsize / 1024 / 1024) }} {{ $t('hardwareinfo.MegaBytes') }}) + {{ $n(systemStatus.flashsize, 'byte') }} + ({{ $n(systemStatus.flashsize / 1024 / 1024, 'megabyte') }}) diff --git a/webapp/src/locales/de.json b/webapp/src/locales/de.json index 7b3f892..df4d6c2 100644 --- a/webapp/src/locales/de.json +++ b/webapp/src/locales/de.json @@ -205,9 +205,7 @@ "Mhz": "MHz", "CpuTemperature": "CPU Temperatur", "DegreeC": "°C", - "FlashSize": "Flash-Speichergröße", - "Bytes": "Bytes", - "MegaBytes": "MB" + "FlashSize": "Flash-Speichergröße" }, "memoryinfo": { "MemoryInformation": "Speicherinformationen", diff --git a/webapp/src/locales/en.json b/webapp/src/locales/en.json index 2f9f64a..c5424aa 100644 --- a/webapp/src/locales/en.json +++ b/webapp/src/locales/en.json @@ -205,9 +205,7 @@ "Mhz": "MHz", "CpuTemperature": "CPU Temperature", "DegreeC": "°C", - "FlashSize": "Flash Memory Size", - "Bytes": "Bytes", - "MegaBytes": "MB" + "FlashSize": "Flash Memory Size" }, "memoryinfo": { "MemoryInformation": "Memory Information", diff --git a/webapp/src/locales/fr.json b/webapp/src/locales/fr.json index 676046b..71fe214 100644 --- a/webapp/src/locales/fr.json +++ b/webapp/src/locales/fr.json @@ -205,9 +205,7 @@ "Mhz": "MHz", "CpuTemperature": "CPU Temperature", "DegreeC": "°C", - "FlashSize": "Taille de la mémoire flash", - "Bytes": "octets", - "MegaBytes": "Mo" + "FlashSize": "Taille de la mémoire flash" }, "memoryinfo": { "MemoryInformation": "Informations sur la mémoire", diff --git a/webapp/src/locales/index.ts b/webapp/src/locales/index.ts index 57589c7..95ca69e 100644 --- a/webapp/src/locales/index.ts +++ b/webapp/src/locales/index.ts @@ -62,9 +62,18 @@ export const numberFormats: I18nOptions["numberFormats"] = { percent: { style: 'percent', }, + byte: { + style: 'unit', unit: 'byte', + }, kilobyte: { style: 'unit', unit: 'kilobyte', }, + megabyte: { + style: 'unit', unit: 'megabyte', + }, + celsius: { + style: 'unit', unit: 'celsius', maximumFractionDigits: 1, + }, }, [Locales.DE]: { decimal: { @@ -79,9 +88,18 @@ export const numberFormats: I18nOptions["numberFormats"] = { percent: { style: 'percent', }, + byte: { + style: 'unit', unit: 'byte', + }, kilobyte: { style: 'unit', unit: 'kilobyte', }, + megabyte: { + style: 'unit', unit: 'megabyte', + }, + celsius: { + style: 'unit', unit: 'celsius', maximumFractionDigits: 1, + }, }, [Locales.FR]: { decimal: { @@ -96,10 +114,19 @@ export const numberFormats: I18nOptions["numberFormats"] = { percent: { style: 'percent', }, + byte: { + style: 'unit', unit: 'byte', + }, kilobyte: { style: 'unit', unit: 'kilobyte', }, + megabyte: { + style: 'unit', unit: 'megabyte', + }, + celsius: { + style: 'unit', unit: 'celsius', maximumFractionDigits: 1, + }, }, }; -export const defaultLocale = Locales.EN; \ No newline at end of file +export const defaultLocale = Locales.EN;