From ce16ddf29cbf929321398f567c2dff546a58ae33 Mon Sep 17 00:00:00 2001
From: Armand Bahi <armand.bahi@veremes.com>
Date: Wed, 20 Feb 2019 12:22:12 +0100
Subject: [PATCH] Translate maplist

---
 src/module_vmap/module/lang/lang-en.json      | 16 +++++++++
 src/module_vmap/module/lang/lang-fr.json      | 16 +++++++++
 .../template/layers/mapmodal/maplist.html     | 33 +++++++++----------
 .../layers/mapmodal/maplistlitle.html         |  4 +--
 .../layers/mapmodal/maplistlitle_mobile.html  |  4 +--
 5 files changed, 52 insertions(+), 21 deletions(-)

diff --git a/src/module_vmap/module/lang/lang-en.json b/src/module_vmap/module/lang/lang-en.json
index f31755d7..e9bb4ea2 100644
--- a/src/module_vmap/module/lang/lang-en.json
+++ b/src/module_vmap/module/lang/lang-en.json
@@ -535,6 +535,13 @@
     "VMAP_NO_RESULTS_AVAILABLE": "No result available",
     "VMAP_SERVICE": "Service",
     "VMAP_FIND": "Find",
+    "VMAP_FILE": "File",
+    "VMAP_USE": "Use",
+    "VMAP_THEME": "Theme",
+    "VMAP_CENTER": "Center",
+    "VMAP_REPROJECT": "Reproject",
+    "VMAP_CREATE_AND_USE": "Create and use",
+    "VMAP_ALL": "All",
     "": "",
     "VMAP_LAYERTREE_DATASETS": "Datasets",
     "VMAP_LAYERTREE_MAP_1": "Map 1",
@@ -639,5 +646,14 @@
     "VMAP_MAPMODAL_GEOM_DRAG_FILE_DESCR": "Or simply drag file here",
     "VMAP_MAPMODAL_GEOM_DRAG_FILE_HERE": "Drag file here",
     "VMAP_MAPMODAL_GEOM_FORMATS": "Supported formats",
+    "": "",
+    "VMAP_MAPMODAL_MAPLIST_TITLE": "Avaliable maps list",
+    "VMAP_MAPMODAL_MAPLIST_DRAG_FILE_HERE": "Drag file here",
+    "VMAP_MAPMODAL_MAPLIST_NEW_MAP": "New map",
+    "VMAP_MAPMODAL_MAPLIST_NEW_EMPTY_MAP": "New map (empty)",
+    "VMAP_MAPMODAL_MAPLIST_USE_THIS_MAP": "use this map",
+    "VMAP_MAPMODAL_MAPLIST_ZOOM_LEVEL": "Zoom level",
+    "VMAP_MAPMODAL_MAPLIST_ZOOM_LEVEL_MAX": "Maximum zoom level",
+    "VMAP_MAPMODAL_MAPLIST_ZOOM_LEVEL_MIM": "Minimum zoom level",
     "": ""
 }
diff --git a/src/module_vmap/module/lang/lang-fr.json b/src/module_vmap/module/lang/lang-fr.json
index 651a9ad2..f247ab43 100644
--- a/src/module_vmap/module/lang/lang-fr.json
+++ b/src/module_vmap/module/lang/lang-fr.json
@@ -536,6 +536,13 @@
     "VMAP_NO_RESULTS_AVAILABLE": "Aucun résultat disponible",
     "VMAP_SERVICE": "Service",
     "VMAP_FIND": "Chercher",
+    "VMAP_FILE": "Fichier",
+    "VMAP_USE": "Utiliser",
+    "VMAP_THEME": "Thème",
+    "VMAP_CENTER": "Centre",
+    "VMAP_REPROJECT": "Reprojeter",
+    "VMAP_CREATE_AND_USE": "Créér et utiliser",
+    "VMAP_ALL": "Tous",
     "": "",
     "VMAP_LAYERTREE_DATASETS": "Jeux de données",
     "VMAP_LAYERTREE_MAP_1": "Carte 1",
@@ -640,5 +647,14 @@
     "VMAP_MAPMODAL_GEOM_DRAG_FILE_DESCR": "Ou simplement déplacer le fichier ci-dessous",
     "VMAP_MAPMODAL_GEOM_DRAG_FILE_HERE": "Déplacer le fichier ici",
     "VMAP_MAPMODAL_GEOM_FORMATS": "Formats supportés",
+    "": "",
+    "VMAP_MAPMODAL_MAPLIST_TITLE": "Liste des cartes utilisables",
+    "VMAP_MAPMODAL_MAPLIST_DRAG_FILE_HERE": "Déplacer le fichier ici",
+    "VMAP_MAPMODAL_MAPLIST_NEW_MAP": "Nouvelle carte",
+    "VMAP_MAPMODAL_MAPLIST_NEW_EMPTY_MAP": "Nouvelle carte (vide)",
+    "VMAP_MAPMODAL_MAPLIST_USE_THIS_MAP": "Utiliser cette carte",
+    "VMAP_MAPMODAL_MAPLIST_ZOOM_LEVEL": "Niveau de zoom",
+    "VMAP_MAPMODAL_MAPLIST_ZOOM_LEVEL_MAX": "Niveau de zoom maximum",
+    "VMAP_MAPMODAL_MAPLIST_ZOOM_LEVEL_MIM": "Niveau de zoom minimum",
     "": ""
 }
