DE translations for Settings, Customizations and Help

This commit is contained in:
Proddy
2022-08-26 16:14:28 +02:00
parent e9c695f76a
commit 84499dab35
8 changed files with 761 additions and 111 deletions

View File

@@ -69,7 +69,7 @@ const SettingsApplication: FC = () => {
});
}
} catch (error: unknown) {
enqueueSnackbar(extractErrorMessage(error, 'Problem fetching board profile'), { variant: 'error' });
enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_UPDATING()), { variant: 'error' });
} finally {
setProcessingBoard(false);
}
@@ -106,26 +106,23 @@ const SettingsApplication: FC = () => {
validateAndSubmit();
try {
await EMSESP.restart();
enqueueSnackbar('EMS-ESP is restarting...', { variant: 'info' });
enqueueSnackbar(LL.APPLICATION_RESTARTING(), { variant: 'info' });
} catch (error: unknown) {
enqueueSnackbar(extractErrorMessage(error, 'Problem restarting device'), { variant: 'error' });
enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_UPDATING()), { variant: 'error' });
}
};
return (
<>
<Typography sx={{ pt: 2 }} variant="h6" color="primary">
Interface Board Profile
Interface {LL.BOARD_PROFILE()}
</Typography>
<Box color="warning.main">
<Typography variant="body2">
Select a pre-configured interface board profile from the list below or choose "Custom" to configure your own
hardware settings
</Typography>
<Typography variant="body2">{LL.BOARD_PROFILE_TEXT()}</Typography>
</Box>
<ValidatedTextField
name="board_profile"
label="Board Profile"
label={LL.BOARD_PROFILE()}
value={data.board_profile}
disabled={processingBoard}
variant="outlined"
@@ -174,7 +171,7 @@ const SettingsApplication: FC = () => {
<ValidatedTextField
fieldErrors={fieldErrors}
name="pbutton_gpio"
label="Button GPIO"
label={LL.BUTTON() + ' GPIO'}
fullWidth
variant="outlined"
value={numberValue(data.pbutton_gpio)}
@@ -188,7 +185,7 @@ const SettingsApplication: FC = () => {
<ValidatedTextField
fieldErrors={fieldErrors}
name="dallas_gpio"
label="Temperature GPIO (0=disabled)"
label={LL.TEMPERATURE() + ' GPIO (0=' + LL.DISABLED() + ')'}
fullWidth
variant="outlined"
value={numberValue(data.dallas_gpio)}
@@ -202,7 +199,7 @@ const SettingsApplication: FC = () => {
<ValidatedTextField
fieldErrors={fieldErrors}
name="led_gpio"
label="LED GPIO (0=disabled)"
label={'LED GPIO (0=' + LL.DISABLED() + ')'}
fullWidth
variant="outlined"
value={numberValue(data.led_gpio)}
@@ -225,7 +222,7 @@ const SettingsApplication: FC = () => {
margin="normal"
select
>
<MenuItem value={0}>No Ethernet Module</MenuItem>
<MenuItem value={0}>{LL.DISABLED()}</MenuItem>
<MenuItem value={1}>LAN8720</MenuItem>
<MenuItem value={2}>TLK110</MenuItem>
</ValidatedTextField>
@@ -235,7 +232,7 @@ const SettingsApplication: FC = () => {
<Grid item>
<ValidatedTextField
name="eth_power"
label="Eth Power GPIO (-1=disabled)"
label={'Eth Power GPIO (-1=' + LL.DISABLED() + ')'}
fullWidth
variant="outlined"
value={numberValue(data.eth_power)}
@@ -281,7 +278,7 @@ const SettingsApplication: FC = () => {
</>
)}
<Typography variant="h6" color="primary">
EMS Bus Settings
EMS Bus {LL.SETTINGS()}
</Typography>
<Grid container spacing={1} direction="row" justifyContent="flex-start" alignItems="flex-start">
<Grid item xs={6}>
@@ -323,7 +320,7 @@ const SettingsApplication: FC = () => {
</Grid>
</Grid>
<Typography sx={{ pt: 2 }} variant="h6" color="primary">
General Options
{LL.GENERAL_OPTIONS()}
</Typography>
<Box
sx={{
@@ -332,7 +329,7 @@ const SettingsApplication: FC = () => {
>
<ValidatedTextField
name="locale"
label="Language (for device entities)"
label={LL.LANGUAGE_ENTITIES()}
disabled={saving}
value={data.locale}
variant="outlined"
@@ -341,56 +338,56 @@ const SettingsApplication: FC = () => {
size="small"
select
>
<MenuItem value="en">English</MenuItem>
<MenuItem value="de">Deutsch</MenuItem>
<MenuItem value="en">English (en)</MenuItem>
<MenuItem value="de">Deutsch (de)</MenuItem>
</ValidatedTextField>
</Box>
{data.led_gpio !== 0 && (
<BlockFormControlLabel
control={<Checkbox checked={data.hide_led} onChange={updateFormValue} name="hide_led" />}
label="Hide LED"
label={LL.HIDE_LED()}
disabled={saving}
/>
)}
<BlockFormControlLabel
control={<Checkbox checked={data.telnet_enabled} onChange={updateFormValue} name="telnet_enabled" />}
label="Enable Telnet Console"
label={LL.ENABLE_TELNET()}
disabled={saving}
/>
<BlockFormControlLabel
control={<Checkbox checked={data.analog_enabled} onChange={updateFormValue} name="analog_enabled" />}
label="Enable Analog Sensors"
label={LL.ENABLE_ANALOG()}
disabled={saving}
/>
<BlockFormControlLabel
control={<Checkbox checked={data.fahrenheit} onChange={updateFormValue} name="fahrenheit" />}
label="Convert temperature values to Fahrenheit"
label={LL.CONVERT_FAHRENHEIT()}
disabled={saving}
/>
<BlockFormControlLabel
control={<Checkbox checked={data.notoken_api} onChange={updateFormValue} name="notoken_api" />}
label="Bypass Access Token authorization on API calls"
label={LL.BYPASS_TOKEN()}
disabled={saving}
/>
<BlockFormControlLabel
control={<Checkbox checked={data.readonly_mode} onChange={updateFormValue} name="readonly_mode" />}
label="Enable read-only mode (blocks all outgoing EMS Tx Write commands)"
label={LL.READONLY()}
disabled={saving}
/>
<BlockFormControlLabel
control={<Checkbox checked={data.low_clock} onChange={updateFormValue} name="low_clock" />}
label="Underclock CPU speed"
label={LL.UNDERCLOCK_CPU()}
disabled={saving}
/>
<Grid container spacing={0} direction="row" justifyContent="flex-start" alignItems="flex-start">
<BlockFormControlLabel
control={<Checkbox checked={data.shower_timer} onChange={updateFormValue} name="shower_timer" />}
label="Enable Shower Timer"
label={LL.ENABLE_SHOWER_TIMER()}
disabled={saving}
/>
<BlockFormControlLabel
control={<Checkbox checked={data.shower_alert} onChange={updateFormValue} name="shower_alert" />}
label="Enable Shower Alert"
label={LL.ENABLE_SHOWER_ALERT()}
disabled={!data.shower_timer}
/>
{data.shower_alert && (
@@ -399,9 +396,9 @@ const SettingsApplication: FC = () => {
<ValidatedTextField
fieldErrors={fieldErrors}
name="shower_alert_trigger"
label="Trigger Time"
label={LL.TRIGGER_TIME()}
InputProps={{
endAdornment: <InputAdornment position="end">minutes</InputAdornment>
endAdornment: <InputAdornment position="end">{LL.MINUTES()}</InputAdornment>
}}
variant="outlined"
value={data.shower_alert_trigger}
@@ -414,9 +411,9 @@ const SettingsApplication: FC = () => {
<ValidatedTextField
fieldErrors={fieldErrors}
name="shower_alert_coldshot"
label="Cold Shot Duration"
label={LL.COLD_SHOT_DURATION()}
InputProps={{
endAdornment: <InputAdornment position="end">seconds</InputAdornment>
endAdornment: <InputAdornment position="end">{LL.SECONDS()}</InputAdornment>
}}
variant="outlined"
value={data.shower_alert_coldshot}
@@ -429,13 +426,13 @@ const SettingsApplication: FC = () => {
)}
</Grid>
<Typography sx={{ pt: 2 }} variant="h6" color="primary">
Formatting Options
{LL.FORMATTING_OPTIONS()}
</Typography>
<Grid container spacing={1} direction="row" justifyContent="flex-start" alignItems="flex-start">
<Grid item xs={4}>
<ValidatedTextField
name="bool_dashboard"
label="Boolean Format Dashboard"
label={LL.BOOLEAN_FORMAT_DASHBOARD()}
value={data.bool_dashboard}
fullWidth
variant="outlined"
@@ -452,7 +449,7 @@ const SettingsApplication: FC = () => {
<Grid item xs={4}>
<ValidatedTextField
name="bool_format"
label="Boolean Format API/MQTT"
label={LL.BOOLEAN_FORMAT_API()}
value={data.bool_format}
fullWidth
variant="outlined"
@@ -471,7 +468,7 @@ const SettingsApplication: FC = () => {
<Grid item xs={4}>
<ValidatedTextField
name="enum_format"
label="Enum Format API/MQTT"
label={LL.ENUM_FORMAT()}
value={data.enum_format}
fullWidth
variant="outlined"
@@ -479,29 +476,29 @@ const SettingsApplication: FC = () => {
margin="normal"
select
>
<MenuItem value={1}>Value</MenuItem>
<MenuItem value={2}>Index</MenuItem>
<MenuItem value={1}>{LL.VALUE()}</MenuItem>
<MenuItem value={2}>{LL.INDEX()}</MenuItem>
</ValidatedTextField>
</Grid>
</Grid>
{data.dallas_gpio !== 0 && (
<>
<Typography sx={{ pt: 2 }} variant="h6" color="primary">
Temperature Sensors
{LL.TEMP_SENSORS()}
</Typography>
<BlockFormControlLabel
control={<Checkbox checked={data.dallas_parasite} onChange={updateFormValue} name="dallas_parasite" />}
label="Enable parasite power"
label={LL.ENABLE_PARASITE()}
disabled={saving}
/>
</>
)}
<Typography sx={{ pt: 2 }} variant="h6" color="primary">
Logging
{LL.LOGGING()}
</Typography>
<BlockFormControlLabel
control={<Checkbox checked={data.trace_raw} onChange={updateFormValue} name="trace_raw" />}
label="Log EMS telegrams in hexadecimal"
label={LL.LOG_HEX()}
disabled={saving}
/>
<BlockFormControlLabel
@@ -513,7 +510,7 @@ const SettingsApplication: FC = () => {
disabled={saving}
/>
}
label="Enable Syslog"
label={LL.ENABLE_SYSLOG()}
/>
{data.syslog_enabled && (
<Grid container spacing={1} direction="row" justifyContent="flex-start" alignItems="flex-start">
@@ -568,9 +565,9 @@ const SettingsApplication: FC = () => {
<ValidatedTextField
fieldErrors={fieldErrors}
name="syslog_mark_interval"
label="Mark Interval"
label={LL.MARK_INTERVAL()}
InputProps={{
endAdornment: <InputAdornment position="end">seconds</InputAdornment>
endAdornment: <InputAdornment position="end">{LL.SECONDS()}</InputAdornment>
}}
fullWidth
variant="outlined"
@@ -584,9 +581,9 @@ const SettingsApplication: FC = () => {
</Grid>
)}
{restartNeeded && (
<MessageBox my={2} level="warning" message="EMS-ESP needs to be restarted to apply changed system settings">
<MessageBox my={2} level="warning" message={LL.RESTART_TEXT()}>
<Button startIcon={<PowerSettingsNewIcon />} variant="contained" color="error" onClick={restart}>
Restart
{LL.RESTART()}
</Button>
</MessageBox>
)}
@@ -600,7 +597,7 @@ const SettingsApplication: FC = () => {
type="submit"
onClick={validateAndSubmit}
>
Save
{LL.SAVE()}
</Button>
</ButtonRow>
)}
@@ -609,7 +606,7 @@ const SettingsApplication: FC = () => {
};
return (
<SectionContent title="Application Settings" titleGutter>
<SectionContent title={LL.APPLICATION_SETTINGS()} titleGutter>
{content()}
</SectionContent>
);