From 505825056c76a0f8326d6d2a5d9fa872c8f6287b Mon Sep 17 00:00:00 2001 From: fewieden Date: Sat, 17 Feb 2018 10:10:57 +0100 Subject: [PATCH 1/3] use translation template for updatenotifications --- .../default/updatenotification/updatenotification.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/default/updatenotification/updatenotification.js b/modules/default/updatenotification/updatenotification.js index 306ac6ae..26d0d9f0 100644 --- a/modules/default/updatenotification/updatenotification.js +++ b/modules/default/updatenotification/updatenotification.js @@ -58,16 +58,19 @@ Module.register("updatenotification", { icon.innerHTML = " "; message.appendChild(icon); - var subtextHtml = this.translate("UPDATE_INFO") - .replace("COMMIT_COUNT", this.status.behind + " " + ((this.status.behind == 1) ? "commit" : "commits")) - .replace("BRANCH_NAME", this.status.current); + var subtextHtml = this.translate("UPDATE_INFO", { + COMMIT_COUNT: this.status.behind + " " + ((this.status.behind == 1) ? "commit" : "commits"), + BRANCH_NAME: this.status.current + }); var text = document.createElement("span"); if (this.status.module == "default") { text.innerHTML = this.translate("UPDATE_NOTIFICATION"); subtextHtml = this.diffLink(subtextHtml); } else { - text.innerHTML = this.translate("UPDATE_NOTIFICATION_MODULE").replace("MODULE_NAME", this.status.module); + text.innerHTML = this.translate("UPDATE_NOTIFICATION_MODULE", { + MODULE_NAME: this.status.module + }); } message.appendChild(text); From f414707f1133f9d606aae694f3b2646ff3ca530d Mon Sep 17 00:00:00 2001 From: fewieden Date: Sat, 17 Feb 2018 10:14:37 +0100 Subject: [PATCH 2/3] update translations for updatenotifications --- translations/af.json | 4 ++-- translations/bg.json | 4 ++-- translations/ca.json | 4 ++-- translations/cs.json | 4 ++-- translations/cy.json | 4 ++-- translations/da.json | 4 ++-- translations/de.json | 4 ++-- translations/en.json | 4 ++-- translations/es.json | 4 ++-- translations/et.json | 4 ++-- translations/fi.json | 2 +- translations/fr.json | 4 ++-- translations/hu.json | 4 ++-- translations/id.json | 4 ++-- translations/is.json | 4 ++-- translations/kr.json | 4 ++-- translations/nb.json | 4 ++-- translations/nl.json | 4 ++-- translations/nn.json | 4 ++-- translations/pl.json | 4 ++-- translations/pt.json | 4 ++-- translations/ro.json | 4 ++-- translations/ru.json | 4 ++-- translations/sv.json | 4 ++-- translations/zh_cn.json | 4 ++-- 25 files changed, 49 insertions(+), 49 deletions(-) diff --git a/translations/af.json b/translations/af.json index 0995bdf0..68bebc8d 100644 --- a/translations/af.json +++ b/translations/af.json @@ -25,6 +25,6 @@ "NNW": "NNW", "UPDATE_NOTIFICATION": "MagicMirror² update beskikbaar.", - "UPDATE_NOTIFICATION_MODULE": "Update beskikbaar vir MODULE_NAME module.", - "UPDATE_INFO": "Die huidige installasie is COMMIT_COUNT agter op die BRANCH_NAME branch." + "UPDATE_NOTIFICATION_MODULE": "Update beskikbaar vir {MODULE_NAME} module.", + "UPDATE_INFO": "Die huidige installasie is {COMMIT_COUNT} agter op die {BRANCH_NAME} branch." } diff --git a/translations/bg.json b/translations/bg.json index e45c1c46..705c1396 100644 --- a/translations/bg.json +++ b/translations/bg.json @@ -27,6 +27,6 @@ "NNW": "ССЗ", "UPDATE_NOTIFICATION": "Налична актуализация за MagicMirror².", - "UPDATE_NOTIFICATION_MODULE": "Налична актуализация за MODULE_NAME модул.", - "UPDATE_INFO": "Текущата инсталация е изостанала с COMMIT_COUNT къмита на клон BRANCH_NAME." + "UPDATE_NOTIFICATION_MODULE": "Налична актуализация за {MODULE_NAME} модул.", + "UPDATE_INFO": "Текущата инсталация е изостанала с {COMMIT_COUNT} къмита на клон {BRANCH_NAME}." } diff --git a/translations/ca.json b/translations/ca.json index 758aa7a1..76e4ad2c 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -27,6 +27,6 @@ "NNW": "NNO", "UPDATE_NOTIFICATION": "MagicMirror² actualizació disponible.", - "UPDATE_NOTIFICATION_MODULE": "Disponible una actualizació per al mòdul MODULE_NAME.", - "UPDATE_INFO": "La teva instal·lació actual està COMMIT_COUNT canvis darrere de la branca BRANCH_NAME." + "UPDATE_NOTIFICATION_MODULE": "Disponible una actualizació per al mòdul {MODULE_NAME}.", + "UPDATE_INFO": "La teva instal·lació actual està {COMMIT_COUNT} canvis darrere de la branca {BRANCH_NAME}." } diff --git a/translations/cs.json b/translations/cs.json index 93083d14..bec2e82c 100644 --- a/translations/cs.json +++ b/translations/cs.json @@ -27,6 +27,6 @@ "NNW": "SSZ", "UPDATE_NOTIFICATION": "Dostupná aktualizace pro MagicMirror².", - "UPDATE_NOTIFICATION_MODULE": "Dostupná aktualizace pro modul MODULE_NAME.", - "UPDATE_INFO": "Současná instalace je na větvi BRANCH_NAME pozadu o COMMIT_COUNT." + "UPDATE_NOTIFICATION_MODULE": "Dostupná aktualizace pro modul {MODULE_NAME}.", + "UPDATE_INFO": "Současná instalace je na větvi {BRANCH_NAME} pozadu o {COMMIT_COUNT}." } diff --git a/translations/cy.json b/translations/cy.json index d0b2a077..7ae28abb 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -27,6 +27,6 @@ "NNW": "GoGoGe", "UPDATE_NOTIFICATION": "MagicMirror² mwy diweddar yn barod.", - "UPDATE_NOTIFICATION_MODULE": "Mae diweddaraiad ar gyfer y modiwl MODULE_NAME.", - "UPDATE_INFO": "Mae'r fersiwn bresenol COMMIT_COUNT commit tu ôl i'r gangen BRANCH_NAME." + "UPDATE_NOTIFICATION_MODULE": "Mae diweddaraiad ar gyfer y modiwl {MODULE_NAME}.", + "UPDATE_INFO": "Mae'r fersiwn bresenol {COMMIT_COUNT} commit tu ôl i'r gangen {BRANCH_NAME}." } diff --git a/translations/da.json b/translations/da.json index 68c544a6..fe31cba4 100644 --- a/translations/da.json +++ b/translations/da.json @@ -26,6 +26,6 @@ "UPDATE_NOTIFICATION": "MagicMirror² opdatering tilgængelig.", - "UPDATE_NOTIFICATION_MODULE": "Opdatering tilgængelig for MODULE_NAME modulet.", - "UPDATE_INFO": "Den nuværende installation er COMMIT_COUNT bagud på BRANCH_NAME branch'en." + "UPDATE_NOTIFICATION_MODULE": "Opdatering tilgængelig for {MODULE_NAME} modulet.", + "UPDATE_INFO": "Den nuværende installation er {COMMIT_COUNT} bagud på {BRANCH_NAME} branch'en." } diff --git a/translations/de.json b/translations/de.json index 278a4bba..ffbd667f 100644 --- a/translations/de.json +++ b/translations/de.json @@ -27,6 +27,6 @@ "NNW": "NNW", "UPDATE_NOTIFICATION": "Aktualisierung für MagicMirror² verfügbar.", - "UPDATE_NOTIFICATION_MODULE": "Aktualisierung für das MODULE_NAME Modul verfügbar.", - "UPDATE_INFO": "Die aktuelle Installation ist COMMIT_COUNT hinter dem BRANCH_NAME branch." + "UPDATE_NOTIFICATION_MODULE": "Aktualisierung für das {MODULE_NAME} Modul verfügbar.", + "UPDATE_INFO": "Die aktuelle Installation ist {COMMIT_COUNT} hinter dem {BRANCH_NAME} branch." } diff --git a/translations/en.json b/translations/en.json index 975dd43d..790d67b9 100644 --- a/translations/en.json +++ b/translations/en.json @@ -27,6 +27,6 @@ "NNW": "NNW", "UPDATE_NOTIFICATION": "MagicMirror² update available.", - "UPDATE_NOTIFICATION_MODULE": "Update available for MODULE_NAME module.", - "UPDATE_INFO": "The current installation is COMMIT_COUNT behind on the BRANCH_NAME branch." + "UPDATE_NOTIFICATION_MODULE": "Update available for {MODULE_NAME} module.", + "UPDATE_INFO": "The current installation is {COMMIT_COUNT} behind on the {BRANCH_NAME} branch." } diff --git a/translations/es.json b/translations/es.json index 21634351..44d08c2c 100644 --- a/translations/es.json +++ b/translations/es.json @@ -27,6 +27,6 @@ "NNW": "NNO", "UPDATE_NOTIFICATION": "MagicMirror² actualización disponible.", - "UPDATE_NOTIFICATION_MODULE": "Disponible una actualización para el módulo MODULE_NAME.", - "UPDATE_INFO": "Tu actual instalación está COMMIT_COUNT cambios detrás de la rama BRANCH_NAME." + "UPDATE_NOTIFICATION_MODULE": "Disponible una actualización para el módulo {MODULE_NAME}.", + "UPDATE_INFO": "Tu actual instalación está {COMMIT_COUNT} cambios detrás de la rama {BRANCH_NAME}." } diff --git a/translations/et.json b/translations/et.json index 2597ed7b..f7ad1f0e 100644 --- a/translations/et.json +++ b/translations/et.json @@ -25,6 +25,6 @@ "NNW": "Põhjaloe", "UPDATE_NOTIFICATION": "MagicMirror²´le uuendus saadaval.", - "UPDATE_NOTIFICATION_MODULE": "Uuendus saadaval MODULE_NAME moodulile.", - "UPDATE_INFO": "Praegune paigaldus on COMMIT_COUNT tagapool BRANCH_NAME harul." + "UPDATE_NOTIFICATION_MODULE": "Uuendus saadaval {MODULE_NAME} moodulile.", + "UPDATE_INFO": "Praegune paigaldus on {COMMIT_COUNT} tagapool {BRANCH_NAME} harul." } diff --git a/translations/fi.json b/translations/fi.json index c013e310..aa20759d 100644 --- a/translations/fi.json +++ b/translations/fi.json @@ -25,5 +25,5 @@ "NNW": "PPL", "UPDATE_NOTIFICATION": "MagicMirror² päivitys saatavilla.", - "UPDATE_NOTIFICATION_MODULE": "Päivitys saatavilla moduulille MODULE_NAME." + "UPDATE_NOTIFICATION_MODULE": "Päivitys saatavilla moduulille {MODULE_NAME}." } diff --git a/translations/fr.json b/translations/fr.json index 87c26a6a..1f7f9f86 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -27,6 +27,6 @@ "NNW": "NNO", "UPDATE_NOTIFICATION": "Une mise à jour de MagicMirror² est disponible", - "UPDATE_NOTIFICATION_MODULE": "Une mise à jour est disponible pour le module MODULE_NAME .", -"UPDATE_INFO": "L'installation actuelle est COMMIT_COUNT en retard sur la branche BRANCH_NAME ." + "UPDATE_NOTIFICATION_MODULE": "Une mise à jour est disponible pour le module {MODULE_NAME} .", +"UPDATE_INFO": "L'installation actuelle est {COMMIT_COUNT} en retard sur la branche {BRANCH_NAME} ." } diff --git a/translations/hu.json b/translations/hu.json index de18d82e..6c0a1a28 100644 --- a/translations/hu.json +++ b/translations/hu.json @@ -25,6 +25,6 @@ "NNW": "ÉÉNy", "UPDATE_NOTIFICATION": "MagicMirror² elérhető egy frissítés!", - "UPDATE_NOTIFICATION_MODULE": "A frissítés MODULE_NAME modul néven érhető el.", - "UPDATE_INFO": "A jelenlegi telepítés COMMIT_COUNT mögött BRANCH_NAME ágon található." + "UPDATE_NOTIFICATION_MODULE": "A frissítés {MODULE_NAME} modul néven érhető el.", + "UPDATE_INFO": "A jelenlegi telepítés {COMMIT_COUNT} mögött {BRANCH_NAME} ágon található." } diff --git a/translations/id.json b/translations/id.json index 1ffea7fc..9a4ed5d4 100644 --- a/translations/id.json +++ b/translations/id.json @@ -27,6 +27,6 @@ "NNW": "UBL", "UPDATE_NOTIFICATION": "Memperbarui MagicMirror² tersedia.", - "UPDATE_NOTIFICATION_MODULE": "Memperbarui tersedia untuk modul MODULE_NAME.", - "UPDATE_INFO": "Instalasi saat ini tertinggal COMMIT_COUNT pada cabang BRANCH_NAME." + "UPDATE_NOTIFICATION_MODULE": "Memperbarui tersedia untuk modul {MODULE_NAME}.", + "UPDATE_INFO": "Instalasi saat ini tertinggal {COMMIT_COUNT} pada cabang {BRANCH_NAME}." } diff --git a/translations/is.json b/translations/is.json index aabc3997..b60c0ae4 100644 --- a/translations/is.json +++ b/translations/is.json @@ -25,6 +25,6 @@ "NNW": "NNV", "UPDATE_NOTIFICATION": "MagicMirror² uppfærsla í boði.", - "UPDATE_NOTIFICATION_MODULE": "Uppfærsla í boði fyrir MODULE_NAME module.", - "UPDATE_INFO": "Núverandi kerfi er COMMIT_COUNT á eftir BRANCH_NAME branchinu." + "UPDATE_NOTIFICATION_MODULE": "Uppfærsla í boði fyrir {MODULE_NAME} module.", + "UPDATE_INFO": "Núverandi kerfi er {COMMIT_COUNT} á eftir {BRANCH_NAME} branchinu." } diff --git a/translations/kr.json b/translations/kr.json index e998d97f..70df42f8 100644 --- a/translations/kr.json +++ b/translations/kr.json @@ -25,6 +25,6 @@ "NNW": "북북서풍", "UPDATE_NOTIFICATION": "새로운 MagicMirror² 업데이트가 있습니다.", - "UPDATE_NOTIFICATION_MODULE": "MODULE_NAME 모듈에서 사용 가능한 업데이트 입니다.", - "UPDATE_INFO": "설치할 COMMIT_COUNT 는 BRANCH_NAME 분기에 해당됩니다." + "UPDATE_NOTIFICATION_MODULE": "{MODULE_NAME} 모듈에서 사용 가능한 업데이트 입니다.", + "UPDATE_INFO": "설치할 {COMMIT_COUNT} 는 {BRANCH_NAME} 분기에 해당됩니다." } diff --git a/translations/nb.json b/translations/nb.json index 36a28de2..0a0595ac 100644 --- a/translations/nb.json +++ b/translations/nb.json @@ -27,6 +27,6 @@ "NNW": "NNV", "UPDATE_NOTIFICATION": "MagicMirror²-oppdatering er tilgjengelig.", - "UPDATE_NOTIFICATION_MODULE": "Oppdatering tilgjengelig for modulen MODULE_NAME.", - "UPDATE_INFO": "Nåværende installasjon er COMMIT_COUNT bak BRANCH_NAME grenen." + "UPDATE_NOTIFICATION_MODULE": "Oppdatering tilgjengelig for modulen {MODULE_NAME}.", + "UPDATE_INFO": "Nåværende installasjon er {COMMIT_COUNT} bak {BRANCH_NAME} grenen." } diff --git a/translations/nl.json b/translations/nl.json index c615903b..068c52d2 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -25,6 +25,6 @@ "NNW": "NNW", "UPDATE_NOTIFICATION": "MagicMirror² update beschikbaar.", - "UPDATE_NOTIFICATION_MODULE": "Update beschikbaar voor MODULE_NAME module.", - "UPDATE_INFO": "De huidige installatie loopt COMMIT_COUNT achter op de BRANCH_NAME branch." + "UPDATE_NOTIFICATION_MODULE": "Update beschikbaar voor {MODULE_NAME} module.", + "UPDATE_INFO": "De huidige installatie loopt {COMMIT_COUNT} achter op de {BRANCH_NAME} branch." } diff --git a/translations/nn.json b/translations/nn.json index ebe4cee7..3c33c597 100644 --- a/translations/nn.json +++ b/translations/nn.json @@ -25,6 +25,6 @@ "NNW": "NNV", "UPDATE_NOTIFICATION": "MagicMirror² oppdatering er tilgjengeleg.", - "UPDATE_NOTIFICATION_MODULE": "Oppdatering tilgjengeleg for modulen MODULE_NAME.", - "UPDATE_INFO": "noverande installasjon er COMMIT_COUNT bak BRANCH_NAME greinen." + "UPDATE_NOTIFICATION_MODULE": "Oppdatering tilgjengeleg for modulen {MODULE_NAME}.", + "UPDATE_INFO": "noverande installasjon er {COMMIT_COUNT} bak {BRANCH_NAME} greinen." } diff --git a/translations/pl.json b/translations/pl.json index 3c69d3bc..06473ad2 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -27,6 +27,6 @@ "NNW": "NNW", "UPDATE_NOTIFICATION": "Dostępna jest aktualizacja MagicMirror².", - "UPDATE_NOTIFICATION_MODULE": "Dostępna jest aktualizacja modułu MODULE_NAME.", - "UPDATE_INFO": "Zainstalowana wersja odbiega o COMMIT_COUNT commitów od gałęzi BRANCH_NAME." + "UPDATE_NOTIFICATION_MODULE": "Dostępna jest aktualizacja modułu {MODULE_NAME}.", + "UPDATE_INFO": "Zainstalowana wersja odbiega o {COMMIT_COUNT} commitów od gałęzi {BRANCH_NAME}." } diff --git a/translations/pt.json b/translations/pt.json index c340ff51..daceb4b2 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -26,6 +26,6 @@ "NNW": "NNO", "UPDATE_NOTIFICATION": "Atualização do MagicMirror² disponível.", - "UPDATE_NOTIFICATION_MODULE": "Atualização para o módulo MODULE_NAME disponível.", - "UPDATE_INFO": "A instalação atual está COMMIT_COUNT atrasada no branch BRANCH_NAME." + "UPDATE_NOTIFICATION_MODULE": "Atualização para o módulo {MODULE_NAME} disponível.", + "UPDATE_INFO": "A instalação atual está {COMMIT_COUNT} atrasada no branch {BRANCH_NAME}." } diff --git a/translations/ro.json b/translations/ro.json index cf1eca73..acc7db8c 100644 --- a/translations/ro.json +++ b/translations/ro.json @@ -27,6 +27,6 @@ "NNW": "NNW", "UPDATE_NOTIFICATION": "Un update este disponibil pentru MagicMirror².", - "UPDATE_NOTIFICATION_MODULE": "Un update este disponibil pentru modulul MODULE_NAME.", - "UPDATE_INFO": "Există COMMIT_COUNT commit-uri noi pe branch-ul BRANCH_NAME." + "UPDATE_NOTIFICATION_MODULE": "Un update este disponibil pentru modulul {MODULE_NAME}.", + "UPDATE_INFO": "Există {COMMIT_COUNT} commit-uri noi pe branch-ul {BRANCH_NAME}." } diff --git a/translations/ru.json b/translations/ru.json index eee96ebc..e4fce93e 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -27,6 +27,6 @@ "NNW": "ССЗ", "UPDATE_NOTIFICATION": "Есть обновление для MagicMirror².", - "UPDATE_NOTIFICATION_MODULE": "Есть обновление для MODULE_NAME модуля.", - "UPDATE_INFO": "Данная инсталляция позади BRANCH_NAME ветки на COMMIT_COUNT коммитов." + "UPDATE_NOTIFICATION_MODULE": "Есть обновление для {MODULE_NAME} модуля.", + "UPDATE_INFO": "Данная инсталляция позади {BRANCH_NAME} ветки на {COMMIT_COUNT} коммитов." } diff --git a/translations/sv.json b/translations/sv.json index d33461ef..07ca0aa1 100644 --- a/translations/sv.json +++ b/translations/sv.json @@ -27,6 +27,6 @@ "NNW": "NNV", "UPDATE_NOTIFICATION": "MagicMirror² uppdatering finns tillgänglig.", - "UPDATE_NOTIFICATION_MODULE": "Uppdatering finns tillgänglig av MODULE_NAME modulen.", - "UPDATE_INFO": "Denna installation ligger COMMIT_COUNT steg bakom BRANCH_NAME grenen." + "UPDATE_NOTIFICATION_MODULE": "Uppdatering finns tillgänglig av {MODULE_NAME} modulen.", + "UPDATE_INFO": "Denna installation ligger {COMMIT_COUNT} steg bakom {BRANCH_NAME} grenen." } diff --git a/translations/zh_cn.json b/translations/zh_cn.json index addffbbc..42ac8e65 100644 --- a/translations/zh_cn.json +++ b/translations/zh_cn.json @@ -25,6 +25,6 @@ "NNW": "北偏西风", "UPDATE_NOTIFICATION": "MagicMirror² 有新的更新", - "UPDATE_NOTIFICATION_MODULE": "模块 MODULE_NAME 可更新", - "UPDATE_INFO": "当前已安装版本为 COMMIT_COUNT 落后于分支 BRANCH_NAME " + "UPDATE_NOTIFICATION_MODULE": "模块 {MODULE_NAME} 可更新", + "UPDATE_INFO": "当前已安装版本为 {COMMIT_COUNT} 落后于分支 {BRANCH_NAME} " } From 1f873b93f69cdd85c42b038fd98e12bc0f8addc7 Mon Sep 17 00:00:00 2001 From: fewieden Date: Sat, 17 Feb 2018 10:17:59 +0100 Subject: [PATCH 3/3] changelog, linting --- CHANGELOG.md | 4 ++++ modules/default/updatenotification/updatenotification.js | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1c3cb6d..3fdf6216 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Allow to scroll in full page article view of default newsfeed module with gesture events from [MMM-Gestures](https://github.com/thobach/MMM-Gestures) - Changed 'compliments.js' - update DOM if remote compliments are loaded instead of waiting one updateInterval to show custom compliments +### Changed + +- Update notifications use now translation templates instead of normal strings. + ### Fixed - News article in fullscreen (iframe) is now shown in front of modules. diff --git a/modules/default/updatenotification/updatenotification.js b/modules/default/updatenotification/updatenotification.js index 26d0d9f0..b26517e5 100644 --- a/modules/default/updatenotification/updatenotification.js +++ b/modules/default/updatenotification/updatenotification.js @@ -59,8 +59,8 @@ Module.register("updatenotification", { message.appendChild(icon); var subtextHtml = this.translate("UPDATE_INFO", { - COMMIT_COUNT: this.status.behind + " " + ((this.status.behind == 1) ? "commit" : "commits"), - BRANCH_NAME: this.status.current + COMMIT_COUNT: this.status.behind + " " + ((this.status.behind == 1) ? "commit" : "commits"), + BRANCH_NAME: this.status.current }); var text = document.createElement("span"); @@ -69,7 +69,7 @@ Module.register("updatenotification", { subtextHtml = this.diffLink(subtextHtml); } else { text.innerHTML = this.translate("UPDATE_NOTIFICATION_MODULE", { - MODULE_NAME: this.status.module + MODULE_NAME: this.status.module }); } message.appendChild(text);