From 6d2a2a1ed938c55fe0ee832af2425e2b46711bf8 Mon Sep 17 00:00:00 2001 From: andrpet Date: Fri, 15 Jan 2016 11:12:19 +0100 Subject: [PATCH] language handling --- controllets/data-sevc-controllet/data-sevc-controllet.html | 32 ++++++++++++-------------------- controllets/data-sevc-controllet/demo/index.html | 2 +- controllets/datalet-selection-controllet/datalet-selection-controllet.html | 27 +++++++++++++++------------ controllets/datalet-selection-controllet/demo/index.html | 2 +- controllets/dataset-selection-controllet/dataset-selection-controllet.html | 18 ++++++++++-------- controllets/generic-cards-container-controllet/generic-cards-container-controllet.html | 3 ++- locales/en.l20n | 51 --------------------------------------------------- locales/fr.l20n | 50 -------------------------------------------------- locales/it.l20n | 50 -------------------------------------------------- locales/lnHashMap.js | 160 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- locales/nl.l20n | 50 -------------------------------------------------- 11 files changed, 200 insertions(+), 245 deletions(-) delete mode 100755 locales/en.l20n delete mode 100755 locales/fr.l20n delete mode 100755 locales/it.l20n delete mode 100755 locales/nl.l20n diff --git a/controllets/data-sevc-controllet/data-sevc-controllet.html b/controllets/data-sevc-controllet/data-sevc-controllet.html index 0c0ee9d..6ea9ad8 100755 --- a/controllets/data-sevc-controllet/data-sevc-controllet.html +++ b/controllets/data-sevc-controllet/data-sevc-controllet.html @@ -1,12 +1,11 @@ -/******************************************************************************************************************************** - - -/******************************************************************************************************************************** + + + @@ -107,6 +106,11 @@ dataletPreset : { type : Object, value : [] + }, + + localization : { + type : String, + value : "en" } }, @@ -118,33 +122,22 @@ // console.log(this.selectedDatalet); this.dataUrl = this.dataletPreset["data-url"]; } - + ln["localization"] = this.localization; }, _updateSlider : function(e){ switch (e.detail.selected) { case 0: - /* document.l10n.formatValues('slide1Title', 'slide1Subtitle').then(A => slider.setTitle(A[0], A[1]));*/ - /*document.l10n.formatValues('slide1Title', 'slide1Subtitle').then(function(A){ - slider.setTitle(A[0], A[1]) - }, function(reason){ - var a = reason; - console.log(a); - });*/ - slider.setTitle(ln["slide1Title_it"], ln["slide1Subtitle_it"]); - -// slider.setTitle("SELECT DATASET", "Search or copy and paste the url of dataset."); + slider.setTitle(ln["slide1Title_" + this.localization], ln["slide1Subtitle_" + this.localization]); slider.chevronLeft("invisible"); slider.chevronRight(false); if(slider.getPrevSelected() == 1) slider.chevronRight(true); break; case 1: - document.l10n.formatValues('slide2Title', 'slide2Subtitle').then(function(A){slider.setTitle(A[0], A[1])}); -// slider.setTitle("SELECT DATA", "Select the fields from tree-view. The multi-table will show the values related to the selected fields."); + slider.setTitle(ln["slide2Title_" + this.localization], ln["slide2Subtitle_" + this.localization]); if(this.modify){ slider.chevronLeft("invisible"); -// slider.setAvatar("2"); } else{ slider.chevronLeft(true); @@ -154,8 +147,7 @@ this._allowThirdStep({detail: {fields: tree_view_multi_table.getFlatFields()}}); break; case 2: - document.l10n.formatValues('slide3Title', 'slide3Subtitle').then(function(A){slider.setTitle(A[0], A[1])}); -// slider.setTitle("SELECT VISUALIZATION", "Select a visualization, fill out inputs and labels (optional)."); + slider.setTitle(ln["slide3Title_" + this.localization], ln["slide3Subtitle_" + this.localization]); slider.chevronLeft(true); slider.chevronRight("invisible"); this.$.datalet_selection.setFields(tree_view_multi_table.getFlatFields()); diff --git a/controllets/data-sevc-controllet/demo/index.html b/controllets/data-sevc-controllet/demo/index.html index 47f4590..1446650 100755 --- a/controllets/data-sevc-controllet/demo/index.html +++ b/controllets/data-sevc-controllet/demo/index.html @@ -21,7 +21,7 @@ - + + diff --git a/controllets/dataset-selection-controllet/dataset-selection-controllet.html b/controllets/dataset-selection-controllet/dataset-selection-controllet.html index 5438680..55710a2 100755 --- a/controllets/dataset-selection-controllet/dataset-selection-controllet.html +++ b/controllets/dataset-selection-controllet/dataset-selection-controllet.html @@ -127,9 +127,9 @@ - - - + + + @@ -256,15 +256,17 @@ this._loadTreeMap(); - this._translate(); + this.async(function(){this._translate();},100); }, _translate : function(){ - var that = this; - document.l10n.formatValue('availableDatasets').then(function(s){$("#_datasets")[0].setAttribute("label", s)}); + this.$._datasets.setAttribute("label", ln["availableDatasets_" + ln["localization"]]); + this.$.listView.innerHTML = ln["listView_" + ln["localization"]]; + this.$.treeMapView.innerHTML = ln["treeMapView_" + ln["localization"]]; + if(this.isSuggested) - document.l10n.formatValue('suggestedDatasets').then(function(s){$("#s_datasets")[0].setAttribute("label", s)}); - document.l10n.formatValue('selectedUrl').then(function(s){that.$.selected_url.setAttribute("label", s)}); + this.$$("#s_datasets").setAttribute("label", ln["suggestedDatasets_" + ln["localization"]]); + this.$.selected_url.setAttribute("label", ln["selectedUrl_" + ln["localization"]]); }, _filterDatasets : function(e){ diff --git a/controllets/generic-cards-container-controllet/generic-cards-container-controllet.html b/controllets/generic-cards-container-controllet/generic-cards-container-controllet.html index 9fb1788..ab5cb8e 100755 --- a/controllets/generic-cards-container-controllet/generic-cards-container-controllet.html +++ b/controllets/generic-cards-container-controllet/generic-cards-container-controllet.html @@ -95,7 +95,8 @@ Example: display: none; } - ::content .card_grid .open{ + ::content .card_grid .open + { display: none; } diff --git a/locales/en.l20n b/locales/en.l20n deleted file mode 100755 index 1669b73..0000000 --- a/locales/en.l20n +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/locales/fr.l20n b/locales/fr.l20n deleted file mode 100755 index 9865bb9..0000000 --- a/locales/fr.l20n +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/locales/it.l20n b/locales/it.l20n deleted file mode 100755 index 93d3f7e..0000000 --- a/locales/it.l20n +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/locales/lnHashMap.js b/locales/lnHashMap.js index cbb654a..0c9ddc2 100644 --- a/locales/lnHashMap.js +++ b/locales/lnHashMap.js @@ -1,5 +1,6 @@ var ln = []; +/* IT */ ln["slide1Title_it"] = "SELEZIONA IL DATASET"; ln["slide1Subtitle_it"] = "Ricerca o copia e incolla la url del dataset."; ln["slide2Title_it"] = "SELEZIONA I DATI"; @@ -49,4 +50,161 @@ ln["heatmapCategoriesDescription_it"] = "Categorie del grafico. I valori saranno ln["LatitudeDescription_it"] = "Latitudine del punto da riportare sulla mappa."; ln["LongitudeDescription_it"] = "Longitudine del punto da riportare sulla mappa."; -ln["BalloonContentDescription_it"] = "Descrizione del segnaposto o link all'immagine che visualizza il luogo specificato sulla mappa."; \ No newline at end of file +ln["BalloonContentDescription_it"] = "Descrizione del segnaposto o link all'immagine che visualizza il luogo specificato sulla mappa."; + +/* EN */ +ln["slide1Title_en"] = "SELECT DATASET"; +ln["slide1Subtitle_en"] = "Search or copy and paste the url of dataset."; +ln["slide2Title_en"] = "SELECT DATA"; +ln["slide2Subtitle_en"] = "Select the fields from tree-view. The multi-table will show the values related to the selected fields."; +ln["slide3Title_en"] = "SELECT VISUALIZATION"; +ln["slide3Subtitle_en"] = "Select a visualization, fill out inputs and labels (optional)."; + +ln["listView_en"] = "LIST VIEW"; +ln["treeMapView_en"] = "TREE MAP VIEW"; +ln["mostPopular_en"] = "MOST POPULAR"; +ln["availableDatasets_en"] = "Available datasets"; +ln["suggestedDatasets_en"] = "Suggested datasets"; +ln["selectedUrl_en"] = "Selected url"; + +ln["inputs_en"] = "INPUTS"; +ln["layouts_en"] = "LABELS / OPTIONS"; +ln["baseInfo_en"] = "BASE INFO"; +ln["comment_en"] = "COMMENT"; +ln["commentLabel_en"] = "comment (max 100 characters)"; +ln["dataletPreview_en"] = "PREVIEW"; +ln["addDatalet_en"] = "ADD"; +ln["modifyDatalet_en"] = "MODIFY"; + +ln["cellDescription_en"] = "The cell of table."; +ln["levelDescription_en"] = "It is the level field that the datalet will use to group the values at corrisponding field number level."; + +ln["categoriesDescription_en"] = "The chart categories. Its values will be put in the horizontal axis. You need one value for each series."; +ln["seriesDescription_en"] = "The chart series. Its values will be put in the vertical axis."; + +ln["XAxisLabelDescription_en"] = "The label for the X axis."; +ln["YAxisLabelDescription_en"] = "The label for the Y axis."; +ln["suffixDescription_en"] = "The values suffix (eg units, dollars, euro, ...)."; + +ln["pieSeriesDescription_en"] = "The chart series. Its values will be put on slice of each series."; +ln["pieSizeDescription_en"] = "The size for each series to create a concentric rings."; + +ln["bubbleCategoriesDescription_en"] = "The chart categories. Its values will be put in the horizontal axis. You need one value for each series."; +ln["bubbleYValuesDescription_en"] = "The chart plots y values. Its values will be put in the vertical axis."; +ln["bubbleZValuesDescription_en"] = "The chart plots z value. Its values represent the size of the bubble."; +ln["bubbleSeriesDescription_en"] = "The chart series. Its values visualize multi- series bubbles chart."; + +ln["scatterCategoriesDescription_en"] = "The chart categories. You need one value for each series."; +ln["scatterXValuesDescription_en"] = "The chart plots x values. Its values will be put in the horizontal axis."; +ln["scatterYValuesDescription_en"] = "The chart plots y value. Its values will be put in the vertical axis."; + +ln["heatmapCategoriesDescription_en"] = "The chart categories. Its values will be put in the horizontal axis."; + +ln["LatitudeDescription_en"] = "It is latitude of the points you want to show in the map."; +ln["LongitudeDescription_en"] = "It is longitude of the points you want to show in the map."; +ln["BalloonContentDescription_en"] = "It is the text associated to the marker or the link to the image related to the camera associated to each points."; + + +/* FR */ +ln["slide1Title_fr"] = "SELECTIONNER UN JEU DE DONNEES"; +ln["slide1Subtitle_fr"] = "Rechercher ou copier/coller l’url du jeu de données."; +ln["slide2Title_fr"] = "SELECTIONNER DONNEES"; +ln["slide2Subtitle_fr"] = "Sélectionner les champs à partir de l’arborescence. Une fenêtre vous indiquera les valeurs relatives aux champs sélectionnés."; +ln["slide3Title_fr"] = "SELECTIONNER UN MODE DE VISUALISATION"; +ln["slide3Subtitle_fr"] = "Sélectionner un mode de visualisation, remplir les entrées et les vignettes (optionnel)."; + +ln["listView_fr"] = "VUE EN LISTE"; +ln["treeMapView_fr"] = "VUE EN ARBORESCENCE"; +ln["mostPopular_fr"] = "LES PLUS POPULAIRES"; +ln["availableDatasets_fr"] = "Jeux de données disponibles"; +ln["suggestedDatasets_fr"] = "Jeux de données suggérés"; +ln["selectedUrl_fr"] = "Sélectionner URL"; + +ln["inputs_fr"] = "SORTIES"; +ln["layouts_fr"] = "VIGNETTES/OPTIONSs"; +ln["baseInfo_fr"] = "INFORMATION DE BASE"; +ln["comment_fr"] = "COMMENTAIRES"; +ln["commentLabel_fr"] = "Commentaires (maximum 100 caractères)"; +ln["dataletPreview_fr"] = "PREVISUALISATION"; +ln["addDatalet_fr"] = "AJOUTER"; +ln["modifyDatalet_fr"] = "MODIFIER"; + +ln["cellDescription_fr"] = "Cellules du tableau."; +ln["levelDescription_fr"] = "C’est le niveau local que le graphique utilisera pour grouper les valeurs correspondantes au nombre de niveaux de champs"; + +ln["categoriesDescription_fr"] = "Catégories de graphiques. Ses valeurs seront insérées dans l’axe horizontal. Vous devez insérer une valeur pour chaque série."; +ln["seriesDescription_fr"] = "Catégories de graphique. Ses valeurs seront insérées dans l’axe vertical."; + +ln["XAxisLabelDescription_fr"] = "Vignette pour l’axe X."; +ln["YAxisLabelDescription_fr"] = "Vignette pour l’axe Y."; +ln["suffixDescription_fr"] = "Unités de mesures (ex: dollars, euros."; + +ln["pieSeriesDescription_fr"] = "Série de graphiques. Ses valeurs seront intégrées au sein des segments de chaque série."; +ln["pieSizeDescription_fr"] = "Taille de chaque série afin de créer un anneau concentrique."; + +ln["bubbleCategoriesDescription_fr"] = "Catégories de graphique. Ses valeurs seront insérées dans l’axe horizontal. Vous devez insérer une valeur pour chaque série."; +ln["bubbleYValuesDescription_fr"] = "Le graphique présente les valeurs Y. Ses valeurs seront insérées dans l’axe vertical."; +ln["bubbleZValuesDescription_fr"] = "Le graphique présente les valeurs Z. Ses valeurs représentent la taille des bulles."; +ln["bubbleSeriesDescription_fr"] = "The chart series. Its values visualize multi- series bubbles chart."; + +ln["scatterCategoriesDescription_fr"] = "The chart categories. You need one value for each series."; +ln["scatterXValuesDescription_fr"] = "The chart plots x values. Its values will be put in the horizontal axis."; +ln["scatterYValuesDescription_fr"] = "The chart plots y value. Its values will be put in the vertical axis."; + +ln["heatmapCategoriesDescription_fr"] = "The chart categories. Its values will be put in the horizontal axis."; + +ln["LatitudeDescription_fr"] = "Latitude des points que vous souhaitez montrer sur la carte."; +ln["LongitudeDescription_fr"] = "Longitude des points que vous souhaitez montrer sur la carte."; +ln["BalloonContentDescription_fr"] = "It is the text associated to the marker or the link to the image related to the camera associated to each points."; + +/* NL */ +ln["slide1Title_nl"] = "SELECT DATASET"; +ln["slide1Subtitle_nl"] = "Search or copy and paste the url of dataset."; +ln["slide2Title_nl"] = "SELECT DATA"; +ln["slide2Subtitle_nl"] = "Select the fields from tree-view. The multi-table will show the values related to the selected fields."; +ln["slide3Title_nl"] = "SELECT VISUALIZATION"; +ln["slide3Subtitle_nl"] = "Select a visualization, fill out inputs and labels (optional)."; + +ln["listView_nl"] = "LIST VIEW"; +ln["treeMapView_nl"] = "TREE MAP VIEW"; +ln["mostPopular_nl"] = "MOST POPULAR"; +ln["availableDatasets_nl"] = "Available datasets"; +ln["suggestedDatasets_nl"] = "Suggested datasets"; +ln["selectedUrl_nl"] = "Selected url"; + +ln["inputs_nl"] = "INPUTS"; +ln["layouts_nl"] = "LABELS / OPTIONS"; +ln["baseInfo_nl"] = "BASE INFO"; +ln["comment_nl"] = "COMMENT"; +ln["commentLabel_nl"] = "comment (max 100 characters)"; +ln["dataletPreview_nl"] = "PREVIEW"; +ln["addDatalet_nl"] = "ADD"; +ln["modifyDatalet_nl"] = "MODIFY"; + +ln["cellDescription_nl"] = "The cell of table."; +ln["levelDescription_nl"] = "It is the level field that the datalet will use to group the values at corrisponding field number level."; + +ln["categoriesDescription_nl"] = "The chart categories. Its values will be put in the horizontal axis. You need one value for each series."; +ln["seriesDescription_nl"] = "The chart series. Its values will be put in the vertical axis."; + +ln["XAxisLabelDescription_nl"] = "The label for the X axis."; +ln["YAxisLabelDescription_nl"] = "The label for the Y axis."; +ln["suffixDescription_nl"] = "The values suffix (eg units, dollars, euro, ...)."; + +ln["pieSeriesDescription_nl"] = "The chart series. Its values will be put on slice of each series."; +ln["pieSizeDescription_nl"] = "The size for each series to create a concentric rings."; + +ln["bubbleCategoriesDescription_nl"] = "The chart categories. Its values will be put in the horizontal axis. You need one value for each series."; +ln["bubbleYValuesDescription_nl"] = "The chart plots y values. Its values will be put in the vertical axis."; +ln["bubbleZValuesDescription_nl"] = "The chart plots z value. Its values represent the size of the bubble."; +ln["bubbleSeriesDescription_nl"] = "The chart series. Its values visualize multi- series bubbles chart."; + +ln["scatterCategoriesDescription_nl"] = "The chart categories. You need one value for each series."; +ln["scatterXValuesDescription_nl"] = "The chart plots x values. Its values will be put in the horizontal axis."; +ln["scatterYValuesDescription_nl"] = "The chart plots y value. Its values will be put in the vertical axis."; + +ln["heatmapCategoriesDescription_nl"] = "The chart categories. Its values will be put in the horizontal axis."; + +ln["LatitudeDescription_nl"] = "It is latitude of the points you want to show in the map."; +ln["LongitudeDescription_nl"] = "It is longitude of the points you want to show in the map."; +ln["BalloonContentDescription_nl"] = "It is the text associated to the marker or the link to the image related to the camera associated to each points."; \ No newline at end of file diff --git a/locales/nl.l20n b/locales/nl.l20n deleted file mode 100755 index f7f7bd7..0000000 --- a/locales/nl.l20n +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file -- libgit2 0.21.4