diff --git a/src/module_vmap/module/template/layers/mapmodal/maplist.html b/src/module_vmap/module/template/layers/mapmodal/maplist.html
index f484cc33..754ce286 100644
--- a/src/module_vmap/module/template/layers/mapmodal/maplist.html
+++ b/src/module_vmap/module/template/layers/mapmodal/maplist.html
@@ -1,12 +1,11 @@
 <!-- Liste des cartes utilisables -->
 
-
-<h3>Liste des cartes utilisables: </h3>
+<h3>{{ 'VMAP_MAPMODAL_MAPLIST_TITLE' | translate }}: </h3>
 <hr>
 <div>
     <div class="row">
         <div class="col-md-10">
-            <b>Fichier:</b>
+            <b>{{ 'VMAP_FILE' | translate }}:</b>
         </div>
         <div class="col-md-2">
         </div>
@@ -17,19 +16,19 @@
                 <input type="text" id="upload-file-info" class="form-control" ng-model="ctrl.newMapUrl" placeholder="http://www.ma-carte.com/get-map.php">
                 <span class="input-group-btn">
                     <span class="btn btn-success btn-file">
-                        Chercher&hellip; <input type="file" id="browse-map-button" onchange='oVmap.getMapManager().getMapModalTool().getMapListTool().changeFilePath(this)'>
+                        {{ 'VMAP_FIND' | translate }}&hellip; <input type="file" id="browse-map-button" onchange='oVmap.getMapManager().getMapModalTool().getMapListTool().changeFilePath(this)'>
                     </span>
                 </span>
             </div>
         </div>
         <div class="col-md-2">
             <!-- l'attribut "url" est utilisé si on rentre le path à la main, si on rentre par le bouton "browse", alors on utilisera le contennu de browse-map-button -->
-            <button type="button" id="upload-file-add-button" url="{{ctrl.newMapUrl}}" file-container="" class="btn btn-success right" onclick="oVmap.getMapManager().loadMapFromFile(this)">Utiliser</button>
+            <button type="button" id="upload-file-add-button" url="{{ctrl.newMapUrl}}" file-container="" class="btn btn-success right" onclick="oVmap.getMapManager().loadMapFromFile(this)">{{ 'VMAP_USE' | translate }}</button>
         </div>
     </div>
 </div>
 <br>
-<div class="upload-drop-zone" id="maplist-file-drop-zone">Déplacer le fichier ici</div>
+<div class="upload-drop-zone" id="maplist-file-drop-zone">{{ 'VMAP_MAPMODAL_MAPLIST_DRAG_FILE_HERE' | translate }}</div>
 <div id="maplist-log-message"></div>
 <div class="row">
     <div class="col-md-10"></div>
@@ -40,7 +39,7 @@
                 data-toggle="modal"
                 data-target="#mapmodal-newmap-modal"
                 ng-click="ctrl.initNewMapForm()">
-            Nouvelle carte (vide)
+            {{ 'VMAP_MAPMODAL_MAPLIST_NEW_EMPTY_MAP' | translate }}
         </button>
     </div>
 </div>
@@ -63,11 +62,11 @@
         <div class="col-md-3"></div>
         <div class="col-md-6">
             <div ng-if="node.theme_name !== null && node.theme_name !== undefined">
-                <b>Thème</b>: <i>{{node.theme_name}}</i>
+                <b>{{ 'VMAP_THEME' | translate }}</b>: <i>{{node.theme_name}}</i>
             </div>
         </div>
         <div class="col-md-3">
-            <button type="button" url="{{node.url}}" class="btn btn-primary right" data-dismiss="modal" onclick="oVmap.getMapManager().loadMap(this)">Utiliser cette carte</button>
+            <button type="button" url="{{node.url}}" class="btn btn-primary right" data-dismiss="modal" onclick="oVmap.getMapManager().loadMap(this)">{{ 'VMAP_MAPMODAL_MAPLIST_USE_THIS_MAP' | translate }}</button>
         </div>
     </div>
     <hr>
@@ -84,11 +83,11 @@
         <div class="modal-content">
             <div class="modal-header">
                 <button type="button" class="close" onclick="$('#mapmodal-newmap-modal').modal('hide')">&times;</button>
-                <h4 class="modal-title">Nouvelle carte</h4>
+                <h4 class="modal-title">{{ 'VMAP_MAPMODAL_MAPLIST_NEW_MAP' | translate }}</h4>
             </div>
             <div class="modal-body">
                 <form>
