Add some translations (mostly french).

This commit is contained in:
Teddy Payet 2018-07-10 15:03:54 +02:00
parent c295115ffc
commit 08fa511d17
8 changed files with 39 additions and 20 deletions

View File

@ -9,7 +9,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
*This release is scheduled to be released on 2018-10-01.* *This release is scheduled to be released on 2018-10-01.*
### Added ### Added
- French translate for "Feels"
- Translations for newsfeed module
- Support for toggling news article in fullscreen - Support for toggling news article in fullscreen
### Fixed ### Fixed

View File

@ -0,0 +1,4 @@
{
"sysTitle": "MagicMirror Notification",
"welcome": "Bienvenue, le démarrage a été un succès!"
}

View File

@ -90,7 +90,7 @@ Module.register("newsfeed",{
if (this.config.feedUrl) { if (this.config.feedUrl) {
wrapper.className = "small bright"; wrapper.className = "small bright";
wrapper.innerHTML = "The configuration options for the newsfeed module have changed.<br>Please check the documentation."; wrapper.innerHTML = this.translate("configuration_changed");
return wrapper; return wrapper;
} }
@ -123,21 +123,21 @@ Module.register("newsfeed",{
//Remove selected tags from the beginning of rss feed items (title or description) //Remove selected tags from the beginning of rss feed items (title or description)
if (this.config.removeStartTags == "title" || this.config.removeStartTags == "both") { if (this.config.removeStartTags === "title" || this.config.removeStartTags === "both") {
for (f=0; f<this.config.startTags.length;f++) { for (f=0; f<this.config.startTags.length;f++) {
if (this.newsItems[this.activeItem].title.slice(0,this.config.startTags[f].length) == this.config.startTags[f]) { if (this.newsItems[this.activeItem].title.slice(0,this.config.startTags[f].length) === this.config.startTags[f]) {
this.newsItems[this.activeItem].title = this.newsItems[this.activeItem].title.slice(this.config.startTags[f].length,this.newsItems[this.activeItem].title.length); this.newsItems[this.activeItem].title = this.newsItems[this.activeItem].title.slice(this.config.startTags[f].length,this.newsItems[this.activeItem].title.length);
} }
} }
} }
if (this.config.removeStartTags == "description" || this.config.removeStartTags == "both") { if (this.config.removeStartTags === "description" || this.config.removeStartTags === "both") {
if (this.isShowingDescription) { if (this.isShowingDescription) {
for (f=0; f<this.config.startTags.length;f++) { for (f=0; f<this.config.startTags.length;f++) {
if (this.newsItems[this.activeItem].description.slice(0,this.config.startTags[f].length) == this.config.startTags[f]) { if (this.newsItems[this.activeItem].description.slice(0,this.config.startTags[f].length) === this.config.startTags[f]) {
this.newsItems[this.activeItem].title = this.newsItems[this.activeItem].description.slice(this.config.startTags[f].length,this.newsItems[this.activeItem].description.length); this.newsItems[this.activeItem].title = this.newsItems[this.activeItem].description.slice(this.config.startTags[f].length,this.newsItems[this.activeItem].description.length);
} }
} }
@ -149,14 +149,14 @@ Module.register("newsfeed",{
if (this.config.removeEndTags) { if (this.config.removeEndTags) {
for (f=0; f<this.config.endTags.length;f++) { for (f=0; f<this.config.endTags.length;f++) {
if (this.newsItems[this.activeItem].title.slice(-this.config.endTags[f].length)==this.config.endTags[f]) { if (this.newsItems[this.activeItem].title.slice(-this.config.endTags[f].length)===this.config.endTags[f]) {
this.newsItems[this.activeItem].title = this.newsItems[this.activeItem].title.slice(0,-this.config.endTags[f].length); this.newsItems[this.activeItem].title = this.newsItems[this.activeItem].title.slice(0,-this.config.endTags[f].length);
} }
} }
if (this.isShowingDescription) { if (this.isShowingDescription) {
for (f=0; f<this.config.endTags.length;f++) { for (f=0; f<this.config.endTags.length;f++) {
if (this.newsItems[this.activeItem].description.slice(-this.config.endTags[f].length)==this.config.endTags[f]) { if (this.newsItems[this.activeItem].description.slice(-this.config.endTags[f].length)===this.config.endTags[f]) {
this.newsItems[this.activeItem].description = this.newsItems[this.activeItem].description.slice(0,-this.config.endTags[f].length); this.newsItems[this.activeItem].description = this.newsItems[this.activeItem].description.slice(0,-this.config.endTags[f].length);
} }
} }
@ -338,7 +338,7 @@ Module.register("newsfeed",{
notificationReceived: function(notification, payload, sender) { notificationReceived: function(notification, payload, sender) {
Log.info(this.name + " - received notification: " + notification); Log.info(this.name + " - received notification: " + notification);
if(notification == "ARTICLE_NEXT"){ if(notification === "ARTICLE_NEXT"){
var before = this.activeItem; var before = this.activeItem;
this.activeItem++; this.activeItem++;
if (this.activeItem >= this.newsItems.length) { if (this.activeItem >= this.newsItems.length) {
@ -347,7 +347,7 @@ Module.register("newsfeed",{
this.resetDescrOrFullArticleAndTimer(); this.resetDescrOrFullArticleAndTimer();
Log.info(this.name + " - going from article #" + before + " to #" + this.activeItem + " (of " + this.newsItems.length + ")"); Log.info(this.name + " - going from article #" + before + " to #" + this.activeItem + " (of " + this.newsItems.length + ")");
this.updateDom(100); this.updateDom(100);
} else if(notification == "ARTICLE_PREVIOUS"){ } else if(notification === "ARTICLE_PREVIOUS"){
var before = this.activeItem; var before = this.activeItem;
this.activeItem--; this.activeItem--;
if (this.activeItem < 0) { if (this.activeItem < 0) {
@ -358,9 +358,9 @@ Module.register("newsfeed",{
this.updateDom(100); this.updateDom(100);
} }
// if "more details" is received the first time: show article summary, on second time show full article // if "more details" is received the first time: show article summary, on second time show full article
else if(notification == "ARTICLE_MORE_DETAILS"){ else if(notification === "ARTICLE_MORE_DETAILS"){
// full article is already showing, so scrolling down // full article is already showing, so scrolling down
if(this.config.showFullArticle == true){ if(this.config.showFullArticle === true){
this.scrollPosition += this.config.scrollLength; this.scrollPosition += this.config.scrollLength;
window.scrollTo(0, this.scrollPosition); window.scrollTo(0, this.scrollPosition);
Log.info(this.name + " - scrolling down"); Log.info(this.name + " - scrolling down");
@ -369,18 +369,18 @@ Module.register("newsfeed",{
else { else {
this.showFullArticle(); this.showFullArticle();
} }
} else if(notification == "ARTICLE_SCROLL_UP"){ } else if(notification === "ARTICLE_SCROLL_UP"){
if(this.config.showFullArticle == true){ if(this.config.showFullArticle === true){
this.scrollPosition -= this.config.scrollLength; this.scrollPosition -= this.config.scrollLength;
window.scrollTo(0, this.scrollPosition); window.scrollTo(0, this.scrollPosition);
Log.info(this.name + " - scrolling up"); Log.info(this.name + " - scrolling up");
Log.info(this.name + " - ARTICLE_SCROLL_UP, scroll position: " + this.config.scrollLength); Log.info(this.name + " - ARTICLE_SCROLL_UP, scroll position: " + this.config.scrollLength);
} }
} else if(notification == "ARTICLE_LESS_DETAILS"){ } else if(notification === "ARTICLE_LESS_DETAILS"){
this.resetDescrOrFullArticleAndTimer(); this.resetDescrOrFullArticleAndTimer();
Log.info(this.name + " - showing only article titles again"); Log.info(this.name + " - showing only article titles again");
this.updateDom(100); this.updateDom(100);
} else if (notification == "ARTICLE_TOGGLE_FULL"){ } else if (notification === "ARTICLE_TOGGLE_FULL"){
if (this.config.showFullArticle){ if (this.config.showFullArticle){
this.activeItem++; this.activeItem++;
this.resetDescrOrFullArticleAndTimer(); this.resetDescrOrFullArticleAndTimer();
@ -396,7 +396,7 @@ Module.register("newsfeed",{
this.isShowingDescription = !this.isShowingDescription; this.isShowingDescription = !this.isShowingDescription;
this.config.showFullArticle = !this.isShowingDescription; this.config.showFullArticle = !this.isShowingDescription;
// make bottom bar align to top to allow scrolling // make bottom bar align to top to allow scrolling
if(this.config.showFullArticle == true){ if(this.config.showFullArticle === true){
document.getElementsByClassName("region bottom bar")[0].style.bottom = "inherit"; document.getElementsByClassName("region bottom bar")[0].style.bottom = "inherit";
document.getElementsByClassName("region bottom bar")[0].style.top = "-90px"; document.getElementsByClassName("region bottom bar")[0].style.top = "-90px";
} }

View File

@ -0,0 +1,3 @@
{
"configuration_changed": "Las opciones de configuración para el módulo de suministro de noticias han cambiado. \nVerifique la documentación."
}

View File

@ -0,0 +1,3 @@
{
"configuration_changed": "The configuration options for the newsfeed module have changed.\nPlease check the documentation."
}

View File

@ -0,0 +1,3 @@
{
"configuration_changed": "Die Konfigurationsoptionen für das Newsfeed-Modul haben sich geändert. \nBitte überprüfen Sie die Dokumentation."
}

View File

@ -0,0 +1,3 @@
{
"configuration_changed": "Les options de configuration du module newsfeed ont changé. \nVeuillez consulter la documentation."
}

View File

@ -6,7 +6,7 @@
"DAYAFTERTOMORROW": "Après-demain", "DAYAFTERTOMORROW": "Après-demain",
"RUNNING": "Se termine dans", "RUNNING": "Se termine dans",
"EMPTY": "Aucun RDV à venir.", "EMPTY": "Aucun RDV à venir.",
"WEEK": "Semaine {weekNumber}", "WEEK": "Semaine {weekNumber}",
"N": "N", "N": "N",
@ -25,8 +25,10 @@
"WNW": "ONO", "WNW": "ONO",
"NW": "NO", "NW": "NO",
"NNW": "NNO", "NNW": "NNO",
"UPDATE_NOTIFICATION": "Une mise à jour de MagicMirror² est disponible", "UPDATE_NOTIFICATION": "Une mise à jour de MagicMirror² est disponible",
"UPDATE_NOTIFICATION_MODULE": "Une mise à jour est disponible pour le module {MODULE_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} ." "UPDATE_INFO": "L'installation actuelle est {COMMIT_COUNT} en retard sur la branche {BRANCH_NAME} .",
"FEELS": "Ressenti"
} }