fix to the translation of the webUI in Polish.

Everything visible should already be translated into Polish. However, I was not able to check how the translations of all errors are displayed (because how to display them if there is no error?), so I'm not sure that they are ok.
BTW, there are still many error messages hardcoded (e.g. "Local IP is required"). I think we should translate them as well.
This commit is contained in:
pswid
2022-11-03 12:34:32 +01:00
parent bdce4ee9f9
commit 069df92dbf
17 changed files with 359 additions and 173 deletions

View File

@@ -559,11 +559,11 @@ const DashboardData: FC = () => {
offset: sensor.o
});
if (response.status === 204) {
enqueueSnackbar(LL.UPLOAD_OF(LL.TEMP_SENSOR()) + ' ' + LL.FAILED(), { variant: 'error' });
enqueueSnackbar(LL.UPLOAD_OF(LL.TEMP_SENSOR(0)) + ' ' + LL.FAILED(), { variant: 'error' });
} else if (response.status === 403) {
enqueueSnackbar(LL.ACCESS_DENIED(), { variant: 'error' });
} else {
enqueueSnackbar(LL.UPDATED_OF(LL.TEMP_SENSOR()), { variant: 'success' });
enqueueSnackbar(LL.UPDATED_OF(LL.TEMP_SENSOR(0)), { variant: 'success' });
}
setSensor(undefined);
} catch (error) {
@@ -580,11 +580,11 @@ const DashboardData: FC = () => {
return (
<Dialog open={sensor !== undefined} onClose={() => setSensor(undefined)}>
<DialogTitle>
{LL.EDIT()} {LL.TEMP_SENSOR()}
{LL.EDIT()} {LL.TEMP_SENSOR(0)}
</DialogTitle>
<DialogContent dividers>
<Box color="warning.main" p={0} pl={0} pr={0} mt={0} mb={2}>
<Typography variant="body2">Sensor ID: {sensor.id}</Typography>
<Typography variant="body2">{LL.ID_OF(LL.TEMP_SENSOR(1))}: {sensor.id}</Typography>
</Box>
<Grid container spacing={1}>
<Grid item>
@@ -649,22 +649,22 @@ const DashboardData: FC = () => {
<ListItemText primary={LL.TYPE()} secondary={coreData.devices[deviceDialog].t} />
</ListItem>
<ListItem>
<ListItemText primary={LL.NAME()} secondary={coreData.devices[deviceDialog].n} />
<ListItemText primary={LL.NAME(0)} secondary={coreData.devices[deviceDialog].n} />
</ListItem>
<ListItem>
<ListItemText primary={LL.BRAND()} secondary={coreData.devices[deviceDialog].b} />
</ListItem>
<ListItem>
<ListItemText
primary="Device ID"
primary={LL.ID_OF(LL.DEVICE())}
secondary={'0x' + ('00' + coreData.devices[deviceDialog].d.toString(16).toUpperCase()).slice(-2)}
/>
</ListItem>
<ListItem>
<ListItemText primary="Product ID" secondary={coreData.devices[deviceDialog].p} />
<ListItemText primary={LL.ID_OF(LL.PRODUCT())} secondary={coreData.devices[deviceDialog].p} />
</ListItem>
<ListItem>
<ListItemText primary="Version" secondary={coreData.devices[deviceDialog].v} />
<ListItemText primary={LL.VERSION()} secondary={coreData.devices[deviceDialog].v} />
</ListItem>
</List>
</DialogContent>

View File

@@ -133,7 +133,7 @@ const SettingsApplication: FC = () => {
{boardProfileSelectItems()}
<Divider />
<MenuItem key={'CUSTOM'} value={'CUSTOM'}>
Custom&hellip;
{LL.CUSTOM()}&hellip;
</MenuItem>
</ValidatedTextField>
{data.board_profile === 'CUSTOM' && (
@@ -143,7 +143,7 @@ const SettingsApplication: FC = () => {
<ValidatedTextField
fieldErrors={fieldErrors}
name="rx_gpio"
label="Rx GPIO"
label={LL.GPIO_OF('Rx')}
fullWidth
variant="outlined"
value={numberValue(data.rx_gpio)}
@@ -157,7 +157,7 @@ const SettingsApplication: FC = () => {
<ValidatedTextField
fieldErrors={fieldErrors}
name="tx_gpio"
label="Tx GPIO"
label={LL.GPIO_OF('Tx')}
fullWidth
variant="outlined"
value={numberValue(data.tx_gpio)}
@@ -171,7 +171,7 @@ const SettingsApplication: FC = () => {
<ValidatedTextField
fieldErrors={fieldErrors}
name="pbutton_gpio"
label={LL.BUTTON() + ' GPIO'}
label={LL.GPIO_OF(LL.BUTTON())}
fullWidth
variant="outlined"
value={numberValue(data.pbutton_gpio)}
@@ -185,7 +185,7 @@ const SettingsApplication: FC = () => {
<ValidatedTextField
fieldErrors={fieldErrors}
name="dallas_gpio"
label={LL.TEMPERATURE() + ' GPIO (0=' + LL.DISABLED() + ')'}
label={LL.GPIO_OF(LL.TEMPERATURE()) + ' (0=' + LL.DISABLED(1) + ')'}
fullWidth
variant="outlined"
value={numberValue(data.dallas_gpio)}
@@ -199,7 +199,7 @@ const SettingsApplication: FC = () => {
<ValidatedTextField
fieldErrors={fieldErrors}
name="led_gpio"
label={'LED GPIO (0=' + LL.DISABLED() + ')'}
label={LL.GPIO_OF('LED') + ' (0=' + LL.DISABLED(1) + ')'}
fullWidth
variant="outlined"
value={numberValue(data.led_gpio)}
@@ -222,7 +222,7 @@ const SettingsApplication: FC = () => {
margin="normal"
select
>
<MenuItem value={0}>{LL.DISABLED()}</MenuItem>
<MenuItem value={0}>{LL.DISABLED(1)}</MenuItem>
<MenuItem value={1}>LAN8720</MenuItem>
<MenuItem value={2}>TLK110</MenuItem>
</ValidatedTextField>
@@ -232,7 +232,7 @@ const SettingsApplication: FC = () => {
<Grid item>
<ValidatedTextField
name="eth_power"
label={'Eth Power GPIO (-1=' + LL.DISABLED() + ')'}
label={LL.GPIO_OF('PHY Power') + ' (-1=' + LL.DISABLED(1) + ')'}
fullWidth
variant="outlined"
value={numberValue(data.eth_power)}
@@ -245,7 +245,7 @@ const SettingsApplication: FC = () => {
<Grid item>
<ValidatedTextField
name="eth_phy_addr"
label="Eth I²C Address"
label={LL.ADDRESS_OF('PHY I²C')}
fullWidth
variant="outlined"
value={numberValue(data.eth_phy_addr)}
@@ -258,7 +258,7 @@ const SettingsApplication: FC = () => {
<Grid item>
<ValidatedTextField
name="eth_clock_mode"
label="Eth Clk Mode"
label="PHY Clk"
disabled={saving}
value={data.eth_clock_mode}
fullWidth
@@ -278,7 +278,7 @@ const SettingsApplication: FC = () => {
</>
)}
<Typography variant="h6" color="primary">
{LL.SETTINGS_OF('EMS BUS')}
{LL.SETTINGS_OF(LL.EMS_BUS(0))}
</Typography>
<Grid container spacing={1} direction="row" justifyContent="flex-start" alignItems="flex-start">
<Grid item xs={6}>
@@ -296,13 +296,13 @@ const SettingsApplication: FC = () => {
<MenuItem value={1}>EMS</MenuItem>
<MenuItem value={2}>EMS+</MenuItem>
<MenuItem value={3}>HT3</MenuItem>
<MenuItem value={4}>Hardware</MenuItem>
<MenuItem value={4}>{LL.HARDWARE()}</MenuItem>
</ValidatedTextField>
</Grid>
<Grid item xs={6}>
<ValidatedTextField
name="ems_bus_id"
label="Bus ID"
label={LL.ID_OF(LL.EMS_BUS(1))}
disabled={saving}
value={data.ems_bus_id}
fullWidth

View File

@@ -66,7 +66,7 @@ const SettingsCustomization: FC = () => {
const entities_theme = useTheme({
Table: `
--data-table-library_grid-template-columns: 120px repeat(1, minmax(80px, 1fr)) 40px 40px 120px;
--data-table-library_grid-template-columns: 120px repeat(1, minmax(80px, 1fr)) 45px 45px 120px;
`,
BaseRow: `
font-size: 14px;
@@ -455,11 +455,11 @@ const SettingsCustomization: FC = () => {
<HeaderCell stiff>{LL.OPTIONS()}</HeaderCell>
<HeaderCell resize>
<Button fullWidth style={{ fontSize: '14px', justifyContent: 'flex-start' }}>
{LL.NAME()}
{LL.NAME(1)}
</Button>
</HeaderCell>
<HeaderCell stiff>min</HeaderCell>
<HeaderCell stiff>max</HeaderCell>
<HeaderCell stiff>{LL.MIN()}</HeaderCell>
<HeaderCell stiff>{LL.MAX()}</HeaderCell>
<HeaderCell resize>{LL.VALUE(0)}</HeaderCell>
</HeaderRow>
</Header>
@@ -582,7 +582,7 @@ const SettingsCustomization: FC = () => {
const de = deviceEntity;
return (
<Dialog open={!!deviceEntity} onClose={() => setDeviceEntity(undefined)}>
<DialogTitle>{LL.EDIT() + ' ' + LL.ENTITY() + ' ' + de.id}</DialogTitle>
<DialogTitle>{LL.EDIT() + ' ' + LL.ENTITY() + ' "' + de.id + '"'}</DialogTitle>
<DialogContent dividers>
<ToggleButtonGroup
@@ -628,14 +628,14 @@ const SettingsCustomization: FC = () => {
<Box color="warning.main" p={0} pl={0} pr={0} mt={2} mb={2}>
<Typography variant="body2">
{LL.DEFAULT() + ' ' + LL.NAME()}:&nbsp;{deviceEntity.n}
{LL.DEFAULT(1) + ' ' + LL.NAME(1)}:&nbsp;{deviceEntity.n}
</Typography>
</Box>
<Grid container spacing={1}>
<Grid item>
<TextField
name="cn"
label={LL.RENAME() + ' ' + LL.ENTITY()}
label={LL.NEW_NAME_OF(LL.ENTITY())}
value={deviceEntity.cn}
autoFocus
sx={{ width: '30ch' }}
@@ -647,7 +647,7 @@ const SettingsCustomization: FC = () => {
<Grid item>
<TextField
name="mi"
label="min"
label={LL.MIN()}
value={deviceEntity.mi}
sx={{ width: '8ch' }}
onChange={updateValue(setDeviceEntity)}
@@ -656,7 +656,7 @@ const SettingsCustomization: FC = () => {
<Grid item>
<TextField
name="ma"
label="max"
label={LL.MAX()}
value={deviceEntity.ma}
sx={{ width: '8ch' }}
onChange={updateValue(setDeviceEntity)}