diff --git a/interface/src/i18n/de/index.ts b/interface/src/i18n/de/index.ts index c7a11cb9e..2974fc768 100644 --- a/interface/src/i18n/de/index.ts +++ b/interface/src/i18n/de/index.ts @@ -38,9 +38,11 @@ const de: Translation = { SAVE: 'Speichern', REMOVE: 'Entfernen', PROBLEM_UPDATING: 'Problem beim Aktualisieren', + PROBLEM_LOADING: 'Problem beim Holen', ACCESS_DENIED: 'Zugriff abgelehnt', ANALOG_SENSOR: 'Analoger Sensor{post}', TEMP_SENSOR: 'Temperatursensor{post}', + TEMP_SENSORS: 'Temperatursensoren', WRITE_COMMAND: 'Befehl schreiben {cmd}', EMS_BUS_WARNING: 'EMS-Bus getrennt. Wenn diese Warnung nach einigen Sekunden immer noch besteht, überprüfen Sie bitte die Einstellungen und das Board-Profil', @@ -52,7 +54,7 @@ const de: Translation = { EMS_SCAN: 'Möchten Sie wirklich einen vollständigen Gerätescan des EMS-Busses starten?', EMS_BUS_STATUS: 'EMS Bus Status', ACTIVE_DEVICES: 'Aktive Geräte und Sensoren', - DEVICE: 'Device', + DEVICE: 'Gerät', SUCCESS: 'ERFOLG', FAIL: 'SCHEITERN', QUALITY: 'QUALITÄT', @@ -75,7 +77,72 @@ const de: Translation = { NUM_DAYS: '{num} Tag{{en}}', NUM_SECONDS: '{num} Sekund{{en}}', NUM_HOURS: '{num} Stunde{{n}}', - NUM_MINUTES: '{num} Minute{{en}}' + NUM_MINUTES: '{num} Minute{{en}}', + APPLICATION_SETTINGS: 'Anwendungseinstellungen', + CUSTOMIZATION: 'Anpassung', + APPLICATION_RESTARTING: 'EMS-ESP startet neu', + BOARD_PROFILE_TEXT: + 'Wählen Sie ein vorkonfiguriertes Schnittstellenkartenprofil aus der Liste unten aus oder wählen Sie Benutzerdefiniert, um Ihre eigenen Hardwareeinstellungen zu konfigurieren', + BOARD_PROFILE: 'Board Profil', + BUTTON: 'Druckknopf', + TEMPERATURE: 'Temperatur', + DISABLED: 'deaktiviert', + GENERAL_OPTIONS: 'Allgemeine Optionen', + LANGUAGE_ENTITIES: 'Sprache (für Geräteentitäten)', + HIDE_LED: 'ausblenden LED', + ENABLE_TELNET: 'Ermöglichen Telnet Console', + ENABLE_ANALOG: 'Ermöglichen Analogsensorsen', + CONVERT_FAHRENHEIT: 'Konvertieren Sie Temperaturwerte in Fahrenheit', + BYPASS_TOKEN: 'Zugriffstoken-Autorisierung bei API-Aufrufen umgehen', + READONLY: 'Nur-Lese-Modus aktivieren (blockiert alle ausgehenden EMS Tx Write-Befehle)', + UNDERCLOCK_CPU: 'CPU-Geschwindigkeit untertakten', + ENABLE_SHOWER_TIMER: 'Duschtimer aktivieren', + ENABLE_SHOWER_ALERT: 'Duschalarm aktivieren', + TRIGGER_TIME: 'Auslösezeit', + COLD_SHOT_DURATION: 'Kaltschussdauer', + FORMATTING_OPTIONS: 'Formatierungsoptionen', + BOOLEAN_FORMAT_DASHBOARD: 'Dashboard im booleschen Format', + BOOLEAN_FORMAT_API: 'Boolesches Format API/MQTT', + ENUM_FORMAT: 'Enum Format API/MQTT', + INDEX: 'Index', + ENABLE_PARASITE: 'Parasiten-Power aktivieren', + LOGGING: 'Protokollierung', + LOG_HEX: 'EMS-Telegramme hexadezimal protokollieren', + ENABLE_SYSLOG: 'Syslog aktivieren', + MARK_INTERVAL: 'Intervallmarke', + SECONDS: 'sekunden', + MINUTES: 'minuten', + RESTART: 'Neu starten', + RESTART_TEXT: 'muss neu gestartet werden, um geänderte Systemeinstellungen zu übernehmen', + COMMAND: 'Befehl', + CUSTOMIZATIONS_RESTART: 'Alle Anpassungen wurden entfernt. Neustart...', + CUSTOMIZATIONS_FULL: 'Ausgewählte Entitäten haben das Limit von 60 überschritten. Bitte stapelweise speichern', + CUSTOMIZATIONS_SAVED: 'Anpassungen gespeichert', + CUSTOMIZATIONS_HELP_1: 'Wählen Sie ein Gerät aus und passen Sie die Entitäten mithilfe der Optionen an', + CUSTOMIZATIONS_HELP_2: 'als Favorit markieren', + CUSTOMIZATIONS_HELP_3: 'Schreibaktion deaktivieren', + CUSTOMIZATIONS_HELP_4: 'von MQTT und API ausschließen', + CUSTOMIZATIONS_HELP_5: 'Aus dem Dashboard ausblenden', + SELECT_DEVICE: 'Wählen Sie ein Gerät aus', + SET_ALL: 'setzen Sie alle', + OPTIONS: 'Optionen', + NAME: 'Name', + CUSTOMIZATIONS_RESET: + 'Möchten Sie wirklich alle Anpassungen entfernen, einschließlich der benutzerdefinierten Einstellungen der Temperatur- und Analogsensoren?', + DEVICE_ENTITIES: 'Geräteentitäten', + CONFIGURE: 'konfigurieren', + USER_CUSTOMIZATION: 'Benutzeranpassung', + SUPPORT_INFORMATION: 'Unterstützende Informationen', + HELP_INFORMATION_1: 'Besuchen Sie das Online', + HELP_INFORMATION_2: 'um Anweisungen zu erhalten, wie es geht', + HELP_INFORMATION_3: 'und auf andere Informationen zugreifen', + HELP_INFORMATION_4: 'Für einen Live-Community-Chat treten Sie unserem bei', + HELP_INFORMATION_5: 'Sende ein', + HELP_INFORMATION_6: 'Support-Problem', + HELP_INFORMATION_7: 'um eine neue Funktion anzufordern oder einen Fehler zu melden', + HELP_INFORMATION_8: 'Überzeugen Sie sich auch', + HELP_INFORMATION_9: 'und hängen Sie Ihre Systemdetails für eine schnellere Antwort an', + HELP_INFORMATION_10: 'EMS-ESP wird immer ein kostenloses Open-Source-Projekt sein. Bitte erwägen Sie, es mit einem ' }; export default de; diff --git a/interface/src/i18n/en/index.ts b/interface/src/i18n/en/index.ts index 2c750d07a..55b42ee6a 100644 --- a/interface/src/i18n/en/index.ts +++ b/interface/src/i18n/en/index.ts @@ -38,9 +38,11 @@ const en: BaseTranslation = { SAVE: 'Save', REMOVE: 'Remove', PROBLEM_UPDATING: 'Problem updating', + PROBLEM_LOADING: 'Problem loading', ACCESS_DENIED: 'Access Denied', ANALOG_SENSOR: 'Analog Sensor{post}', TEMP_SENSOR: 'Temperature Sensor{post}', + TEMP_SENSORS: 'Temperature Sensors', WRITE_COMMAND: 'Write command {cmd}', EMS_BUS_WARNING: 'EMS bus disconnected. If this warning still persists after a few seconds please check settings and board profile', @@ -75,7 +77,72 @@ const en: BaseTranslation = { NUM_DAYS: '{num} Day{{s}}', NUM_SECONDS: '{num} Second{{s}}', NUM_HOURS: '{num} Hour{{s}}', - NUM_MINUTES: '{num} Minute{{s}}' + NUM_MINUTES: '{num} Minute{{s}}', + APPLICATION_SETTINGS: 'Application Settings', + CUSTOMIZATION: 'Customization', + APPLICATION_RESTARTING: 'EMS-ESP is restarting', + BOARD_PROFILE_TEXT: + 'Select a pre-configured interface board profile from the list below or choose Custom to configure your own hardware settings', + BOARD_PROFILE: 'Board Profile', + BUTTON: 'Button', + TEMPERATURE: 'Temperature', + DISABLED: 'disabled', + GENERAL_OPTIONS: 'General Options', + LANGUAGE_ENTITIES: 'Language (for device entities)', + HIDE_LED: 'Hide LED', + ENABLE_TELNET: 'Enable Telnet Console', + ENABLE_ANALOG: 'Enable Analog Sensors', + CONVERT_FAHRENHEIT: 'Convert temperature values to Fahrenheit', + BYPASS_TOKEN: 'Bypass Access Token authorization on API calls', + READONLY: 'Enable read-only mode (blocks all outgoing EMS Tx Write commands)', + UNDERCLOCK_CPU: 'Underclock CPU speed', + ENABLE_SHOWER_TIMER: 'Enable Shower Timer', + ENABLE_SHOWER_ALERT: 'Enable Shower Alert', + TRIGGER_TIME: 'Trigger Time', + COLD_SHOT_DURATION: 'Cold Shot Duration', + FORMATTING_OPTIONS: 'Formatting Options', + BOOLEAN_FORMAT_DASHBOARD: 'Boolean Format Dashboard', + BOOLEAN_FORMAT_API: 'Boolean Format API/MQTT', + ENUM_FORMAT: 'Enum Format API/MQTT', + INDEX: 'Index', + ENABLE_PARASITE: 'Enable parasite power', + LOGGING: 'Logging', + LOG_HEX: 'Log EMS telegrams in hexadecimal', + ENABLE_SYSLOG: 'Enable Syslog', + MARK_INTERVAL: 'Mark Interval', + SECONDS: 'seconds', + MINUTES: 'minutes', + RESTART: 'Restart', + RESTART_TEXT: 'EMS-ESP needs to be restarted to apply changed system settings', + COMMAND: 'Command', + CUSTOMIZATIONS_RESTART: 'All customizations have been removed. Restarting...', + CUSTOMIZATIONS_FULL: 'Selected entities exceeded limit of 60. Please Save in batches', + CUSTOMIZATIONS_SAVED: 'Customizations saved', + CUSTOMIZATIONS_HELP_1: 'Select a device and customize the entities using the options', + CUSTOMIZATIONS_HELP_2: 'mark as favorite', + CUSTOMIZATIONS_HELP_3: 'disable write action', + CUSTOMIZATIONS_HELP_4: 'exclude from MQTT and API', + CUSTOMIZATIONS_HELP_5: 'hide from Dashboard', + SELECT_DEVICE: 'Select a device', + SET_ALL: 'set all', + OPTIONS: 'Options', + NAME: 'Name', + CUSTOMIZATIONS_RESET: + 'Are you sure you want remove all customizations including the custom settings of the Temperature and Analog sensors?', + DEVICE_ENTITIES: 'Device Entities', + CONFIGURE: 'configure', + USER_CUSTOMIZATION: 'User Customization', + SUPPORT_INFORMATION: 'Support Information', + HELP_INFORMATION_1: 'Visit the online', + HELP_INFORMATION_2: 'to get instructions on how to', + HELP_INFORMATION_3: 'and access other information', + HELP_INFORMATION_4: 'For live community chat join our', + HELP_INFORMATION_5: 'Submit a', + HELP_INFORMATION_6: 'support issue', + HELP_INFORMATION_7: 'for requesting a new feature or reporting a bug', + HELP_INFORMATION_8: 'Make sure you also', + HELP_INFORMATION_9: 'and attach your system details for a faster response', + HELP_INFORMATION_10: 'EMS-ESP will always be a free and open-source project. Please consider supporting it with a ' }; export default en; diff --git a/interface/src/i18n/i18n-types.ts b/interface/src/i18n/i18n-types.ts index 5ba575a00..bab8bbd9d 100644 --- a/interface/src/i18n/i18n-types.ts +++ b/interface/src/i18n/i18n-types.ts @@ -163,6 +163,10 @@ type RootTranslation = { * Problem updating */ PROBLEM_UPDATING: string + /** + * Problem loading + */ + PROBLEM_LOADING: string /** * Access Denied */ @@ -177,6 +181,10 @@ type RootTranslation = { * @param {unknown} post */ TEMP_SENSOR: RequiredParams<'post'> + /** + * Temperature Sensors + */ + TEMP_SENSORS: string /** * Write command {cmd} * @param {unknown} cmd @@ -315,6 +323,258 @@ type RootTranslation = { * @param {string | number | boolean} num */ NUM_MINUTES: RequiredParams<'num'> + /** + * Application Settings + */ + APPLICATION_SETTINGS: string + /** + * Customization + */ + CUSTOMIZATION: string + /** + * EMS-ESP is restarting + */ + APPLICATION_RESTARTING: string + /** + * Select a pre-configured interface board profile from the list below or choose Custom to configure your own hardware settings + */ + BOARD_PROFILE_TEXT: string + /** + * Board Profile + */ + BOARD_PROFILE: string + /** + * Button + */ + BUTTON: string + /** + * Temperature + */ + TEMPERATURE: string + /** + * disabled + */ + DISABLED: string + /** + * General Options + */ + GENERAL_OPTIONS: string + /** + * Language (for device entities) + */ + LANGUAGE_ENTITIES: string + /** + * Hide LED + */ + HIDE_LED: string + /** + * Enable Telnet Console + */ + ENABLE_TELNET: string + /** + * Enable Analog Sensors + */ + ENABLE_ANALOG: string + /** + * Convert temperature values to Fahrenheit + */ + CONVERT_FAHRENHEIT: string + /** + * Bypass Access Token authorization on API calls + */ + BYPASS_TOKEN: string + /** + * Enable read-only mode (blocks all outgoing EMS Tx Write commands) + */ + READONLY: string + /** + * Underclock CPU speed + */ + UNDERCLOCK_CPU: string + /** + * Enable Shower Timer + */ + ENABLE_SHOWER_TIMER: string + /** + * Enable Shower Alert + */ + ENABLE_SHOWER_ALERT: string + /** + * Trigger Time + */ + TRIGGER_TIME: string + /** + * Cold Shot Duration + */ + COLD_SHOT_DURATION: string + /** + * Formatting Options + */ + FORMATTING_OPTIONS: string + /** + * Boolean Format Dashboard + */ + BOOLEAN_FORMAT_DASHBOARD: string + /** + * Boolean Format API/MQTT + */ + BOOLEAN_FORMAT_API: string + /** + * Enum Format API/MQTT + */ + ENUM_FORMAT: string + /** + * Index + */ + INDEX: string + /** + * Enable parasite power + */ + ENABLE_PARASITE: string + /** + * Logging + */ + LOGGING: string + /** + * Log EMS telegrams in hexadecimal + */ + LOG_HEX: string + /** + * Enable Syslog + */ + ENABLE_SYSLOG: string + /** + * Mark Interval + */ + MARK_INTERVAL: string + /** + * seconds + */ + SECONDS: string + /** + * minutes + */ + MINUTES: string + /** + * Restart + */ + RESTART: string + /** + * EMS-ESP needs to be restarted to apply changed system settings + */ + RESTART_TEXT: string + /** + * Command + */ + COMMAND: string + /** + * All customizations have been removed. Restarting... + */ + CUSTOMIZATIONS_RESTART: string + /** + * Selected entities exceeded limit of 60. Please Save in batches + */ + CUSTOMIZATIONS_FULL: string + /** + * Customizations saved + */ + CUSTOMIZATIONS_SAVED: string + /** + * Select a device and customize the entities using the options + */ + CUSTOMIZATIONS_HELP_1: string + /** + * mark as favorite + */ + CUSTOMIZATIONS_HELP_2: string + /** + * disable write action + */ + CUSTOMIZATIONS_HELP_3: string + /** + * exclude from MQTT and API + */ + CUSTOMIZATIONS_HELP_4: string + /** + * hide from Dashboard + */ + CUSTOMIZATIONS_HELP_5: string + /** + * Select a device + */ + SELECT_DEVICE: string + /** + * set all + */ + SET_ALL: string + /** + * Options + */ + OPTIONS: string + /** + * Name + */ + NAME: string + /** + * Are you sure you want remove all customizations including the custom settings of the Temperature and Analog sensors? + */ + CUSTOMIZATIONS_RESET: string + /** + * Device Entities + */ + DEVICE_ENTITIES: string + /** + * configure + */ + CONFIGURE: string + /** + * User Customization + */ + USER_CUSTOMIZATION: string + /** + * Support Information + */ + SUPPORT_INFORMATION: string + /** + * Visit the online + */ + HELP_INFORMATION_1: string + /** + * to get instructions on how to + */ + HELP_INFORMATION_2: string + /** + * and access other information + */ + HELP_INFORMATION_3: string + /** + * For live community chat join our + */ + HELP_INFORMATION_4: string + /** + * Submit a + */ + HELP_INFORMATION_5: string + /** + * support issue + */ + HELP_INFORMATION_6: string + /** + * for requesting a new feature or reporting a bug + */ + HELP_INFORMATION_7: string + /** + * Make sure you also + */ + HELP_INFORMATION_8: string + /** + * and attach your system details for a faster response + */ + HELP_INFORMATION_9: string + /** + * EMS-ESP will always be a free and open-source project. Please consider supporting it with a + */ + HELP_INFORMATION_10: string } export type TranslationFunctions = { @@ -466,6 +726,10 @@ export type TranslationFunctions = { * Problem updating */ PROBLEM_UPDATING: () => LocalizedString + /** + * Problem loading + */ + PROBLEM_LOADING: () => LocalizedString /** * Access Denied */ @@ -478,6 +742,10 @@ export type TranslationFunctions = { * Temperature Sensor{post} */ TEMP_SENSOR: (arg: { post: unknown }) => LocalizedString + /** + * Temperature Sensors + */ + TEMP_SENSORS: () => LocalizedString /** * Write command {cmd} */ @@ -608,6 +876,258 @@ export type TranslationFunctions = { * {num} Minute{{s}} */ NUM_MINUTES: (arg: { num: string | number | boolean }) => LocalizedString + /** + * Application Settings + */ + APPLICATION_SETTINGS: () => LocalizedString + /** + * Customization + */ + CUSTOMIZATION: () => LocalizedString + /** + * EMS-ESP is restarting + */ + APPLICATION_RESTARTING: () => LocalizedString + /** + * Select a pre-configured interface board profile from the list below or choose Custom to configure your own hardware settings + */ + BOARD_PROFILE_TEXT: () => LocalizedString + /** + * Board Profile + */ + BOARD_PROFILE: () => LocalizedString + /** + * Button + */ + BUTTON: () => LocalizedString + /** + * Temperature + */ + TEMPERATURE: () => LocalizedString + /** + * disabled + */ + DISABLED: () => LocalizedString + /** + * General Options + */ + GENERAL_OPTIONS: () => LocalizedString + /** + * Language (for device entities) + */ + LANGUAGE_ENTITIES: () => LocalizedString + /** + * Hide LED + */ + HIDE_LED: () => LocalizedString + /** + * Enable Telnet Console + */ + ENABLE_TELNET: () => LocalizedString + /** + * Enable Analog Sensors + */ + ENABLE_ANALOG: () => LocalizedString + /** + * Convert temperature values to Fahrenheit + */ + CONVERT_FAHRENHEIT: () => LocalizedString + /** + * Bypass Access Token authorization on API calls + */ + BYPASS_TOKEN: () => LocalizedString + /** + * Enable read-only mode (blocks all outgoing EMS Tx Write commands) + */ + READONLY: () => LocalizedString + /** + * Underclock CPU speed + */ + UNDERCLOCK_CPU: () => LocalizedString + /** + * Enable Shower Timer + */ + ENABLE_SHOWER_TIMER: () => LocalizedString + /** + * Enable Shower Alert + */ + ENABLE_SHOWER_ALERT: () => LocalizedString + /** + * Trigger Time + */ + TRIGGER_TIME: () => LocalizedString + /** + * Cold Shot Duration + */ + COLD_SHOT_DURATION: () => LocalizedString + /** + * Formatting Options + */ + FORMATTING_OPTIONS: () => LocalizedString + /** + * Boolean Format Dashboard + */ + BOOLEAN_FORMAT_DASHBOARD: () => LocalizedString + /** + * Boolean Format API/MQTT + */ + BOOLEAN_FORMAT_API: () => LocalizedString + /** + * Enum Format API/MQTT + */ + ENUM_FORMAT: () => LocalizedString + /** + * Index + */ + INDEX: () => LocalizedString + /** + * Enable parasite power + */ + ENABLE_PARASITE: () => LocalizedString + /** + * Logging + */ + LOGGING: () => LocalizedString + /** + * Log EMS telegrams in hexadecimal + */ + LOG_HEX: () => LocalizedString + /** + * Enable Syslog + */ + ENABLE_SYSLOG: () => LocalizedString + /** + * Mark Interval + */ + MARK_INTERVAL: () => LocalizedString + /** + * seconds + */ + SECONDS: () => LocalizedString + /** + * minutes + */ + MINUTES: () => LocalizedString + /** + * Restart + */ + RESTART: () => LocalizedString + /** + * EMS-ESP needs to be restarted to apply changed system settings + */ + RESTART_TEXT: () => LocalizedString + /** + * Command + */ + COMMAND: () => LocalizedString + /** + * All customizations have been removed. Restarting... + */ + CUSTOMIZATIONS_RESTART: () => LocalizedString + /** + * Selected entities exceeded limit of 60. Please Save in batches + */ + CUSTOMIZATIONS_FULL: () => LocalizedString + /** + * Customizations saved + */ + CUSTOMIZATIONS_SAVED: () => LocalizedString + /** + * Select a device and customize the entities using the options + */ + CUSTOMIZATIONS_HELP_1: () => LocalizedString + /** + * mark as favorite + */ + CUSTOMIZATIONS_HELP_2: () => LocalizedString + /** + * disable write action + */ + CUSTOMIZATIONS_HELP_3: () => LocalizedString + /** + * exclude from MQTT and API + */ + CUSTOMIZATIONS_HELP_4: () => LocalizedString + /** + * hide from Dashboard + */ + CUSTOMIZATIONS_HELP_5: () => LocalizedString + /** + * Select a device + */ + SELECT_DEVICE: () => LocalizedString + /** + * set all + */ + SET_ALL: () => LocalizedString + /** + * Options + */ + OPTIONS: () => LocalizedString + /** + * Name + */ + NAME: () => LocalizedString + /** + * Are you sure you want remove all customizations including the custom settings of the Temperature and Analog sensors? + */ + CUSTOMIZATIONS_RESET: () => LocalizedString + /** + * Device Entities + */ + DEVICE_ENTITIES: () => LocalizedString + /** + * configure + */ + CONFIGURE: () => LocalizedString + /** + * User Customization + */ + USER_CUSTOMIZATION: () => LocalizedString + /** + * Support Information + */ + SUPPORT_INFORMATION: () => LocalizedString + /** + * Visit the online + */ + HELP_INFORMATION_1: () => LocalizedString + /** + * to get instructions on how to + */ + HELP_INFORMATION_2: () => LocalizedString + /** + * and access other information + */ + HELP_INFORMATION_3: () => LocalizedString + /** + * For live community chat join our + */ + HELP_INFORMATION_4: () => LocalizedString + /** + * Submit a + */ + HELP_INFORMATION_5: () => LocalizedString + /** + * support issue + */ + HELP_INFORMATION_6: () => LocalizedString + /** + * for requesting a new feature or reporting a bug + */ + HELP_INFORMATION_7: () => LocalizedString + /** + * Make sure you also + */ + HELP_INFORMATION_8: () => LocalizedString + /** + * and attach your system details for a faster response + */ + HELP_INFORMATION_9: () => LocalizedString + /** + * EMS-ESP will always be a free and open-source project. Please consider supporting it with a + */ + HELP_INFORMATION_10: () => LocalizedString } export type Formatters = {} diff --git a/interface/src/project/Help.tsx b/interface/src/project/Help.tsx index 494d9959c..1bb520668 100644 --- a/interface/src/project/Help.tsx +++ b/interface/src/project/Help.tsx @@ -18,7 +18,7 @@ const Help: FC = () => { return ( <> - + } /> diff --git a/interface/src/project/HelpInformation.tsx b/interface/src/project/HelpInformation.tsx index ae6de59de..65392e5f9 100644 --- a/interface/src/project/HelpInformation.tsx +++ b/interface/src/project/HelpInformation.tsx @@ -14,9 +14,13 @@ import DownloadIcon from '@mui/icons-material/GetApp'; import { extractErrorMessage } from '../utils'; +import { useI18nContext } from '../i18n/i18n-react'; + import * as EMSESP from './api'; const HelpInformation: FC = () => { + const { LL } = useI18nContext(); + const { enqueueSnackbar } = useSnackbar(); const saveFile = (json: any, endpoint: string) => { @@ -47,40 +51,40 @@ const HelpInformation: FC = () => { saveFile(response.data, endpoint); } } catch (error: unknown) { - enqueueSnackbar(extractErrorMessage(error, 'Problem with downloading'), { variant: 'error' }); + enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_LOADING()), { variant: 'error' }); } }; return ( - + - + - Visit the online  + {LL.HELP_INFORMATION_1()}  {'Wiki'} -  to get instructions on how to  +  {LL.HELP_INFORMATION_2()}  - {'configure'} + {LL.CONFIGURE()} -  EMS-ESP and access other information. + {' EMS-ESP ' + LL.HELP_INFORMATION_3() + '.'} - + - For live community chat join our  + {LL.HELP_INFORMATION_4()}  {'Discord'} @@ -90,33 +94,31 @@ const HelpInformation: FC = () => { - + - - Submit a  + {LL.HELP_INFORMATION_5()}  - support issue + {LL.HELP_INFORMATION_6()} -  for requesting a new feature or reporting a bug. +  {LL.HELP_INFORMATION_7()}.
- Make sure you also  + {LL.HELP_INFORMATION_8()}  -   and attach your system details for a faster response. +   {LL.HELP_INFORMATION_9()}.
- EMS-ESP will always be a free and open-source project -

Please consider supporting it with a  - on  + {LL.HELP_INFORMATION_10()} {'GitHub'} +
@proddy @MichaelDvP
diff --git a/interface/src/project/Settings.tsx b/interface/src/project/Settings.tsx index a4547fd86..51e8dadfe 100644 --- a/interface/src/project/Settings.tsx +++ b/interface/src/project/Settings.tsx @@ -19,8 +19,8 @@ const Settings: FC = () => { return ( <> - - + + } /> diff --git a/interface/src/project/SettingsApplication.tsx b/interface/src/project/SettingsApplication.tsx index 38efae3e3..efe05e2c9 100644 --- a/interface/src/project/SettingsApplication.tsx +++ b/interface/src/project/SettingsApplication.tsx @@ -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 ( <> - Interface Board Profile + Interface {LL.BOARD_PROFILE()} - - Select a pre-configured interface board profile from the list below or choose "Custom" to configure your own - hardware settings - + {LL.BOARD_PROFILE_TEXT()} { { { { margin="normal" select > - No Ethernet Module + {LL.DISABLED()} LAN8720 TLK110 @@ -235,7 +232,7 @@ const SettingsApplication: FC = () => { { )} - EMS Bus Settings + EMS Bus {LL.SETTINGS()} @@ -323,7 +320,7 @@ const SettingsApplication: FC = () => { - General Options + {LL.GENERAL_OPTIONS()} { > { size="small" select > - English - Deutsch + English (en) + Deutsch (de) {data.led_gpio !== 0 && ( } - label="Hide LED" + label={LL.HIDE_LED()} disabled={saving} /> )} } - label="Enable Telnet Console" + label={LL.ENABLE_TELNET()} disabled={saving} /> } - label="Enable Analog Sensors" + label={LL.ENABLE_ANALOG()} disabled={saving} /> } - label="Convert temperature values to Fahrenheit" + label={LL.CONVERT_FAHRENHEIT()} disabled={saving} /> } - label="Bypass Access Token authorization on API calls" + label={LL.BYPASS_TOKEN()} disabled={saving} /> } - label="Enable read-only mode (blocks all outgoing EMS Tx Write commands)" + label={LL.READONLY()} disabled={saving} /> } - label="Underclock CPU speed" + label={LL.UNDERCLOCK_CPU()} disabled={saving} /> } - label="Enable Shower Timer" + label={LL.ENABLE_SHOWER_TIMER()} disabled={saving} /> } - label="Enable Shower Alert" + label={LL.ENABLE_SHOWER_ALERT()} disabled={!data.shower_timer} /> {data.shower_alert && ( @@ -399,9 +396,9 @@ const SettingsApplication: FC = () => { minutes + endAdornment: {LL.MINUTES()} }} variant="outlined" value={data.shower_alert_trigger} @@ -414,9 +411,9 @@ const SettingsApplication: FC = () => { seconds + endAdornment: {LL.SECONDS()} }} variant="outlined" value={data.shower_alert_coldshot} @@ -429,13 +426,13 @@ const SettingsApplication: FC = () => { )} - Formatting Options + {LL.FORMATTING_OPTIONS()} { { { margin="normal" select > - Value - Index + {LL.VALUE()} + {LL.INDEX()} {data.dallas_gpio !== 0 && ( <> - Temperature Sensors + {LL.TEMP_SENSORS()} } - label="Enable parasite power" + label={LL.ENABLE_PARASITE()} disabled={saving} /> )} - Logging + {LL.LOGGING()} } - label="Log EMS telegrams in hexadecimal" + label={LL.LOG_HEX()} disabled={saving} /> { disabled={saving} /> } - label="Enable Syslog" + label={LL.ENABLE_SYSLOG()} /> {data.syslog_enabled && ( @@ -568,9 +565,9 @@ const SettingsApplication: FC = () => { seconds + endAdornment: {LL.SECONDS()} }} fullWidth variant="outlined" @@ -584,9 +581,9 @@ const SettingsApplication: FC = () => { )} {restartNeeded && ( - + )} @@ -600,7 +597,7 @@ const SettingsApplication: FC = () => { type="submit" onClick={validateAndSubmit} > - Save + {LL.SAVE()} )} @@ -609,7 +606,7 @@ const SettingsApplication: FC = () => { }; return ( - + {content()} ); diff --git a/interface/src/project/SettingsCustomization.tsx b/interface/src/project/SettingsCustomization.tsx index a314d45e9..18cd619e7 100644 --- a/interface/src/project/SettingsCustomization.tsx +++ b/interface/src/project/SettingsCustomization.tsx @@ -44,9 +44,13 @@ import { extractErrorMessage } from '../utils'; import { DeviceShort, Devices, DeviceEntity, DeviceEntityMask } from './types'; +import { useI18nContext } from '../i18n/i18n-react'; + export const APIURL = window.location.origin + '/api/'; const SettingsCustomization: FC = () => { + const { LL } = useI18nContext(); + const { enqueueSnackbar } = useSnackbar(); const [deviceEntities, setDeviceEntities] = useState([{ id: '', v: 0, n: '', m: 0, w: false }]); @@ -148,9 +152,9 @@ const SettingsCustomization: FC = () => { try { setDevices((await EMSESP.readDevices()).data); } catch (error: unknown) { - setErrorMessage(extractErrorMessage(error, 'Failed to fetch device list')); + setErrorMessage(extractErrorMessage(error, LL.PROBLEM_LOADING())); } - }, []); + }, [LL]); const setInitialMask = (data: DeviceEntity[]) => { setDeviceEntities(data.map((de) => ({ ...de, om: de.m }))); @@ -161,7 +165,7 @@ const SettingsCustomization: FC = () => { const data = (await EMSESP.readDeviceEntities({ id: unique_id })).data; setInitialMask(data); } catch (error: unknown) { - setErrorMessage(extractErrorMessage(error, 'Problem fetching device entities')); + setErrorMessage(extractErrorMessage(error, LL.PROBLEM_LOADING())); } }; @@ -184,7 +188,7 @@ const SettingsCustomization: FC = () => { if (de.n === undefined || de.n === de.id) { return de.id; } else if (de.n === '') { - return 'Command: ' + de.id; + return LL.COMMAND() + ': ' + de.id; } return ( <> @@ -250,9 +254,9 @@ const SettingsCustomization: FC = () => { const resetCustomization = async () => { try { await EMSESP.resetCustomizations(); - enqueueSnackbar('All customizations have been removed. Restarting...', { variant: 'info' }); + enqueueSnackbar(LL.CUSTOMIZATIONS_RESTART(), { variant: 'info' }); } catch (error: unknown) { - enqueueSnackbar(extractErrorMessage(error, 'Problem resetting customizations'), { variant: 'error' }); + enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_UPDATING()), { variant: 'error' }); } finally { setConfirmReset(false); } @@ -265,7 +269,7 @@ const SettingsCustomization: FC = () => { .map((new_de) => new_de.m.toString(16).padStart(2, '0') + new_de.id); if (masked_entities.length > 60) { - enqueueSnackbar('Selected entities exceeded limit of 60. Please Save in batches', { variant: 'warning' }); + enqueueSnackbar(LL.CUSTOMIZATIONS_FULL(), { variant: 'warning' }); return; } @@ -275,12 +279,12 @@ const SettingsCustomization: FC = () => { entity_ids: masked_entities }); if (response.status === 200) { - enqueueSnackbar('Customization saved', { variant: 'success' }); + enqueueSnackbar(LL.CUSTOMIZATIONS_SAVED(), { variant: 'success' }); } else { - enqueueSnackbar('Customization save failed', { variant: 'error' }); + enqueueSnackbar(LL.PROBLEM_UPDATING(), { variant: 'error' }); } } catch (error: unknown) { - enqueueSnackbar(extractErrorMessage(error, 'Problem sending entity list'), { variant: 'error' }); + enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_UPDATING()), { variant: 'error' }); } setInitialMask(deviceEntities); } @@ -294,21 +298,17 @@ const SettingsCustomization: FC = () => { return ( <> - Select a device and customize the entities using the options: + {LL.CUSTOMIZATIONS_HELP_1()}: - - =mark as favorite   - - =disable write action   - - =exclude from MQTT and API   - - =hide from Dashboard + ={LL.CUSTOMIZATIONS_HELP_2()}   + ={LL.CUSTOMIZATIONS_HELP_3()}   + ={LL.CUSTOMIZATIONS_HELP_4()}   + ={LL.CUSTOMIZATIONS_HELP_5()} { select > - Select a device... + {LL.SELECT_DEVICE()}... {devices.devices.map((device: DeviceShort, index) => ( @@ -401,7 +401,7 @@ const SettingsCustomization: FC = () => { color="inherit" onClick={() => maskDisabled(false)} > - set all  + {LL.SET_ALL()}  @@ -416,7 +416,7 @@ const SettingsCustomization: FC = () => { color="inherit" onClick={() => maskDisabled(true)} > - set all  + {LL.SET_ALL()}  @@ -428,7 +428,7 @@ const SettingsCustomization: FC = () => { <>
- OPTIONS + {LL.OPTIONS()} - VALUE + {LL.VALUE()}
@@ -503,14 +503,11 @@ const SettingsCustomization: FC = () => { const renderResetDialog = () => ( setConfirmReset(false)}> - Reset - - Are you sure you want remove all customizations including the custom settings of the Temperature and Analog - sensors? - + {LL.RESET()} + {LL.CUSTOMIZATIONS_RESET()} @@ -529,7 +526,7 @@ const SettingsCustomization: FC = () => { return ( <> - Device Entities + {LL.DEVICE_ENTITIES()} {renderDeviceList()} {renderDeviceData()} @@ -537,7 +534,7 @@ const SettingsCustomization: FC = () => { @@ -548,7 +545,7 @@ const SettingsCustomization: FC = () => { color="error" onClick={() => setConfirmReset(true)} > - Reset + {LL.RESET()} @@ -558,7 +555,7 @@ const SettingsCustomization: FC = () => { }; return ( - + {content()} );