-                    <label>Centre</label>
+                    <label>{{ 'VMAP_CENTER' | translate }}</label>
                     <div class="row">
                         <div class="col-md-4">
                             <div class="input-group">
@@ -107,27 +106,27 @@
                                 <button id="myMap-newMapForm-reproject"
                                         class="btn btn-success"
                                         title="Reprojeter en fonction de la nouvelle projection"
-                                        ng-click="ctrl.reprojectCenter()">Reprojeter</button>
+                                        ng-click="ctrl.reprojectCenter()">{{ 'VMAP_REPROJECT' | translate }}</button>
                             </div>
                         </div>
                     </div>
                     <br>
 
-                    <label>Niveau de zoom</label>
+                    <label>{{ 'VMAP_MAPMODAL_MAPLIST_ZOOM_LEVEL' | translate }}</label>
                     <div class="row">
                         <div class="col-md-3">
                             <input type="number" class="form-control" required="true" ng-model="ctrl.mapForm.view.zoom">
                         </div>
                     </div>
                     <br>
-                    <label>Niveau de zoom maximum</label>
+                    <label>{{ 'VMAP_MAPMODAL_MAPLIST_ZOOM_LEVEL_MAX' | translate }}</label>
                     <div class="row">
                         <div class="col-md-3">
                             <input type="number" class="form-control" required="true" ng-model="ctrl.mapForm.view.maxZoom">
                         </div>
                     </div>
                     <br>
-                    <label>Niveau de zoom minimum</label>
+                    <label>{{ 'VMAP_MAPMODAL_MAPLIST_ZOOM_LEVEL_MIM' | translate }}</label>
                     <div class="row">
                         <div class="col-md-3">
                             <input type="number" class="form-control" required="true" ng-model="ctrl.mapForm.view.minZoom">
@@ -135,7 +134,7 @@
                     </div>
                     <br>
 
-                    <label>Projection</label>
+                    <label>{{ 'VMAP_PROJETION' | translate }}</label>
                     <select class="form-control" ng-model="ctrl.mapForm.view.projection">
                         <option ng-repeat="(key, value) in ctrl.projections"
                                 value="{{key}}">{{value}}</option>
@@ -146,7 +145,7 @@
                         <button type="submit"
                                 class="btn btn-primary center"
                                 onclick="$('#mapmodal-newmap-modal').modal('hide')"
-                                ng-click="ctrl.createNewMap()">Créér et utiliser</button>
+                                ng-click="ctrl.createNewMap()">{{ 'VMAP_CREATE_AND_USE' | translate }}</button>
                     </div>
                 </form>
             </div>
diff --git a/src/module_vmap/module/template/layers/mapmodal/maplistlitle.html b/src/module_vmap/module/template/layers/mapmodal/maplistlitle.html
index bbfb1ce3..274403bf 100644
--- a/src/module_vmap/module/template/layers/mapmodal/maplistlitle.html
+++ b/src/module_vmap/module/template/layers/mapmodal/maplistlitle.html
@@ -4,13 +4,13 @@
     <div style="width: 100%; height: 30px;">
 
         <select class="form-control minus left margin-5 margin-sides-10" style="width: 200px" ng-model="filterTheme">
-            <option value="">Tous</option>
+            <option value="">{{ 'VMAP_ALL' | translate }}</option>
             <option ng-repeat="theme in themes | orderBy" ng-value="theme">{{theme}}</option>
         </select>
 
         <input class="form-control input-sm right margin-sides-10 margin-5"
                type="text"
-               placeholder="Rechercher"
+               placeholder="{{ 'VMAP_FIND' | translate }}"
                style="width: 200px;"
                ng-model="filter">
     </div>
diff --git a/src/module_vmap/module/template/layers/mapmodal/maplistlitle_mobile.html b/src/module_vmap/module/template/layers/mapmodal/maplistlitle_mobile.html
index 1c7713ff..0b1f7cab 100644
--- a/src/module_vmap/module/template/layers/mapmodal/maplistlitle_mobile.html
+++ b/src/module_vmap/module/template/layers/mapmodal/maplistlitle_mobile.html
@@ -5,12 +5,12 @@
         <div class="row">
             <div class="col-xs-6">
                 <select class="form-control minus left margin-5 margin-sides-10" ng-model="filterTheme">
-                    <option value="">Tous</option>
+                    <option value="">{{ 'VMAP_ALL' | translate }}</option>
                     <option ng-repeat="theme in themes track by $index" ng-value="theme">{{theme}}</option>
                 </select>
             </div>
             <div class="col-xs-6">
-                <input class="form-control input-sm right margin-sides-10 margin-5" type="text" placeholder="Rechercher" ng-model="filter">
+                <input class="form-control input-sm right margin-sides-10 margin-5" type="text" placeholder="{{ 'VMAP_FIND' | translate }}" ng-model="filter">
             </div>
         </div>
     </div>
-- 
GitLab