Skip to content

Commit

Permalink
Use correct units in hardware info
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed May 28, 2024
1 parent 6ce4740 commit df80953
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 13 deletions.
6 changes: 3 additions & 3 deletions webapp/src/components/HardwareInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
</tr>
<tr>
<th>{{ $t('hardwareinfo.CpuTemperature') }}</th>
<td>{{ $n(systemStatus.cputemp, 'decimalNoDigits') }} {{ $t('hardwareinfo.DegreeC') }}</td>
<td>{{ $n(systemStatus.cputemp, 'celsius') }}</td>
</tr>
<tr>
<th>{{ $t('hardwareinfo.FlashSize') }}</th>
<td>
{{ $n(systemStatus.flashsize) }} {{ $t('hardwareinfo.Bytes') }}
({{ $n(systemStatus.flashsize / 1024 / 1024) }} {{ $t('hardwareinfo.MegaBytes') }})
{{ $n(systemStatus.flashsize, 'byte') }}
({{ $n(systemStatus.flashsize / 1024 / 1024, 'megabyte') }})
</td>
</tr>
</tbody>
Expand Down
4 changes: 1 addition & 3 deletions webapp/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions webapp/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
29 changes: 28 additions & 1 deletion webapp/src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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: {
Expand All @@ -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;
export const defaultLocale = Locales.EN;

0 comments on commit df80953

Please sign in to comment.