This commit is contained in:
MichaelDvP
2023-01-01 21:02:24 +01:00
13 changed files with 106 additions and 116 deletions

View File

@@ -21,7 +21,7 @@ import { loadLocaleAsync } from './i18n/i18n-util.async';
import { ReactComponent as NLflag } from './i18n/NL.svg';
import { ReactComponent as DEflag } from './i18n/DE.svg';
import { ReactComponent as GBflag } from './i18n/GB.svg';
import { ReactComponent as SEflag } from './i18n/SE.svg';
import { ReactComponent as SVflag } from './i18n/SV.svg';
import { ReactComponent as PLflag } from './i18n/PL.svg';
import { ReactComponent as NOflag } from './i18n/NO.svg';
import { ReactComponent as FRflag } from './i18n/FR.svg';
@@ -134,9 +134,9 @@ const SignIn: FC = () => {
<PLflag style={{ width: 24 }} />
&nbsp;PL
</Button>
<Button size="small" variant={locale === 'se' ? 'contained' : 'outlined'} onClick={() => selectLocale('se')}>
<SEflag style={{ width: 24 }} />
&nbsp;SE
<Button size="small" variant={locale === 'sv' ? 'contained' : 'outlined'} onClick={() => selectLocale('sv')}>
<SVflag style={{ width: 24 }} />
&nbsp;SV
</Button>
</Box>

View File

@@ -26,7 +26,7 @@ import { loadLocaleAsync } from '../../i18n/i18n-util.async';
import { ReactComponent as NLflag } from '../../i18n/NL.svg';
import { ReactComponent as DEflag } from '../../i18n/DE.svg';
import { ReactComponent as GBflag } from '../../i18n/GB.svg';
import { ReactComponent as SEflag } from '../../i18n/SE.svg';
import { ReactComponent as SVflag } from '../../i18n/SV.svg';
import { ReactComponent as PLflag } from '../../i18n/PL.svg';
import { ReactComponent as NOflag } from '../../i18n/NO.svg';
import { ReactComponent as FRflag } from '../../i18n/FR.svg';
@@ -99,9 +99,9 @@ const LayoutAuthMenu: FC = () => {
<PLflag style={{ width: 16, verticalAlign: 'middle' }} />
&nbsp;PL
</MenuItem>
<MenuItem key="se" value="se">
<SEflag style={{ width: 16, verticalAlign: 'middle' }} />
&nbsp;SE
<MenuItem key="sv" value="sv">
<SVflag style={{ width: 16, verticalAlign: 'middle' }} />
&nbsp;SV
</MenuItem>
</TextField>

View File

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 217 B

View File

@@ -234,7 +234,7 @@ const de: Translation = {
OPTIONAL: 'Optional',
FORMATTING: 'Formattierung',
MQTT_FORMAT: 'Topic/Payload Format',
MQTT_NEST_1: 'Als Nester in in einem Gesamttopic',
MQTT_NEST_1: 'Eingebettet in einem Gesamttopic',
MQTT_NEST_2: 'Als einzelne Topics',
MQTT_RESPONSE: 'Veröffentliche die Kommandoantwort als `response` Topic',
MQTT_PUBLISH_TEXT_1: 'Veröffentliche einzelne Werte bei Veränderung als eigene Topics',

View File

@@ -2,7 +2,7 @@ import type { Translation } from '../i18n-types';
/* prettier-ignore */
/* eslint-disable */
const se: Translation = {
const sv: Translation = {
LANGUAGE: 'Språk',
RETRY: 'Försök igen',
LOADING: 'Laddar',
@@ -77,7 +77,7 @@ const se: Translation = {
TX_ISSUES: 'Sändfel - Prova ett annat TX-läge',
DISCONNECTED: 'Nedkopplad',
EMS_SCAN: 'Är du säker att du vill initiera en full genomsökning av EMS-bussen?',
EMS_BUS_STATUS: 'EMS-Buss Status',
EMS_BUS_STATUS: 'Status EMS-Buss',
ACTIVE_DEVICES: 'Aktiva Enheter',
EMS_DEVICE: 'EMS Enhet',
SUCCESS: 'Lyckades',
@@ -87,7 +87,7 @@ const se: Translation = {
EMS_BUS_STATUS_TITLE: 'EMS-buss & aktivitetsstatus',
SCAN: 'Sök',
STATUS_NAMES: [
'EMS-mottagningar (Rx)',
'EMS-telegram (Rx)',
'EMS-läsningar (Tx)',
'EMS-skrivningar (Tx)',
'Temperatursensor-läsningar',
@@ -117,7 +117,7 @@ const se: Translation = {
DISABLED: 'inaktiverad',
TX_MODE: 'Tx Mode',
HARDWARE: 'Hardware',
EMS_BUS: '{{BUS|EMS BUS}}',
EMS_BUS: '{{BUSS|EMS-BUSS}}',
GENERAL_OPTIONS: 'Allmänna Inställningar',
LANGUAGE_ENTITIES: 'Språk (för entiteter)',
HIDE_LED: 'Inaktivera LED',
@@ -140,7 +140,7 @@ const se: Translation = {
LOGGING: 'Loggning',
LOG_HEX: 'Logga EMS-telegram i hexadecimal',
ENABLE_SYSLOG: 'Aktivera Syslog',
LOG_LEVEL: 'Log Level',
LOG_LEVEL: 'Loggnivå',
MARK_INTERVAL: 'Markerings-interval',
SECONDS: 'sekunder',
MINUTES: 'minuter',
@@ -260,8 +260,8 @@ const se: Translation = {
UNKNOWN: 'Okänt',
SET_TIME: 'Ställ in klockan',
SET_TIME_TEXT: 'Ange lokal datum och tid nedan för att ställa in klockan',
LOCAL_TIME: 'Lokal Tid',
UTC_TIME: 'UTC-tid',
LOCAL_TIME: 'Tid (lokal)',
UTC_TIME: 'Tid (UTC)',
ENABLE_NTP: 'Aktivera NTP',
NTP_SERVER: 'NTP Server',
TIME_ZONE: 'Tidszon',
@@ -305,4 +305,4 @@ const se: Translation = {
MAX: 'max'
};
export default se;
export default sv;

View File

@@ -74,8 +74,6 @@ import {
import { useI18nContext } from '../i18n/i18n-react';
import parseMilliseconds from 'parse-ms';
const DashboardData: FC = () => {
const { me } = useContext(AuthenticatedContext);
@@ -401,7 +399,10 @@ const DashboardData: FC = () => {
const isCmdOnly = (dv: DeviceValue) => dv.v === '' && dv.c;
const formatDurationMin = (duration_min: number) => {
const { days, hours, minutes } = parseMilliseconds(duration_min * 60000);
const days = Math.trunc((duration_min * 60000) / 86400000);
const hours = Math.trunc((duration_min * 60000) / 3600000) % 24;
const minutes = Math.trunc((duration_min * 60000) / 60000) % 60;
let formatted = '';
if (days) {
formatted += LL.NUM_DAYS({ num: days }) + ' ';

View File

@@ -38,7 +38,6 @@ import * as EMSESP from './api';
import type { Translation } from '../i18n/i18n-types';
import { useI18nContext } from '../i18n/i18n-react';
import parseMilliseconds from 'parse-ms';
export const isConnected = ({ status }: Status) => status !== busConnectionStatus.BUS_STATUS_OFFLINE;
@@ -157,7 +156,11 @@ const DashboardStatus: FC = () => {
};
const formatDurationSec = (duration_sec: number) => {
const { days, hours, minutes, seconds } = parseMilliseconds(duration_sec * 1000);
const days = Math.trunc((duration_sec * 1000) / 86400000);
const hours = Math.trunc((duration_sec * 1000) / 3600000) % 24;
const minutes = Math.trunc((duration_sec * 1000) / 60000) % 60;
const seconds = Math.trunc((duration_sec * 1000) / 1000) % 60;
let formatted = '';
if (days) {
formatted += LL.NUM_DAYS({ num: days }) + ' ';

View File

@@ -368,7 +368,7 @@ const SettingsApplication: FC = () => {
<MenuItem value="nl">Nederlands (NL)</MenuItem>
<MenuItem value="no">Norsk (NO)</MenuItem>
<MenuItem value="pl">Polski (PL)</MenuItem>
<MenuItem value="se">Svenska (SE)</MenuItem>
<MenuItem value="sv">Svenska (SV)</MenuItem>
</ValidatedTextField>
</Box>
{data.led_gpio !== 0 && (