From 9d4697d7965fca080d1d7c5361b6ae96c70f6a62 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sat, 31 Aug 2019 22:08:22 +0200 Subject: [PATCH] Make rule templates translatable --- .../ruletemplates/ruletemplates.cpp | 9 +- messages.sh | 45 +++ nymea-app/main.cpp | 2 +- nymea-app/nymea-app.pro | 11 +- nymea-app/ruletemplates/messages.h | 54 +++ nymea-app/translations/nymea-app-de.ts | 307 ++++++++++++++++ nymea-app/translations/nymea-app-en_US.ts | 307 ++++++++++++++++ nymea-app/translations/nymea-app-ko.ts | 332 +++++++++++++++++- nymea-app/ui/Nymea.qml | 4 + 9 files changed, 1051 insertions(+), 20 deletions(-) create mode 100755 messages.sh create mode 100644 nymea-app/ruletemplates/messages.h diff --git a/libnymea-app-core/ruletemplates/ruletemplates.cpp b/libnymea-app-core/ruletemplates/ruletemplates.cpp index 6ec4fd20..6c0b345e 100644 --- a/libnymea-app-core/ruletemplates/ruletemplates.cpp +++ b/libnymea-app-core/ruletemplates/ruletemplates.cpp @@ -14,6 +14,7 @@ #include #include #include +#include RuleTemplates::RuleTemplates(QObject *parent) : QAbstractListModel(parent) { @@ -44,7 +45,13 @@ RuleTemplates::RuleTemplates(QObject *parent) : QAbstractListModel(parent) QVariantMap ruleTemplate = ruleTemplateVariant.toMap(); // RuleTemplate base - t = new RuleTemplate(ruleTemplate.value("interfaceName").toString(), ruleTemplate.value("description").toString(), ruleTemplate.value("ruleNameTemplate").toString(), this); + QString descriptionContext = QString("description for %0").arg(QFileInfo(templateFile).baseName()); + QString nameTemplateContext = QString("ruleNameTemplate for %0").arg(QFileInfo(templateFile).baseName()); + t = new RuleTemplate(ruleTemplate.value("interfaceName").toString(), + qApp->translate(descriptionContext.toUtf8(), ruleTemplate.value("description").toByteArray()), + qApp->translate(nameTemplateContext.toUtf8(), ruleTemplate.value("ruleNameTemplate").toByteArray()), + this); + qDebug() << "Loading rule template" << ruleTemplate.value("description").toString() << tr(ruleTemplate.value("description").toByteArray()); // EventDescriptorTemplate foreach (const QVariant &eventDescriptorVariant, ruleTemplate.value("eventDescriptorTemplates").toList()) { diff --git a/messages.sh b/messages.sh new file mode 100755 index 00000000..a6dc4bc7 --- /dev/null +++ b/messages.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# Script to update translation files +# Generates ruletemplates/messages.h and calls lupdate on the entire project +# Ideally this would eventually be called in the CI when building the packages +# However, this will break not find all translations when ran with Qt < 5.9 +# so for now this is ran manually all the time and results are committed to the +# repository + +OUT="nymea-app/ruletemplates/messages.h" + +echo "// This file is generated. Update it using ./messages.sh in the root source directory" > $OUT +echo "#include " >> $OUT +echo "const QString translations[] {" >> $OUT + + +for INPUTFILE in `ls nymea-app/ruletemplates/*json`; do + echo "Extracting strings from ruletemplate file $INPUTFILE" + + FILEBASENAME=$(basename -- "$INPUTFILE") + FILEBASENAME="${FILEBASENAME%.*}" + + while IFS= read -r LINE + do + if [[ $LINE == *"\"description\""* ]] || [[ $LINE == *"\"ruleNameTemplate\""* ]]; then + if [ $HASCONTENT -eq 1 ]; then + echo "," >> $OUT + fi + TYPE=`echo $LINE | cut -d ":" -f 1 | sed 's/"//g'` + STRING=`echo $LINE | cut -d ":" -f 2 | sed 's/,$//'` + echo -n "QT_TRANSLATE_NOOP(" >> $OUT + echo -n "\"$TYPE for $FILEBASENAME\", " >> $OUT + echo -n $STRING >> $OUT + echo -n ")" >> $OUT + HASCONTENT=1 + fi + done < "$INPUTFILE" + +done + +echo "" >> $OUT +echo "};" >> $OUT + + +lupdate nymea-app.pro diff --git a/nymea-app/main.cpp b/nymea-app/main.cpp index 6c356838..7c394a40 100644 --- a/nymea-app/main.cpp +++ b/nymea-app/main.cpp @@ -41,7 +41,7 @@ #include "stylecontroller.h" #include "pushnotifications.h" #include "applogcontroller.h" - +#include "ruletemplates/messages.h" QObject *platformHelperProvider(QQmlEngine *engine, QJSEngine *scriptEngine) { diff --git a/nymea-app/nymea-app.pro b/nymea-app/nymea-app.pro index 54c05c60..bc4a0a50 100644 --- a/nymea-app/nymea-app.pro +++ b/nymea-app/nymea-app.pro @@ -22,7 +22,8 @@ HEADERS += \ pushnotifications.h \ platformhelper.h \ platformintegration/generic/platformhelpergeneric.h \ - applogcontroller.h + applogcontroller.h \ + ruletemplates/messages.h SOURCES += main.cpp \ platformintegration/generic/raspberrypihelper.cpp \ @@ -130,11 +131,3 @@ BR=$$BRANDING target.path = /usr/bin INSTALLS += target - -DISTFILES += \ - ruletemplates/doorbellruletemplates.json \ - ruletemplates/smartmetertemplates.json \ - ruletemplates/presencesensortemplates.json \ - ruletemplates/daylightsensor.json \ - ruletemplates/lighttemplates.json - diff --git a/nymea-app/ruletemplates/messages.h b/nymea-app/ruletemplates/messages.h new file mode 100644 index 00000000..005eae99 --- /dev/null +++ b/nymea-app/ruletemplates/messages.h @@ -0,0 +1,54 @@ +// This file is generated. Update it using ./messages.sh in the root source directory +#include +const QString translations[] { +QT_TRANSLATE_NOOP("description for accesscontroltemplates", "Alert me on denied access attempts"), +QT_TRANSLATE_NOOP("ruleNameTemplate for accesscontroltemplates", "Denied access attempt on %0"), +QT_TRANSLATE_NOOP("description for accesscontroltemplates", "Notify my about access"), +QT_TRANSLATE_NOOP("ruleNameTemplate for accesscontroltemplates", "Access granted on %0"), +QT_TRANSLATE_NOOP("description for accesscontroltemplates", "Notify my about user access"), +QT_TRANSLATE_NOOP("ruleNameTemplate for accesscontroltemplates", "Access granted to user on %0"), +QT_TRANSLATE_NOOP("description for buttontemplates", "Turn on a light"), +QT_TRANSLATE_NOOP("ruleNameTemplate for buttontemplates", "%0 turns on %1"), +QT_TRANSLATE_NOOP("description for buttontemplates", "Turn off a light"), +QT_TRANSLATE_NOOP("ruleNameTemplate for buttontemplates", "%0 turns off %1"), +QT_TRANSLATE_NOOP("description for buttontemplates", "Switch a light"), +QT_TRANSLATE_NOOP("ruleNameTemplate for buttontemplates", "%0 switches %1"), +QT_TRANSLATE_NOOP("description for buttontemplates", "Turn off all lights"), +QT_TRANSLATE_NOOP("ruleNameTemplate for buttontemplates", "Turn off everything with %0"), +QT_TRANSLATE_NOOP("description for daylightsensor", "Turn on a light while it's dark outside"), +QT_TRANSLATE_NOOP("ruleNameTemplate for daylightsensor", "Turn on %1 while it's dark outside"), +QT_TRANSLATE_NOOP("description for daylightsensor", "Turn on a light when it gets dark outside"), +QT_TRANSLATE_NOOP("ruleNameTemplate for daylightsensor", "Turn on %1 when it gets dark outside (%0)"), +QT_TRANSLATE_NOOP("description for daylightsensor", "Turn on all lights when it gets dark outside"), +QT_TRANSLATE_NOOP("ruleNameTemplate for daylightsensor", "Turn on all lights when it gets dark outside"), +QT_TRANSLATE_NOOP("description for doorbellruletemplates", "Alert on doorbell ring"), +QT_TRANSLATE_NOOP("ruleNameTemplate for doorbellruletemplates", "Alert %1 when someone is at %0"), +QT_TRANSLATE_NOOP("description for mediatemplates", "Dim light while watching TV"), +QT_TRANSLATE_NOOP("ruleNameTemplate for mediatemplates", "%0 dims %1 for movie time"), +QT_TRANSLATE_NOOP("description for notificationtemplates", "Notify me when a device runs out of battery"), +QT_TRANSLATE_NOOP("ruleNameTemplate for notificationtemplates", "Low battery alert for %0"), +QT_TRANSLATE_NOOP("description for notificationtemplates", "Notify me when something runs dry"), +QT_TRANSLATE_NOOP("ruleNameTemplate for notificationtemplates", "Notify %1 when %0 runs dry"), +QT_TRANSLATE_NOOP("description for notificationtemplates", "Notify me when a thing gets disconnected"), +QT_TRANSLATE_NOOP("ruleNameTemplate for notificationtemplates", "Disconnect alert for %0"), +QT_TRANSLATE_NOOP("description for notificationtemplates", "Notify me when a thing connects"), +QT_TRANSLATE_NOOP("ruleNameTemplate for notificationtemplates", "Connection notification for %0"), +QT_TRANSLATE_NOOP("description for presencesensortemplates", "Turn on something while being present"), +QT_TRANSLATE_NOOP("ruleNameTemplate for presencesensortemplates", "Turn on %1 while %0 reports presence"), +QT_TRANSLATE_NOOP("description for presencesensortemplates", "Turn off something when leaving"), +QT_TRANSLATE_NOOP("ruleNameTemplate for presencesensortemplates", "Turn off %1 when %0 reports leaving"), +QT_TRANSLATE_NOOP("description for presencesensortemplates", "Turn off everything when leaving"), +QT_TRANSLATE_NOOP("ruleNameTemplate for presencesensortemplates", "Turn off everything when %0 reports leaving"), +QT_TRANSLATE_NOOP("description for presencesensortemplates", "Turn off all lights when leaving"), +QT_TRANSLATE_NOOP("ruleNameTemplate for presencesensortemplates", "Turn off all lights when %0 reports leaving"), +QT_TRANSLATE_NOOP("description for presencesensortemplates", "Turn on something when arriving"), +QT_TRANSLATE_NOOP("ruleNameTemplate for presencesensortemplates", "Turn on %1 when %0 reports arriving"), +QT_TRANSLATE_NOOP("description for smartmetertemplates", "Charge my car while producing energy"), +QT_TRANSLATE_NOOP("ruleNameTemplate for smartmetertemplates", "Smart car charging"), +QT_TRANSLATE_NOOP("description for smartmetertemplates", "Turn on heating while producing energy"), +QT_TRANSLATE_NOOP("ruleNameTemplate for smartmetertemplates", "Smart heating"), +QT_TRANSLATE_NOOP("description for template", ""), +QT_TRANSLATE_NOOP("ruleNameTemplate for template", "%0 ..."), +QT_TRANSLATE_NOOP("description for thermostattemplates", "Set temperature while I'm home"), +QT_TRANSLATE_NOOP("ruleNameTemplate for thermostattemplates", "Set temperature while I'm home") +}; diff --git a/nymea-app/translations/nymea-app-de.ts b/nymea-app/translations/nymea-app-de.ts index d68bdc48..00a2cd0d 100644 --- a/nymea-app/translations/nymea-app-de.ts +++ b/nymea-app/translations/nymea-app-de.ts @@ -716,6 +716,14 @@ Log in to %1:cloud in order to connect to %1:core systems from anywhere. Melde Dich bei %1:cloud an um von überall aus auf Deine %1:core Systeme zugreifen zu können. + + Failed to connect to the login server. Please mase sure your network connection is working. + Fehler beim verbinden zum Login-Server. Bitte stelle sicher, dass Deine Netzwerkverbindung funktioniert. + + + An unexpected error happened. Please report this isse. Error code: + Ein Unerwartetet Fehler ist aufgetreten. Bitte benachrichtige uns darüber. Fehler code: + CloudSettingsPage @@ -1345,6 +1353,13 @@ %1 installiert + + DoorbellDevicePage + + History + Verlauf + + EditCalendarItemPage @@ -3338,6 +3353,13 @@ Möchtest Du fortfahren? OK + + NewMagicPage + + New magic + Neue Magie + + NewThingMagicPage @@ -3348,6 +3370,10 @@ Möchtest Du fortfahren? Create some magic manually Magie manuell erstellen + + New magic for %1 + Neue Magie für %1 + NewThingPage @@ -3564,6 +3590,34 @@ Möchtest Du fortfahren? presence sensor Anwesenheitssensor + + Doorbells + Türklingeln + + + doorbell + Türklingel + + + alert + Alarm + + + button + Taster + + + access control + Zugangskontrolle + + + smart meter + Smart Meter + + + media player + Medienabspielgerät + NymeaConnection @@ -5005,6 +5059,129 @@ Bitte warte bis diese abgeschlossen ist. Verbinde zu %1:core + + description for accesscontroltemplates + + Alert me on denied access attempts + Benachritige mich bei Fehlgeschlagenen Zutrittsversuchen + + + Notify my about access + Benachrichtige me über Zugänge + + + Notify my about user access + Benachrichtige mich über Benutzerzugang + + + + description for buttontemplates + + Turn on a light + Ein Licht einschalten + + + Turn off a light + Ein Licht ausschalten + + + Switch a light + Ein Licht schalten + + + Turn off all lights + Alle Lichter ausschalten + + + + description for daylightsensor + + Turn on a light while it's dark outside + Ein Licht einschalten während es dunkel ist + + + Turn on a light when it gets dark outside + Ein Licht einschalten wenn es dunkel wird + + + Turn on all lights when it gets dark outside + Alle Lichter einschlalten wenn es dunkel wird + + + + description for doorbellruletemplates + + Alert on doorbell ring + Signal bei Türklingelbetätigung + + + + description for mediatemplates + + Dim light while watching TV + Licht dimmen während TV-Wiedergabe + + + + description for notificationtemplates + + Notify me when a device runs out of battery + Benachrichtige mich wenn sich die Batterie eines Gerätes zu Ende neight + + + Notify me when something runs dry + Benachrichte mich wenn etwas austrocknet + + + Notify me when a thing gets disconnected + Benachrichtuge mich wenn ein Gerät die Verbindung verliert + + + Notify me when a thing connects + Benachrichtige mich wenn sich ein Gerät verbindet + + + + description for presencesensortemplates + + Turn on something while being present + Etwas einschalten während Anwesenheit + + + Turn off something when leaving + Etwas ausschalten beim Verlassen + + + Turn off everything when leaving + Alles ausschalten beim Verlassen + + + Turn off all lights when leaving + Alle Lichter beim Verlassen ausschalten + + + Turn on something when arriving + Etwas einschalten bei Ankunft + + + + description for smartmetertemplates + + Charge my car while producing energy + Fahrzeug laden während Strom erzeugt wird + + + Turn on heating while producing energy + Heizung einschalten während Strom erzeugt wird + + + + description for thermostattemplates + + Set temperature while I'm home + Temperatur einstellen während ich zuhause bin + + main @@ -5064,4 +5241,134 @@ Bitte warte bis diese abgeschlossen ist. OK + + ruleNameTemplate for accesscontroltemplates + + Denied access attempt on %0 + Verweigerter Zutrittsversuch bei %0 + + + Access granted on %0 + Zugang erteikt bei %0 + + + Access granted to user on %0 + Zuggang für Benutzer bei %0 erlaubt + + + + ruleNameTemplate for buttontemplates + + %0 turns on %1 + 0% schaltet %1 ein + + + %0 turns off %1 + %0 schaltet %1 aus + + + %0 switches %1 + %0 schaltet %1 + + + Turn off everything with %0 + Alles ausschalten mit %0 + + + + ruleNameTemplate for daylightsensor + + Turn on %1 while it's dark outside + %1 einschalten während es drausen dunkel ist + + + Turn on %1 when it gets dark outside (%0) + Schalte %1 ein wenn es drausen dunkel wird (%0) + + + Turn on all lights when it gets dark outside + Alle Lichter einschalten wenn es drausen dunkel wird + + + + ruleNameTemplate for doorbellruletemplates + + Alert %1 when someone is at %0 + Signal bei %1 wenn jemand bei %0 ist + + + + ruleNameTemplate for mediatemplates + + %0 dims %1 for movie time + %0 dimmt %1 für Fernsehzeit + + + + ruleNameTemplate for notificationtemplates + + Low battery alert for %0 + Batterieladung kritisch bei %0 + + + Notify %1 when %0 runs dry + Benachrichtige %1 wenn %0 austrocknet + + + Disconnect alert for %0 + %0 wurde getrennt + + + Connection notification for %0 + %0 wurde verbunden + + + + ruleNameTemplate for presencesensortemplates + + Turn on %1 while %0 reports presence + %1 einschalten während %0 Anwesenheit registriert + + + Turn off %1 when %0 reports leaving + %1 ausschalten wenn %0 verlassen wird + + + Turn off everything when %0 reports leaving + Alles ausschalten wenn %0 verlassen wird + + + Turn off all lights when %0 reports leaving + Alle Lichter ausschalten wenn %0 verlassen wird + + + Turn on %1 when %0 reports arriving + %1 einschalten %0 Ankunft registiert + + + + ruleNameTemplate for smartmetertemplates + + Smart car charging + Intelligentes Fahrzeugladen + + + Smart heating + Intelligente Heizung + + + + ruleNameTemplate for template + + %0 ... + + + + + ruleNameTemplate for thermostattemplates + + Set temperature while I'm home + Setze Temperatur während ich zuhause bin + + diff --git a/nymea-app/translations/nymea-app-en_US.ts b/nymea-app/translations/nymea-app-en_US.ts index 2294bf46..5711de6a 100644 --- a/nymea-app/translations/nymea-app-en_US.ts +++ b/nymea-app/translations/nymea-app-en_US.ts @@ -496,6 +496,14 @@ Log in to %1:cloud in order to connect to %1:core systems from anywhere. + + Failed to connect to the login server. Please mase sure your network connection is working. + + + + An unexpected error happened. Please report this isse. Error code: + + CloudSettingsPage @@ -926,6 +934,13 @@ + + DoorbellDevicePage + + History + + + EditCalendarItemPage @@ -2572,6 +2587,13 @@ Please try again. + + NewMagicPage + + New magic + + + NewThingMagicPage @@ -2582,6 +2604,10 @@ Please try again. Create some magic manually + + New magic for %1 + + NewThingPage @@ -2782,6 +2808,34 @@ Please try again. presence sensor + + Doorbells + + + + doorbell + + + + alert + + + + button + + + + access control + + + + smart meter + + + + media player + + NymeaConnection @@ -3792,4 +3846,257 @@ Do you want to proceed? + + description for accesscontroltemplates + + Alert me on denied access attempts + + + + Notify my about access + + + + Notify my about user access + + + + + description for buttontemplates + + Turn on a light + + + + Turn off a light + + + + Switch a light + + + + Turn off all lights + + + + + description for daylightsensor + + Turn on a light while it's dark outside + + + + Turn on a light when it gets dark outside + + + + Turn on all lights when it gets dark outside + + + + + description for doorbellruletemplates + + Alert on doorbell ring + + + + + description for mediatemplates + + Dim light while watching TV + + + + + description for notificationtemplates + + Notify me when a device runs out of battery + + + + Notify me when something runs dry + + + + Notify me when a thing gets disconnected + + + + Notify me when a thing connects + + + + + description for presencesensortemplates + + Turn on something while being present + + + + Turn off something when leaving + + + + Turn off everything when leaving + + + + Turn off all lights when leaving + + + + Turn on something when arriving + + + + + description for smartmetertemplates + + Charge my car while producing energy + + + + Turn on heating while producing energy + + + + + description for thermostattemplates + + Set temperature while I'm home + + + + + ruleNameTemplate for accesscontroltemplates + + Denied access attempt on %0 + + + + Access granted on %0 + + + + Access granted to user on %0 + + + + + ruleNameTemplate for buttontemplates + + %0 turns on %1 + + + + %0 turns off %1 + + + + %0 switches %1 + + + + Turn off everything with %0 + + + + + ruleNameTemplate for daylightsensor + + Turn on %1 while it's dark outside + + + + Turn on %1 when it gets dark outside (%0) + + + + Turn on all lights when it gets dark outside + + + + + ruleNameTemplate for doorbellruletemplates + + Alert %1 when someone is at %0 + + + + + ruleNameTemplate for mediatemplates + + %0 dims %1 for movie time + + + + + ruleNameTemplate for notificationtemplates + + Low battery alert for %0 + + + + Notify %1 when %0 runs dry + + + + Disconnect alert for %0 + + + + Connection notification for %0 + + + + + ruleNameTemplate for presencesensortemplates + + Turn on %1 while %0 reports presence + + + + Turn off %1 when %0 reports leaving + + + + Turn off everything when %0 reports leaving + + + + Turn off all lights when %0 reports leaving + + + + Turn on %1 when %0 reports arriving + + + + + ruleNameTemplate for smartmetertemplates + + Smart car charging + + + + Smart heating + + + + + ruleNameTemplate for template + + %0 ... + + + + + ruleNameTemplate for thermostattemplates + + Set temperature while I'm home + + + diff --git a/nymea-app/translations/nymea-app-ko.ts b/nymea-app/translations/nymea-app-ko.ts index 68ca91ca..b5c2ab40 100644 --- a/nymea-app/translations/nymea-app-ko.ts +++ b/nymea-app/translations/nymea-app-ko.ts @@ -331,13 +331,14 @@ There are %n boxes connected to your cloud There is %n box connected to your cloud. - There are %n boxes connected to your cloud. There are %n boxes connected to your cloud. - %n 상자(장치)가 클라우드에 연결되어 있습니다. - + + %n 상자(장치)가 클라우드에 연결되어 있습니다. + + Cloud login 클라우드 로그인 @@ -480,8 +481,10 @@ There are %n %1:core systems connected to your cloud. - %n %1:코어 시스템이 클라우드에 연결되어 있습니다. - + + %n %1:코어 시스템이 클라우드에 연결되어 있습니다. + + Sorry to see you go. If you log out you won't be able to connect to %1:core systems remotely any more. However, you can come back any time, we'll keep your user account. If you whish to completely delete your account and all the data associated with it, check the box below before hitting ok. If you decide to delete your account, all your personal information will be removed from %1:cloud and cannot be restored. 아쉽군요. 로그아웃하면 더 이상 원격으로 %1:코어 시스템에 연결할 수 없습니다. 하지만 언제든지 돌아올 수 있어요, 사용자 계정은 안전하게 보관 됩니다. 계정 및 관련된 모든 데이터를 완전히 삭제하려면 확인을 누르기 전에 아래의 확인란을 선택하십시오. 계정을 삭제하기로 결정하면 모든 개인 정보가 %1:클라우드에서 제거되므로 복원할 수 없습니다. @@ -490,6 +493,14 @@ Log in to %1:cloud in order to connect to %1:core systems from anywhere. 어디에서나 %1:core 시스템에 연결하려면 %1:cloud에 로그인하십시오. + + Failed to connect to the login server. Please mase sure your network connection is working. + + + + An unexpected error happened. Please report this isse. Error code: + + CloudSettingsPage @@ -920,6 +931,13 @@ %1 열림 + + DoorbellDevicePage + + History + + + EditCalendarItemPage @@ -2245,8 +2263,10 @@ Please try again. %n system update(s) available - %n 시스템 업데이트 사용 가능 - + + %n 시스템 업데이트 사용 가능 + + System settings 시스템 설정 @@ -2570,6 +2590,13 @@ Please try again. WiFi를 비활성화하면 WiFi를 통해 연결된 모든 클라이언트의 연결이 끊어집니다. LAN 케이블이 연결되어 있지 않으면 이 %1 시스템과 더 이상 원격으로 상호 작용할 수 없다는 점에 유의하십시오. + + NewMagicPage + + New magic + 신 마법 + + NewThingMagicPage @@ -2580,6 +2607,10 @@ Please try again. Create some magic manually 수동으로 마법 만들기 + + New magic for %1 + + NewThingPage @@ -2780,6 +2811,34 @@ Please try again. presence sensor 움직임 감지 센서 + + Doorbells + + + + doorbell + + + + alert + + + + button + + + + access control + + + + smart meter + + + + media player + + NymeaConnection @@ -3515,8 +3574,10 @@ Please only use this if you are sure you want this and consider reporting the is %n update(s) available - %n 업데이트 사용 가능 - + + %n 업데이트 사용 가능 + + Check again 다시 확인 @@ -3788,4 +3849,257 @@ Do you want to proceed? %1:코어에 연결 + + description for accesscontroltemplates + + Alert me on denied access attempts + + + + Notify my about access + + + + Notify my about user access + + + + + description for buttontemplates + + Turn on a light + + + + Turn off a light + + + + Switch a light + + + + Turn off all lights + + + + + description for daylightsensor + + Turn on a light while it's dark outside + + + + Turn on a light when it gets dark outside + + + + Turn on all lights when it gets dark outside + + + + + description for doorbellruletemplates + + Alert on doorbell ring + + + + + description for mediatemplates + + Dim light while watching TV + + + + + description for notificationtemplates + + Notify me when a device runs out of battery + + + + Notify me when something runs dry + + + + Notify me when a thing gets disconnected + + + + Notify me when a thing connects + + + + + description for presencesensortemplates + + Turn on something while being present + + + + Turn off something when leaving + + + + Turn off everything when leaving + + + + Turn off all lights when leaving + + + + Turn on something when arriving + + + + + description for smartmetertemplates + + Charge my car while producing energy + + + + Turn on heating while producing energy + + + + + description for thermostattemplates + + Set temperature while I'm home + + + + + ruleNameTemplate for accesscontroltemplates + + Denied access attempt on %0 + + + + Access granted on %0 + + + + Access granted to user on %0 + + + + + ruleNameTemplate for buttontemplates + + %0 turns on %1 + + + + %0 turns off %1 + + + + %0 switches %1 + + + + Turn off everything with %0 + + + + + ruleNameTemplate for daylightsensor + + Turn on %1 while it's dark outside + + + + Turn on %1 when it gets dark outside (%0) + + + + Turn on all lights when it gets dark outside + + + + + ruleNameTemplate for doorbellruletemplates + + Alert %1 when someone is at %0 + + + + + ruleNameTemplate for mediatemplates + + %0 dims %1 for movie time + + + + + ruleNameTemplate for notificationtemplates + + Low battery alert for %0 + + + + Notify %1 when %0 runs dry + + + + Disconnect alert for %0 + + + + Connection notification for %0 + + + + + ruleNameTemplate for presencesensortemplates + + Turn on %1 while %0 reports presence + + + + Turn off %1 when %0 reports leaving + + + + Turn off everything when %0 reports leaving + + + + Turn off all lights when %0 reports leaving + + + + Turn on %1 when %0 reports arriving + + + + + ruleNameTemplate for smartmetertemplates + + Smart car charging + + + + Smart heating + + + + + ruleNameTemplate for template + + %0 ... + + + + + ruleNameTemplate for thermostattemplates + + Set temperature while I'm home + + + diff --git a/nymea-app/ui/Nymea.qml b/nymea-app/ui/Nymea.qml index 7e03e682..7d9fcc05 100644 --- a/nymea-app/ui/Nymea.qml +++ b/nymea-app/ui/Nymea.qml @@ -175,6 +175,7 @@ ApplicationWindow { return Qt.resolvedUrl("images/sensors/closable.svg") case "media": case "mediacontroller": + case "mediaplayer": return Qt.resolvedUrl("images/mediaplayer-app-symbolic.svg") case "powersocket": return Qt.resolvedUrl("images/powersocket.svg") @@ -310,6 +311,9 @@ ApplicationWindow { case "extendedsmartmeterproducer": case "extendedsmartmeterconsumer": return qsTr("smart meter"); + case "media": + case "mediaplayer": + return qsTr("media player") default: console.warn("Unhandled interfaceToDisplayName:", name) }