From 7bdf49b7e0be3a622777ebaab71a512efcb3942f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Fri, 26 Jul 2019 00:33:07 -0400 Subject: [PATCH 01/10] Add PRECIP for the Spanish translation --- CHANGELOG.md | 1 + translations/es.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf7f4d32..1e1073d1 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). *This release is scheduled to be released on 2019-10-01.* ### Added +- Spanish translation for "PRECIP" ### Updated - Updatenotification module: Display update notification for a limited (configurable) time. diff --git a/translations/es.json b/translations/es.json index 5e5fe96d..709abada 100644 --- a/translations/es.json +++ b/translations/es.json @@ -31,5 +31,6 @@ "UPDATE_INFO_SINGLE": "Tu actual instalación está {COMMIT_COUNT} commit cambios detrás de la rama {BRANCH_NAME}.", "UPDATE_INFO_MULTIPLE": "Tu actual instalación está {COMMIT_COUNT} commits cambios detrás de la rama {BRANCH_NAME}.", - "FEELS": "Sensación térmica de" + "FEELS": "Sensación térmica de", + "PRECIP": "Precipitación" } From 82ee051c1a3f6ad8c0b4d0eef3bb5f4459cfbf4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Fri, 26 Jul 2019 00:38:52 -0400 Subject: [PATCH 02/10] linter fixes --- js/main.js | 2 +- .../default/currentweather/currentweather.js | 2 +- .../default/updatenotification/node_helper.js | 2 +- .../updatenotification/updatenotification.js | 24 +++++++++---------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/js/main.js b/js/main.js index b811f937..57e4d4e7 100644 --- a/js/main.js +++ b/js/main.js @@ -203,7 +203,7 @@ var MM = (function() { */ var updateModuleContent = function(module, newHeader, newContent) { var moduleWrapper = document.getElementById(module.identifier); - if (moduleWrapper === null) return; + if (moduleWrapper === null) {return;} var headerWrapper = moduleWrapper.getElementsByClassName("module-header"); var contentWrapper = moduleWrapper.getElementsByClassName("module-content"); diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 562baf31..7d917132 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -273,7 +273,7 @@ Module.register("currentweather",{ if (this.config.useLocationAsHeader && this.config.location !== false) { return this.config.location; } - + return this.data.header; }, diff --git a/modules/default/updatenotification/node_helper.js b/modules/default/updatenotification/node_helper.js index 1f9d2f4d..03ecd745 100644 --- a/modules/default/updatenotification/node_helper.js +++ b/modules/default/updatenotification/node_helper.js @@ -18,7 +18,7 @@ module.exports = NodeHelper.create({ configureModules: function(modules) { // Push MagicMirror itself , biggest chance it'll show up last in UI and isn't overwritten - // others will be added in front, asynchronously + // others will be added in front, asynchronously simpleGits.push({"module": "default", "git": SimpleGit(path.normalize(__dirname + "/../../../"))}); for (moduleName in modules) { diff --git a/modules/default/updatenotification/updatenotification.js b/modules/default/updatenotification/updatenotification.js index 58c3995c..d4bdc568 100644 --- a/modules/default/updatenotification/updatenotification.js +++ b/modules/default/updatenotification/updatenotification.js @@ -6,12 +6,12 @@ Module.register("updatenotification", { }, suspended: false, - moduleList: {}, + moduleList: {}, start: function () { - var self = this; + var self = this; Log.log("Start updatenotification"); - setInterval( () => { self.moduleList = {};self.updateDom(2) } , self.config.refreshInterval) + setInterval( () => { self.moduleList = {};self.updateDom(2); } , self.config.refreshInterval); }, notificationReceived: function (notification, payload, sender) { @@ -38,15 +38,15 @@ Module.register("updatenotification", { self.updateDom(2); } //self.show(1000, { lockString: self.identifier }); - + } else if (payload && payload.behind == 0){ - // if the module WAS in the list, but shouldn't be - if(this.moduleList[payload.module] != undefined){ - // remove it - delete this.moduleList[payload.module] - self.updateDom(2); - } - } + // if the module WAS in the list, but shouldn't be + if(this.moduleList[payload.module] != undefined){ + // remove it + delete this.moduleList[payload.module]; + self.updateDom(2); + } + } }, diffLink: function(module, text) { @@ -66,7 +66,7 @@ Module.register("updatenotification", { if(this.suspended==false){ // process the hash of module info found for(key of Object.keys(this.moduleList)){ - let m= this.moduleList[key] + let m= this.moduleList[key]; var message = document.createElement("div"); message.className = "small bright"; From 2723604d3e841cf8097ca86eb9f2e5fba123a1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Thu, 25 Jul 2019 23:43:03 -0400 Subject: [PATCH 03/10] installer: Remove comment lines added in PR #1715 --- installers/raspberry.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/installers/raspberry.sh b/installers/raspberry.sh index 2a1b975b..b7a08d22 100644 --- a/installers/raspberry.sh +++ b/installers/raspberry.sh @@ -130,13 +130,6 @@ if $NPM_INSTALL; then echo -e "\e[96mInstalling npm ...\e[90m" - # Fetch the latest version of npm from the selected branch - # The NODE_STABLE_BRANCH variable will need to be manually adjusted when a new branch is released. (e.g. 7.x) - # Only tested (stable) versions are recommended as newer versions could break MagicMirror. - - #NODE_STABLE_BRANCH="9.x" - #curl -sL https://deb.nodesource.com/setup_$NODE_STABLE_BRANCH | sudo -E bash - - # sudo apt-get install -y npm echo -e "\e[92mnpm installation Done!\e[0m" fi From e38de75520713f0d215123920dc85ee948ce0e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Fri, 26 Jul 2019 02:04:38 -0400 Subject: [PATCH 04/10] Update year Copyright License --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index 09ac7e6f..07c1fb07 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,7 +1,7 @@ The MIT License (MIT) ===================== -Copyright © 2016-2017 Michael Teeuw +Copyright © 2016-2019 Michael Teeuw Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation From 282230313874d88a1d8104472253926a9302b43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Fri, 26 Jul 2019 01:19:44 -0400 Subject: [PATCH 05/10] Skip from worktree the css/custom.css: On the next release the css/custom.css will rename to css/custom.css.sample This change run git instructions to detach the file from own local repository. This instructions are called in untrack-css.sh file from run-start.sh and npm postinstall step Reference #1540 --- CHANGELOG.md | 2 ++ package.json | 2 +- run-start.sh | 3 +++ untrack-css.sh | 11 +++++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 untrack-css.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index bf7f4d32..6f0574fd 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Updated - Updatenotification module: Display update notification for a limited (configurable) time. +- The css/custom.css will be rename after the next release. We've add into `run-start.sh` a instruction by GIT to ignore with `--skip-worktree` and `rm --cached`. The history about this change [#1540]. + ### Fixed - Updatenotification module: Properly handle race conditions, prevent crash. diff --git a/package.json b/package.json index 1f7e7402..808caf9d 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "start": "sh run-start.sh", "install": "cd vendor && npm install", "install-fonts": "cd fonts && npm install", - "postinstall": "sh installers/postinstall/postinstall.sh && npm run install-fonts", + "postinstall": "sh untrack-css.sh && sh installers/postinstall/postinstall.sh && npm run install-fonts", "test": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests --recursive", "test:unit": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests/unit --recursive", "test:e2e": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests/e2e --recursive", diff --git a/run-start.sh b/run-start.sh index 6fc19b51..bbfcf921 100644 --- a/run-start.sh +++ b/run-start.sh @@ -1,3 +1,6 @@ + +./untrack-css.sh + if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty export DISPLAY=:0 # Set by default display fi diff --git a/untrack-css.sh b/untrack-css.sh new file mode 100755 index 00000000..580052e6 --- /dev/null +++ b/untrack-css.sh @@ -0,0 +1,11 @@ +# Long history here +# https://github.com/MichMich/MagicMirror/pull/1540 +STATUS_CUSTOM_CSS=$(git ls-files -v css/custom.css|cut -f 1 --delimiter=" ") + +if [ "$STATUS_CUSTOM_CSS" = "H" ]; then + echo "We'll remove from the repository the css/custom.css" + echo "This script apply git update-index --skip-worktree css/custom.css" + git update-index --skip-worktree css/custom.css + git rm --cached css/custom.css +fi + From d5cb60b19cea7851b0d42ee2d028b136b08a6ec1 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Wed, 31 Jul 2019 09:49:22 +0200 Subject: [PATCH 06/10] Remove failing script. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d98a72cd..f89cd724 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ before_script: - yarn danger ci - npm install grunt-cli -g - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" - sleep 5 script: - grunt From 3c31460f2fd193864fdc69781d8041f1626b6937 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Wed, 31 Jul 2019 09:53:46 +0200 Subject: [PATCH 07/10] Add xvfb as service. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index f89cd724..9a31e386 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ language: node_js node_js: - "8" +services: + - xvfb before_script: - yarn danger ci - npm install grunt-cli -g From 34698751f23be028cf7f04b005001158d5346523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Fri, 2 Aug 2019 00:31:43 -0400 Subject: [PATCH 08/10] Fix Build Failed in Travis CI: This commit set trusty as image to use and revert this commit changes Add xvfb as service: 3c31460f2fd193864fdc69781d8041f1626b6937 Remove failing script: d5cb60b19cea7851b0d42ee2d028b136b08a6ec1 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9a31e386..d1bd8ff6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ +dist: trusty language: node_js node_js: - "8" -services: - - xvfb before_script: - yarn danger ci - npm install grunt-cli -g - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" - sleep 5 script: - grunt From 9f63172b43db70170c2f9c4bf07de3558eedf691 Mon Sep 17 00:00:00 2001 From: Zulkifli Mohamed Date: Tue, 6 Aug 2019 08:36:39 +0800 Subject: [PATCH 09/10] Adding a Malay translations --- translations/ms-my.json | 33 +++++++++++++++++++++++++++++++++ translations/translations.js | 3 ++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 translations/ms-my.json diff --git a/translations/ms-my.json b/translations/ms-my.json new file mode 100644 index 00000000..380cf64e --- /dev/null +++ b/translations/ms-my.json @@ -0,0 +1,33 @@ +{ + "LOADING": "Tunggu Sebentar …", + + "TODAY": "Hari ini", + "TOMORROW": "Esok", + "DAYAFTERTOMORROW": "Lusa", + "RUNNING": "Berakhir dalam", + "EMPTY": "Tidak ada agenda", + + "WEEK": "Minggu ke-{weekNumber}", + + "N": "U", + "NNE": "UUT", + "NE": "TL", + "ENE": "TTL", + "E": "T", + "ESE": "TT", + "SE": "T", + "SSE": "ST", + "S": "S", + "SSW": "SBD", + "SW": "BD", + "WSW": "BBD", + "W": "B", + "WNW": "BBL", + "NW": "BL", + "NNW": "UBL", + + "UPDATE_NOTIFICATION": "MagicMirror² mempunyai update terkini.", + "UPDATE_NOTIFICATION_MODULE": "Modul {MODULE_NAME} mempunyai update terkini.", + "UPDATE_INFO_SINGLE": "Pemasangan MagicMirror² ini mempunyai {COMMIT_COUNT} commit terkebelakang dari branch {BRANCH_NAME}.", + "UPDATE_INFO_MULTIPLE": "Pemasangan MagicMirror² ini mempunyai {COMMIT_COUNT} commit terkebelakang dari branch {BRANCH_NAME}." +} diff --git a/translations/translations.js b/translations/translations.js index 683229bc..767590e8 100644 --- a/translations/translations.js +++ b/translations/translations.js @@ -40,7 +40,8 @@ var translations = { "cs" : "translations/cs.json", // Czech "hr" : "translations/hr.json", // Croatian "sk" : "translations/sk.json", // Slovak - "tlh" : "translations/tlh.json" // Klingon + "tlh" : "translations/tlh.json", // Klingon + "ms-my" : "translations/ms-my.json" // Malay }; if (typeof module !== "undefined") {module.exports = translations;} From 67f6258ab02d3aa2d9447f9c8ddebd9e3d7138f6 Mon Sep 17 00:00:00 2001 From: Zulkifli Mohamed Date: Tue, 6 Aug 2019 08:39:57 +0800 Subject: [PATCH 10/10] Adding a Malay translations --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18181c75..abb782d7 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). *This release is scheduled to be released on 2019-10-01.* +### Added +- Adding a Malay (Malaysian) translation for MagicMirror² + ### Added - Spanish translation for "PRECIP"