diff --git a/CHANGELOG.md b/CHANGELOG.md index 311f2356..1fdf2c65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2.0.2] - 2016-06-05 +### Added +- Norwegian Translations (nb and nn) +- Portuguese Translation +- Swedish Translation + +### Fixed +- Added reference to Italian Translation. +- Added the missing NE translation to all languages. [#334](https://github.com/MichMich/MagicMirror/issues/344) +- Added proper User-Agent string to calendar call. + +### Changed +- Add option to use locationID in weather modules. + ## [2.0.1] - 2016-05-18 ### Added - Changelog diff --git a/config/config.js.sample b/config/config.js.sample index 0b5f45d4..aedc2b75 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -41,6 +41,7 @@ var config = { position: 'top_right', config: { location: 'New York', + locationID: '', //ID from bulk.openweather.org/sample/ appid: 'YOUR_OPENWEATHER_API_KEY' } }, @@ -50,6 +51,7 @@ var config = { header: 'Weather Forecast', config: { location: 'New York', + locationID: '5128581', //ID from bulk.openweather.org/sample/ appid: 'YOUR_OPENWEATHER_API_KEY' } }, diff --git a/js/module.js b/js/module.js index 44c50099..9ee13e4c 100644 --- a/js/module.js +++ b/js/module.js @@ -152,7 +152,7 @@ var Module = Class.extend({ }, /* socket() - * Returns a socket object. If it doesn"t exsist, it"s created. + * Returns a socket object. If it doesn"t exist, it"s created. * It also registers the notification callback. */ socket: function() { diff --git a/modules/README.md b/modules/README.md index 54207399..39072db5 100644 --- a/modules/README.md +++ b/modules/README.md @@ -298,7 +298,7 @@ If no translation is found, a fallback will be used. The fallback sequence is as - 4. Translation as defined in core translation file of the fallback language (the first defined core translation file). - 5. The key (identifier) of the translation. -When adding translations to your module, it's a good idea to see if an apropriate translation is already available in the [core translation files](https://github.com/MichMich/MagicMirror/tree/master/translations). This way, your module can benefit from the exsisting translations. +When adding translations to your module, it's a good idea to see if an apropriate translation is already available in the [core translation files](https://github.com/MichMich/MagicMirror/tree/master/translations). This way, your module can benefit from the existing translations. **Example:** ````javascript diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index a6a7d082..213f1024 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -49,7 +49,7 @@ Module.register("calendar",{ getTranslations: function() { // The translations for the defaut modules are defined in the core translation files. // Therefor we can just return false. Otherwise we should have returned a dictionairy. - // If you're trying to build yiur own module including translations, check out the documentation. + // If you're trying to build your own module including translations, check out the documentation. return false; }, diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index 15c2e60a..f7f68b7e 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -25,7 +25,12 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumbe clearTimeout(reloadTimer); reloadTimer = null; - ical.fromURL(url, {}, function(err, data) { + var opts = { + headers: { + 'User-Agent': 'Mozilla/5.0 (Node.js 6.0.0) MagicMirror/v2 (https://github.com/MichMich/MagicMirror/)' + } + } + ical.fromURL(url, opts, function(err, data) { if (err) { fetchFailedCallback(self, err); scheduleTimer(); @@ -188,7 +193,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumbe }; /* broadcastItems() - * Broadcast the exsisting events. + * Broadcast the existing events. */ this.broadcastEvents = function() { //console.log('Broadcasting ' + events.length + ' events.'); diff --git a/modules/default/calendar/node_helper.js b/modules/default/calendar/node_helper.js index 1d558d29..47a0231b 100644 --- a/modules/default/calendar/node_helper.js +++ b/modules/default/calendar/node_helper.js @@ -30,8 +30,8 @@ module.exports = NodeHelper.create({ }, /* createFetcher(url, reloadInterval) - * Creates a fetcher for a new url if it doesn't exsist yet. - * Otherwise it reuses the exsisting one. + * Creates a fetcher for a new url if it doesn't exist yet. + * Otherwise it reuses the existing one. * * attribute url string - URL of the news feed. * attribute reloadInterval number - Reload interval in milliseconds. @@ -69,7 +69,7 @@ module.exports = NodeHelper.create({ self.fetchers[url] = fetcher; } else { - //console.log('Use exsisting news fetcher for url: ' + url); + //console.log('Use existing news fetcher for url: ' + url); fetcher = self.fetchers[url]; fetcher.broadcastEvents(); } diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index 7e7d9fb4..2a6f7844 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -14,6 +14,7 @@ modules: [ config: { // See 'Configuration options' for more information. location: 'Amsterdam,Netherlands', + locationID: '', //Location ID from http://bulk.openweather.org/sample/ appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key. } } @@ -34,7 +35,7 @@ The following properties can be configured: - + location The location used for weather information.
@@ -42,6 +43,13 @@ The following properties can be configured:
Default value: New York + + locationID + Location ID from OpenWeather This will override anything you put in location.
Leave blank if you want to use location. +
Example: 1234567 +
Default value: + + appid The OpenWeatherMap API key, which can be obtained by creating an OpenWeatherMap account.
diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 6c4983de..e00e738d 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -12,6 +12,7 @@ Module.register("currentweather",{ // Default module config. defaults: { location: "", + locationID: "", appid: "", units: config.units, updateInterval: 10 * 60 * 1000, // every 10 minutes @@ -198,7 +199,11 @@ Module.register("currentweather",{ */ getParams: function() { var params = "?"; - params += "q=" + this.config.location; + if(this.config.locationID !== "") { + params += "id=" + this.config.locationID; + } else { + params += "q=" + this.config.location; + } params += "&units=" + this.config.units; params += "&lang=" + this.config.lang; params += "&APPID=" + this.config.appid; diff --git a/modules/default/newsfeed/fetcher.js b/modules/default/newsfeed/fetcher.js index 3840bea6..ff0a9980 100644 --- a/modules/default/newsfeed/fetcher.js +++ b/modules/default/newsfeed/fetcher.js @@ -117,7 +117,7 @@ var Fetcher = function(url, reloadInterval, encoding) { }; /* broadcastItems() - * Broadcast the exsisting items. + * Broadcast the existing items. */ this.broadcastItems = function() { if (items.length <= 0) { diff --git a/modules/default/newsfeed/node_helper.js b/modules/default/newsfeed/node_helper.js index 82f1c19e..6ebf78df 100644 --- a/modules/default/newsfeed/node_helper.js +++ b/modules/default/newsfeed/node_helper.js @@ -25,8 +25,8 @@ module.exports = NodeHelper.create({ }, /* createFetcher(url, reloadInterval) - * Creates a fetcher for a new url if it doesn't exsist yet. - * Otherwise it reoses the exsisting one. + * Creates a fetcher for a new url if it doesn't exist yet. + * Otherwise it reoses the existing one. * * attribute url string - URL of the news feed. * attribute reloadInterval number - Reload interval in milliseconds. @@ -62,7 +62,7 @@ module.exports = NodeHelper.create({ self.fetchers[url] = fetcher; } else { - console.log("Use exsisting news fetcher for url: " + url); + console.log("Use existing news fetcher for url: " + url); fetcher = self.fetchers[url]; fetcher.setReloadInterval(reloadInterval); fetcher.broadcastItems(); diff --git a/modules/default/weatherforecast/README.md b/modules/default/weatherforecast/README.md index 9e93bd14..aba03a41 100644 --- a/modules/default/weatherforecast/README.md +++ b/modules/default/weatherforecast/README.md @@ -14,6 +14,7 @@ modules: [ config: { // See 'Configuration options' for more information. location: 'Amsterdam,Netherlands', + locationID: '', //Location ID from http://bulk.openweather.org/sample/ appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key. } } @@ -42,6 +43,13 @@ The following properties can be configured:
Default value: New York + + locationID + Location ID from OpenWeather This will override anything you put in location.
Leave blank if you want to use location. +
Example: 1234567 +
Default value: + + appid The OpenWeatherMap API key, which can be obtained by creating an OpenWeatherMap account.
diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 98298489..dd8e0a46 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -12,6 +12,7 @@ Module.register("weatherforecast",{ // Default module config. defaults: { location: "", + locationID: "", appid: "", units: config.units, maxNumberOfDays: 7, @@ -195,7 +196,11 @@ Module.register("weatherforecast",{ */ getParams: function() { var params = "?"; - params += "q=" + this.config.location; + if(this.config.locationID !== "") { + params += "id=" + this.config.locationID; + } else { + params += "q=" + this.config.location; + } params += "&units=" + this.config.units; params += "&lang=" + this.config.lang; /* diff --git a/translations/de.json b/translations/de.json index 74cb3808..d4c20d10 100644 --- a/translations/de.json +++ b/translations/de.json @@ -1,27 +1,28 @@ { - /* GENERAL */ - "LOADING": "Lade …", + /* GENERAL */ + "LOADING": "Lade …", - /* CALENDAR */ - "TODAY": "Heute", - "TOMORROW": "Morgen", - "RUNNING": "noch", - "EMPTY": "Keine Termine.", + /* CALENDAR */ + "TODAY": "Heute", + "TOMORROW": "Morgen", + "RUNNING": "noch", + "EMPTY": "Keine Termine.", - /* WEATHER */ - "N": "N", - "NNE": "NNO", - "ENE": "ONO", - "E": "O", - "ESE": "OSO", - "SE": "SO", - "SSE": "SSO", - "S": "S", - "SSW": "SSW", - "SW": "SW", - "WSW": "WSW", - "W": "W", - "WNW": "WNW", - "NW": "NW", - "NNW": "NNW" + /* WEATHER */ + "N": "N", + "NNE": "NNO", + "NE": "NO", + "ENE": "ONO", + "E": "O", + "ESE": "OSO", + "SE": "SO", + "SSE": "SSO", + "S": "S", + "SSW": "SSW", + "SW": "SW", + "WSW": "WSW", + "W": "W", + "WNW": "WNW", + "NW": "NW", + "NNW": "NNW" } diff --git a/translations/en.json b/translations/en.json index b26d3ef9..a2d5933a 100644 --- a/translations/en.json +++ b/translations/en.json @@ -1,27 +1,28 @@ { - /* GENERAL */ - "LOADING": "Loading …", + /* GENERAL */ + "LOADING": "Loading …", - /* CALENDAR */ - "TODAY": "Today", - "TOMORROW": "Tomorrow", - "RUNNING": "Ends in", - "EMPTY": "No upcoming events.", + /* CALENDAR */ + "TODAY": "Today", + "TOMORROW": "Tomorrow", + "RUNNING": "Ends in", + "EMPTY": "No upcoming events.", - /* WEATHER */ - "N": "N", - "NNE": "NNE", - "ENE": "ENE", - "E": "E", - "ESE": "ESE", - "SE": "SE", - "SSE": "SSE", - "S": "S", - "SSW": "SSW", - "SW": "SW", - "WSW": "WSW", - "W": "W", - "WNW": "WNW", - "NW": "NW", - "NNW": "NNW" + /* WEATHER */ + "N": "N", + "NNE": "NNE", + "NE": "NE", + "ENE": "ENE", + "E": "E", + "ESE": "ESE", + "SE": "SE", + "SSE": "SSE", + "S": "S", + "SSW": "SSW", + "SW": "SW", + "WSW": "WSW", + "W": "W", + "WNW": "WNW", + "NW": "NW", + "NNW": "NNW" } diff --git a/translations/es.json b/translations/es.json index 598bc731..6de069c7 100644 --- a/translations/es.json +++ b/translations/es.json @@ -11,6 +11,7 @@ /* WEATHER */ "N": "N", "NNE": "NNE", + "NE": "NE", "ENE": "ENE", "E": "E", "ESE": "ESE", diff --git a/translations/fr.json b/translations/fr.json index 9e1758a4..7cea0700 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -1,27 +1,28 @@ { - /* GENERAL */ - "LOADING": "Chargement …", + /* GENERAL */ + "LOADING": "Chargement …", - /* CALENDAR */ - "TODAY": "Aujourd'hui", - "TOMORROW": "Demain", - "RUNNING": "Se termine dans", - "EMPTY": "Aucun RDV.", + /* CALENDAR */ + "TODAY": "Aujourd'hui", + "TOMORROW": "Demain", + "RUNNING": "Se termine dans", + "EMPTY": "Aucun RDV.", - /* WEATHER */ - "N": "N", - "NNE": "NNE", - "ENE": "ENE", - "E": "E", - "ESE": "ESE", - "SE": "SE", - "SSE": "SSE", - "S": "S", - "SSW": "SSO", - "SW": "SO", - "WSW": "OSO", - "W": "O", - "WNW": "ONO", - "NW": "NO", - "NNW": "NNO" + /* WEATHER */ + "N": "N", + "NNE": "NNE", + "NE": "NE", + "ENE": "ENE", + "E": "E", + "ESE": "ESE", + "SE": "SE", + "SSE": "SSE", + "S": "S", + "SSW": "SSO", + "SW": "SO", + "WSW": "OSO", + "W": "O", + "WNW": "ONO", + "NW": "NO", + "NNW": "NNO" } diff --git a/translations/fy.json b/translations/fy.json index 849cd9b1..af6bcde8 100644 --- a/translations/fy.json +++ b/translations/fy.json @@ -11,6 +11,7 @@ /* WEATHER */ "N": "N", "NNE": "NNE", + "NE": "NE", "ENE": "ENE", "E": "E", "ESE": "ESE", diff --git a/translations/it.json b/translations/it.json index 828d0f95..74048a8b 100644 --- a/translations/it.json +++ b/translations/it.json @@ -1,27 +1,28 @@ { - /* GENERAL */ - "LOADING": "Caricamento in corso …", + /* GENERAL */ + "LOADING": "Caricamento in corso …", - /* CALENDAR */ - "TODAY": "Oggi", - "TOMORROW": "Domani", - "RUNNING": "Termina entro", - "EMPTY": "Nessun evento in arrivo.", + /* CALENDAR */ + "TODAY": "Oggi", + "TOMORROW": "Domani", + "RUNNING": "Termina entro", + "EMPTY": "Nessun evento in arrivo.", - /* WEATHER */ - "N": "N", - "NNE": "NNE", - "ENE": "ENE", - "E": "E", - "ESE": "ESE", - "SE": "SE", - "SSE": "SSE", - "S": "S", - "SSW": "SSW", - "SW": "SW", - "WSW": "WSW", - "W": "W", - "WNW": "WNW", - "NW": "NW", - "NNW": "NNW" + /* WEATHER */ + "N": "N", + "NNE": "NNE", + "NE": "NE", + "ENE": "ENE", + "E": "E", + "ESE": "ESE", + "SE": "SE", + "SSE": "SSE", + "S": "S", + "SSW": "SSW", + "SW": "SW", + "WSW": "WSW", + "W": "W", + "WNW": "WNW", + "NW": "NW", + "NNW": "NNW" } diff --git a/translations/nb.json b/translations/nb.json new file mode 100644 index 00000000..737d0e26 --- /dev/null +++ b/translations/nb.json @@ -0,0 +1,28 @@ +{ + /* GENERAL */ + "LOADING": "Laster …", + + /* CALENDAR */ + "TODAY": "I dag", + "TOMORROW": "I morgen", + "RUNNING": "Slutter om", + "EMPTY": "Ingen kommende arrangementer.", + + /* WEATHER */ + "N": "N", + "NNE": "NNØ", + "NE": "NØ", + "ENE": "ØNØ", + "E": "Ø", + "ESE": "ØSØ", + "SE": "SØ", + "SSE": "SSØ", + "S": "S", + "SSW": "SSV", + "SW": "SV", + "WSW": "VSV", + "W": "V", + "WNW": "VNV", + "NW": "NV", + "NNW": "NNV" +} diff --git a/translations/nl.json b/translations/nl.json index 5c41de00..ab84807b 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -11,6 +11,7 @@ /* WEATHER */ "N": "N", "NNE": "NNO", + "NE": "NO", "ENE": "ONO", "E": "O", "ESE": "OZO", diff --git a/translations/nn.json b/translations/nn.json new file mode 100644 index 00000000..2eb072ea --- /dev/null +++ b/translations/nn.json @@ -0,0 +1,28 @@ +{ + /* GENERAL */ + "LOADING": "Lastar …", + + /* CALENDAR */ + "TODAY": "I dag", + "TOMORROW": "I morgon", + "RUNNING": "Sluttar om", + "EMPTY": "Ingen komande hendingar.", + + /* WEATHER */ + "N": "N", + "NNE": "NNA", + "NE": "NA", + "ENE": "ANA", + "E": "A", + "ESE": "ASA", + "SE": "SA", + "SSE": "SSA", + "S": "S", + "SSW": "SSV", + "SW": "SV", + "WSW": "VSV", + "W": "V", + "WNW": "VNV", + "NW": "NV", + "NNW": "NNV" +} diff --git a/translations/pt.json b/translations/pt.json new file mode 100644 index 00000000..e7269ac1 --- /dev/null +++ b/translations/pt.json @@ -0,0 +1,28 @@ +{ + /* GENERAL */ + "LOADING": "A carregar …", + + /* CALENDAR */ + "TODAY": "Hoje", + "TOMORROW": "Amanhã", + "RUNNING": "Termina em", + "EMPTY": "Sem eventos a chegar.", + + /* WEATHER */ + "N": "N", + "NNE": "NNE", + "NE": "NE", + "ENE": "ENE", + "E": "E", + "ESE": "ESE", + "SE": "SE", + "SSE": "SSE", + "S": "S", + "SSW": "SSO", + "SW": "SO", + "WSW": "OSO", + "W": "O", + "WNW": "ONO", + "NW": "NO", + "NNW": "NNO" +} diff --git a/translations/sv.json b/translations/sv.json new file mode 100644 index 00000000..6badd3bc --- /dev/null +++ b/translations/sv.json @@ -0,0 +1,28 @@ +{ + /* GENERAL */ + "LOADING": "Laddar …", + + /* CALENDAR */ + "TODAY": "Idag", + "TOMORROW": "Imorgon", + "RUNNING": "Slutar", + "EMPTY": "Inga kommande händelser.", + + /* WEATHER */ + "N": "N", + "NNE": "NNO", + "NE": "NO", + "ENE": "ONO", + "E": "Ö", + "ESE": "OSO", + "SE": "SO", + "SSE": "SSO", + "S": "S", + "SSW": "SSV", + "SW": "SV", + "WSW": "VSV", + "W": "V", + "WNW": "VNV", + "NW": "NV", + "NNW": "NNV" +} diff --git a/translations/translations.js b/translations/translations.js index 25ad77d5..ac80702e 100644 --- a/translations/translations.js +++ b/translations/translations.js @@ -6,11 +6,15 @@ */ var translations = { - "en" : "translations/en.json", - "nl" : "translations/nl.json", - "de" : "translations/de.json", - "fr" : "translations/fr.json", - "fy" : "translations/fy.json", - "es" : "translations/es.json", - "it" : "translations/it.json", + "en" : "translations/en.json", // English + "nl" : "translations/nl.json", // Dutch + "de" : "translations/de.json", // German + "fr" : "translations/fr.json", // French + "fy" : "translations/fy.json", // Frysk + "es" : "translations/es.json", // Spanish + "nb" : "translations/nb.json", // Norsk bokmål + "nn" : "translations/nn.json", // Norsk nynorsk + "pt" : "translations/pt.json", // Português + "sv" : "translations/sv.json", // Svenska + "it" : "translations/it.json", // Italian };