From 307f33d8cc1fe9c5e173e94b8fbbea920c23c4bd Mon Sep 17 00:00:00 2001 From: Nikolay Korotkiy Date: Tue, 4 Jun 2024 08:35:19 +0400 Subject: [PATCH] Translate titles (#14) --- debian/changelog | 6 ++++++ debian/control | 4 ++-- wb-zigbee2mqtt.js | 14 ++++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 42629fd..cde126f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +wb-zigbee2mqtt (1.3.5) stable; urgency=medium + + * Translate titles + + -- Nikolay Korotkiy Mon, 03 Jun 2024 10:00:00 +0400 + wb-zigbee2mqtt (1.3.4) stable; urgency=medium * Avoid duplicated rules creation diff --git a/debian/control b/debian/control index ea0ecf0..d3d9aed 100644 --- a/debian/control +++ b/debian/control @@ -2,11 +2,11 @@ Source: wb-zigbee2mqtt Maintainer: Ian Ianin Section: misc Priority: optional -Standards-Version: 1.0.0 +Standards-Version: 3.9.4 Build-Depends: debhelper (>= 9), pkg-config Homepage: https://github.com/wirenboard/wb-zigbee2mqtt Package: wb-zigbee2mqtt Architecture: all -Depends: ${misc:Depends}, wb-rules (>= 2.6.0) +Depends: ${misc:Depends}, wb-rules (>= 2.20.0~~) Description: zigbee2mqtt to Wiren Board MQTT Conventions bridge diff --git a/wb-zigbee2mqtt.js b/wb-zigbee2mqtt.js index e687c8d..fca0b3e 100644 --- a/wb-zigbee2mqtt.js +++ b/wb-zigbee2mqtt.js @@ -16,28 +16,34 @@ var controlsTypes = { }; defineVirtualDevice('zigbee2mqtt', { - title: 'Zigbee2mqtt', + title: { en: 'Zigbee2mqtt converter', ru: 'Zigbee2mqtt конвертер' }, cells: { State: { + title: { en: 'State', ru: 'Состояние' }, type: 'text', value: '', }, 'Permit join': { + title: { en: 'Permit join', ru: 'Разрешить сопряжение' }, type: 'switch', value: false, }, 'Update devices': { + title: { en: 'Update devices', ru: 'Обновить устройства' }, type: 'pushbutton', }, Version: { + title: { en: 'Version', ru: 'Версия' }, type: 'text', value: '', }, 'Log level': { + title: { en: 'Log level', ru: 'Уровень логирования' }, type: 'text', value: '', }, Log: { + title: { en: 'Log', ru: 'Лог' }, type: 'text', value: '', }, @@ -135,7 +141,7 @@ function getControlType(controlName, controlsTypes) { return controlName in controlsTypes ? controlsTypes[controlName] : 'text'; } -function getContolValue(contolName, controlValue, controlsTypes) { +function getControlValue(contolName, controlValue, controlsTypes) { if (contolName in controlsTypes) return controlValue; if (controlValue == null) return ''; if (typeof controlValue === 'object') { @@ -155,11 +161,11 @@ function initTracker(deviceName) { if (!getDevice(deviceName).isControlExists(controlName)) { getDevice(deviceName).addControl(controlName, { type: getControlType(controlName, controlsTypes), - value: getContolValue(controlName, device[controlName], controlsTypes), + value: getControlValue(controlName, device[controlName], controlsTypes), readonly: true, }); } else { - dev[deviceName][controlName] = getContolValue( + dev[deviceName][controlName] = getControlValue( controlName, device[controlName], controlsTypes