changeset 1441:a4554e942954

Client: add a set of marked translations * add a number of marked translatios in javascript part of some .vue files * generate the corresponding .po files and translation.json file * add some examples translations for ImportSoundingresults.vue
author Fadi Abbud <fadi.abbud@intevation.de>
date Fri, 30 Nov 2018 13:09:40 +0100
parents 71eb96690f91
children 82117b22346c
files client/src/components/map/Search.vue client/src/components/map/contextbox/ImportSoundingresults.vue client/src/components/map/contextbox/Staging.vue client/src/components/map/fairway/Profiles.vue client/src/locale/de_AT/LC_MESSAGES/app.po client/src/locale/en_GB/LC_MESSAGES/app.po client/src/locale/translations.json
diffstat 7 files changed, 165 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/map/Search.vue	Fri Nov 30 11:12:47 2018 +0100
+++ b/client/src/components/map/Search.vue	Fri Nov 30 13:09:40 2018 +0100
@@ -20,9 +20,14 @@
     >
       <div v-for="entry of searchResults" :key="entry.name" class="border-top text-left">
         <a href="#" @click.prevent="moveToSearchResult(entry)" class="p-2 d-block text-nowrap">
-          <font-awesome-icon icon="ship" v-if="entry.type === 'bottleneck'" class="mr-1" fixed-width />
-          <font-awesome-icon icon="water" v-if="entry.type === 'rhm'" class="mr-1" fixed-width />
-          <font-awesome-icon icon="city" v-if="entry.type === 'city'" class="mr-1" fixed-width />
+          <font-awesome-icon
+            icon="ship"
+            v-if="entry.type === 'bottleneck'"
+            class="mr-1"
+            fixed-width
+          />
+          <font-awesome-icon icon="water" v-if="entry.type === 'rhm'" class="mr-1" fixed-width/>
+          <font-awesome-icon icon="city" v-if="entry.type === 'city'" class="mr-1" fixed-width/>
           {{ entry.name }}
         </a>
       </div>
@@ -203,7 +208,7 @@
         .catch(error => {
           const { status, data } = error.response;
           displayError({
-            title: "Backend Error",
+            title: this.$gettext("Backend Error"),
             message: `${status}: ${data.message || data}`
           });
         });
--- a/client/src/components/map/contextbox/ImportSoundingresults.vue	Fri Nov 30 11:12:47 2018 +0100
+++ b/client/src/components/map/contextbox/ImportSoundingresults.vue	Fri Nov 30 13:09:40 2018 +0100
@@ -55,7 +55,9 @@
             </span>
           </div>
           <div class="mt-1 text-left w-50 mr-2">
-            <small class="text-muted">Date</small>
+            <small class="text-muted">
+              <translate>Date</translate>
+            </small>
             <input
               id="importdate"
               type="date"
@@ -115,7 +117,7 @@
           @click="submit"
           class="btn btn-info"
           type="button"
-        >{{ uploadState ? "Upload" : "Confirm" }}</button>
+        >{{ uploadState ? Upload : Confirm }}</button>
       </div>
     </div>
   </div>
@@ -140,7 +142,6 @@
 import { displayError, displayInfo } from "../../../lib/errors.js";
 import { mapState } from "vuex";
 
-const defaultLabel = "Choose .zip-file";
 const IMPORTSTATE = { UPLOAD: "UPLOAD", EDIT: "EDIT" };
 
 export default {
@@ -152,7 +153,7 @@
       bottleneck: "",
       projection: "",
       importDate: "",
-      uploadLabel: defaultLabel,
+      uploadLabel: this.$gettext("choose .zip- file"),
       uploadFile: null,
       disableUpload: false,
       token: null,
@@ -166,7 +167,7 @@
       this.bottleneck = "";
       this.projection = "";
       this.importDate = "";
-      this.uploadLabel = defaultLabel;
+      this.uploadLabel = this.$gettext("choose .zip- file");
       this.uploadFile = null;
       this.disableUpload = false;
       this.token = null;
@@ -190,7 +191,7 @@
         .catch(error => {
           const { status, data } = error.response;
           displayError({
-            title: "Backend Error",
+            title: this.$gettext("Backend Error"),
             message: `${status}: ${data.message || data}`
           });
         });
@@ -229,7 +230,7 @@
           const { status, data } = error.response;
           const messages = data.messages ? data.messages.join(", ") : "";
           displayError({
-            title: "Backend Error",
+            title: this.$gettext("Backend Error"),
             message: `${status}: ${messages}`
           });
         });
@@ -252,15 +253,15 @@
       })
         .then(() => {
           displayInfo({
-            title: "Import",
-            message: "Starting import for " + this.bottleneck
+            title: this.$gettext("Import"),
+            message: this.$gettext("Starting import for ") + this.bottleneck
           });
           this.initialState();
         })
         .catch(error => {
           const { status, data } = error.response;
           displayError({
-            title: "Backend Error",
+            title: this.$gettext("Backend Error"),
             message: `${status}: ${data.message || data}`
           });
         });
@@ -297,6 +298,12 @@
     uploadState() {
       return this.importState === IMPORTSTATE.UPLOAD;
     },
+    Upload() {
+      return this.$gettext("Upload");
+    },
+    Confirm() {
+      return this.$gettext("Confirm");
+    },
     dataLink() {
       return (
         "data:text/json;charset=utf-8," +
--- a/client/src/components/map/contextbox/Staging.vue	Fri Nov 30 11:12:47 2018 +0100
+++ b/client/src/components/map/contextbox/Staging.vue	Fri Nov 30 13:09:40 2018 +0100
@@ -96,7 +96,7 @@
     this.$store.dispatch("imports/getStaging").catch(error => {
       const { status, data } = error.response;
       displayError({
-        title: "Backend Error",
+        title: this.$gettext("Backend Error"),
         message: `${status}: ${data.message || data}`
       });
     });
@@ -122,7 +122,7 @@
         })
         .join("\n");
       displayInfo({
-        title: "Staging Area",
+        title: this.$gettext("Staging Area"),
         message: message
       });
     },
--- a/client/src/components/map/fairway/Profiles.vue	Fri Nov 30 11:12:47 2018 +0100
+++ b/client/src/components/map/fairway/Profiles.vue	Fri Nov 30 13:09:40 2018 +0100
@@ -334,8 +334,8 @@
     },
     onCopyCoordinates() {
       displayInfo({
-        title: "Success",
-        message: "Coordinates copied to clipboard!"
+        title: this.$gettext("Success"),
+        message: this.$gettext("Coordinates copied to clipboard!")
       });
     },
     applyManualCoordinates() {
@@ -369,9 +369,10 @@
         this.$store.dispatch("fairwayprofile/cut", cut);
       } else {
         displayError({
-          title: "Invalid input",
-          message:
+          title: this.$gettext("Invalid input"),
+          message: this.$gettext(
             "Please enter correct coordinates in the format: Lat,Lon,Lat,Lon"
+          )
         });
       }
     },
@@ -394,9 +395,10 @@
 
       this.showLabelInput = false;
       displayInfo({
-        title: "Profile saved!",
-        message:
+        title: this.$gettext("Profile saved!"),
+        message: this.$gettext(
           'You can now select these coordinates from the "Saved cross profiles" menu to restore this cross profile.'
+        )
       });
     },
     deleteSelectedCut() {
@@ -407,7 +409,7 @@
       localStorage.setItem("previousCuts", JSON.stringify(previousCuts));
       this.$store.commit("fairwayprofile/selectedCut", null);
       this.$store.dispatch("fairwayprofile/previousCuts");
-      displayInfo({ title: "Profile deleted!" });
+      displayInfo({ title: this.$gettext("Profile deleted!") });
     },
     moveToBottleneck() {
       const bottleneck = this.bottlenecks.find(
--- a/client/src/locale/de_AT/LC_MESSAGES/app.po	Fri Nov 30 11:12:47 2018 +0100
+++ b/client/src/locale/de_AT/LC_MESSAGES/app.po	Fri Nov 30 13:09:40 2018 +0100
@@ -8,8 +8,8 @@
 msgstr ""
 "Project-Id-Version: wamosjs 0.1.0\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2018-11-29 17:47+0100\n"
-"PO-Revision-Date: 2018-07-03 17:00+0200\n"
+"POT-Creation-Date: 2018-11-30 11:17+0100\n"
+"PO-Revision-Date: 2018-11-30 12:26+0100\n"
 "Last-Translator: Automatically generated\n"
 "Language-Team: none\n"
 "Language: de_AT\n"
@@ -17,6 +17,7 @@
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Poedit 2.2\n"
 
 #: src/components/admin/Importqueue.vue:29
 msgid "Accepted"
@@ -38,9 +39,17 @@
 msgid "back to login"
 msgstr ""
 
+#: src/components/map/Search.vue:211
+#: src/components/map/contextbox/ImportSoundingresults.vue:194
+#: src/components/map/contextbox/ImportSoundingresults.vue:233
+#: src/components/map/contextbox/ImportSoundingresults.vue:264
+#: src/components/map/contextbox/Staging.vue:99
+msgid "Backend Error"
+msgstr ""
+
 #: src/components/map/contextbox/ImportSoundingresults.vue:11
 msgid "Bottleneck"
-msgstr ""
+msgstr "Engstelle"
 
 #: src/components/admin/Systemconfiguration.vue:10
 msgid "Bottleneck Areas fill-color"
@@ -55,14 +64,19 @@
 msgid "Bottlenecks"
 msgstr "Engstellen"
 
-#: src/components/map/contextbox/ImportSoundingresults.vue:110
+#: src/components/map/contextbox/ImportSoundingresults.vue:112
 msgid "Cancel Upload"
-msgstr ""
+msgstr "Hochladen abbrechen"
 
 #: src/components/map/contextbox/Bottlenecks.vue:17
 msgid "Chainage"
 msgstr ""
 
+#: src/components/map/contextbox/ImportSoundingresults.vue:156
+#: src/components/map/contextbox/ImportSoundingresults.vue:170
+msgid "choose .zip- file"
+msgstr "Wählen Sie eine .zip Datei "
+
 #: src/components/map/Pdftool.vue:12
 msgid "Chose format:"
 msgstr ""
@@ -75,33 +89,39 @@
 msgid "Configuration"
 msgstr ""
 
+#: src/components/map/contextbox/ImportSoundingresults.vue:305
 #: src/components/map/contextbox/Staging.vue:65
 msgid "Confirm"
-msgstr ""
+msgstr "Bestätigen "
 
 #: src/components/map/Identify.vue:52
 msgid "contributors."
 msgstr ""
 
+#: src/components/map/fairway/Profiles.vue:347
+msgid "Coordinates copied to clipboard!"
+msgstr ""
+
 #: src/components/admin/usermanagement/Userdetail.vue:33
 msgid "Country"
 msgstr ""
 
+#: src/components/map/contextbox/ImportSoundingresults.vue:58
 #: src/components/map/contextbox/Staging.vue:16
 msgid "Date"
-msgstr ""
+msgstr "Datum "
 
 #: src/components/map/contextbox/ImportSoundingresults.vue:42
 msgid "Depthreference"
-msgstr ""
+msgstr "Tiefenreferenz"
 
 #: src/components/map/Pdftool.vue:25
 msgid "Download"
 msgstr ""
 
-#: src/components/map/contextbox/ImportSoundingresults.vue:107
+#: src/components/map/contextbox/ImportSoundingresults.vue:109
 msgid "Download Meta.json"
-msgstr ""
+msgstr "Meta.json Herunterladen"
 
 #: src/components/admin/importschedule/Importschedule.vue:43
 msgid "Email"
@@ -153,6 +173,7 @@
 msgstr ""
 
 #: src/components/admin/importschedule/Importschedule.vue:31
+#: src/components/map/contextbox/ImportSoundingresults.vue:256
 msgid "Import"
 msgstr ""
 
@@ -177,6 +198,10 @@
 msgid "Importschedule"
 msgstr ""
 
+#: src/components/map/fairway/Profiles.vue:381
+msgid "Invalid input"
+msgstr ""
+
 #: src/components/admin/Importqueue.vue:36
 msgid "Kind"
 msgstr ""
@@ -259,7 +284,7 @@
 msgid "Pending"
 msgstr ""
 
-#: src/components/map/contextbox/ImportSoundingresults.vue:69
+#: src/components/map/contextbox/ImportSoundingresults.vue:71
 msgid "Please enter a date"
 msgstr ""
 
@@ -271,6 +296,11 @@
 msgid "Please enter a reference"
 msgstr ""
 
+#: src/components/map/fairway/Profiles.vue:382
+#: src/components/map/fairway/Profiles.vue:383
+msgid "Please enter correct coordinates in the format: Lat,Lon,Lat,Lon"
+msgstr ""
+
 #: src/components/map/contextbox/ImportSoundingresults.vue:18
 msgid "Please select a bottleneck"
 msgstr ""
@@ -284,13 +314,21 @@
 msgid "portrait"
 msgstr ""
 
+#: src/components/map/fairway/Profiles.vue:421
+msgid "Profile deleted!"
+msgstr ""
+
+#: src/components/map/fairway/Profiles.vue:407
+msgid "Profile saved!"
+msgstr ""
+
 #: src/components/map/fairway/Profiles.vue:5
 msgid "Profiles"
 msgstr ""
 
 #: src/components/map/contextbox/ImportSoundingresults.vue:24
 msgid "Projection"
-msgstr ""
+msgstr "Projektion"
 
 #: src/components/admin/Importqueue.vue:51 src/components/admin/Logs.vue:32
 msgid "Refresh"
@@ -346,6 +384,7 @@
 msgstr ""
 
 #: src/components/map/contextbox/Staging.vue:4
+#: src/components/map/contextbox/Staging.vue:125
 msgid "Staging Area"
 msgstr ""
 
@@ -353,6 +392,10 @@
 msgid "Start"
 msgstr ""
 
+#: src/components/map/contextbox/ImportSoundingresults.vue:257
+msgid "Starting import for "
+msgstr ""
+
 #: src/components/admin/Importqueue.vue:38
 msgid "State"
 msgstr ""
@@ -361,6 +404,10 @@
 msgid "Submit"
 msgstr ""
 
+#: src/components/map/fairway/Profiles.vue:346
+msgid "Success"
+msgstr ""
+
 #: src/components/admin/Importqueue.vue:25
 msgid "Successful"
 msgstr ""
@@ -386,6 +433,10 @@
 msgid "Type"
 msgstr ""
 
+#: src/components/map/contextbox/ImportSoundingresults.vue:302
+msgid "Upload"
+msgstr "Hochladen"
+
 #: src/components/admin/Importqueue.vue:37
 msgid "User"
 msgstr ""
@@ -416,3 +467,8 @@
 #: src/components/map/Identify.vue:41
 msgid "without warranty, see docs for details."
 msgstr ""
+
+#: src/components/map/fairway/Profiles.vue:408
+#: src/components/map/fairway/Profiles.vue:409
+msgid "You can now select these coordinates from the \"Saved cross profiles\" menu to restore this cross profile."
+msgstr ""
--- a/client/src/locale/en_GB/LC_MESSAGES/app.po	Fri Nov 30 11:12:47 2018 +0100
+++ b/client/src/locale/en_GB/LC_MESSAGES/app.po	Fri Nov 30 13:09:40 2018 +0100
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: wamosjs 0.1.0\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2018-11-29 17:47+0100\n"
+"POT-Creation-Date: 2018-11-30 11:17+0100\n"
 "PO-Revision-Date: 2018-07-03 17:18+0200\n"
 "Last-Translator: Automatically generated\n"
 "Language-Team: none\n"
@@ -37,6 +37,14 @@
 msgid "back to login"
 msgstr ""
 
+#: src/components/map/Search.vue:211
+#: src/components/map/contextbox/ImportSoundingresults.vue:194
+#: src/components/map/contextbox/ImportSoundingresults.vue:233
+#: src/components/map/contextbox/ImportSoundingresults.vue:264
+#: src/components/map/contextbox/Staging.vue:99
+msgid "Backend Error"
+msgstr ""
+
 #: src/components/map/contextbox/ImportSoundingresults.vue:11
 msgid "Bottleneck"
 msgstr ""
@@ -54,7 +62,7 @@
 msgid "Bottlenecks"
 msgstr ""
 
-#: src/components/map/contextbox/ImportSoundingresults.vue:110
+#: src/components/map/contextbox/ImportSoundingresults.vue:112
 msgid "Cancel Upload"
 msgstr ""
 
@@ -62,6 +70,11 @@
 msgid "Chainage"
 msgstr ""
 
+#: src/components/map/contextbox/ImportSoundingresults.vue:156
+#: src/components/map/contextbox/ImportSoundingresults.vue:170
+msgid "choose .zip- file"
+msgstr ""
+
 #: src/components/map/Pdftool.vue:12
 msgid "Chose format:"
 msgstr ""
@@ -74,6 +87,7 @@
 msgid "Configuration"
 msgstr ""
 
+#: src/components/map/contextbox/ImportSoundingresults.vue:305
 #: src/components/map/contextbox/Staging.vue:65
 msgid "Confirm"
 msgstr ""
@@ -82,10 +96,15 @@
 msgid "contributors."
 msgstr ""
 
+#: src/components/map/fairway/Profiles.vue:347
+msgid "Coordinates copied to clipboard!"
+msgstr ""
+
 #: src/components/admin/usermanagement/Userdetail.vue:33
 msgid "Country"
 msgstr ""
 
+#: src/components/map/contextbox/ImportSoundingresults.vue:58
 #: src/components/map/contextbox/Staging.vue:16
 msgid "Date"
 msgstr ""
@@ -98,7 +117,7 @@
 msgid "Download"
 msgstr ""
 
-#: src/components/map/contextbox/ImportSoundingresults.vue:107
+#: src/components/map/contextbox/ImportSoundingresults.vue:109
 msgid "Download Meta.json"
 msgstr ""
 
@@ -152,6 +171,7 @@
 msgstr ""
 
 #: src/components/admin/importschedule/Importschedule.vue:31
+#: src/components/map/contextbox/ImportSoundingresults.vue:256
 msgid "Import"
 msgstr ""
 
@@ -176,6 +196,10 @@
 msgid "Importschedule"
 msgstr ""
 
+#: src/components/map/fairway/Profiles.vue:381
+msgid "Invalid input"
+msgstr ""
+
 #: src/components/admin/Importqueue.vue:36
 msgid "Kind"
 msgstr ""
@@ -258,7 +282,7 @@
 msgid "Pending"
 msgstr ""
 
-#: src/components/map/contextbox/ImportSoundingresults.vue:69
+#: src/components/map/contextbox/ImportSoundingresults.vue:71
 msgid "Please enter a date"
 msgstr ""
 
@@ -270,6 +294,11 @@
 msgid "Please enter a reference"
 msgstr ""
 
+#: src/components/map/fairway/Profiles.vue:382
+#: src/components/map/fairway/Profiles.vue:383
+msgid "Please enter correct coordinates in the format: Lat,Lon,Lat,Lon"
+msgstr ""
+
 #: src/components/map/contextbox/ImportSoundingresults.vue:18
 msgid "Please select a bottleneck"
 msgstr ""
@@ -283,6 +312,14 @@
 msgid "portrait"
 msgstr ""
 
+#: src/components/map/fairway/Profiles.vue:421
+msgid "Profile deleted!"
+msgstr ""
+
+#: src/components/map/fairway/Profiles.vue:407
+msgid "Profile saved!"
+msgstr ""
+
 #: src/components/map/fairway/Profiles.vue:5
 msgid "Profiles"
 msgstr ""
@@ -344,6 +381,7 @@
 msgstr ""
 
 #: src/components/map/contextbox/Staging.vue:4
+#: src/components/map/contextbox/Staging.vue:125
 msgid "Staging Area"
 msgstr ""
 
@@ -351,6 +389,10 @@
 msgid "Start"
 msgstr ""
 
+#: src/components/map/contextbox/ImportSoundingresults.vue:257
+msgid "Starting import for "
+msgstr ""
+
 #: src/components/admin/Importqueue.vue:38
 msgid "State"
 msgstr ""
@@ -359,6 +401,10 @@
 msgid "Submit"
 msgstr ""
 
+#: src/components/map/fairway/Profiles.vue:346
+msgid "Success"
+msgstr ""
+
 #: src/components/admin/Importqueue.vue:25
 msgid "Successful"
 msgstr ""
@@ -384,6 +430,10 @@
 msgid "Type"
 msgstr ""
 
+#: src/components/map/contextbox/ImportSoundingresults.vue:302
+msgid "Upload"
+msgstr ""
+
 #: src/components/admin/Importqueue.vue:37
 msgid "User"
 msgstr ""
@@ -414,3 +464,8 @@
 #: src/components/map/Identify.vue:41
 msgid "without warranty, see docs for details."
 msgstr ""
+
+#: src/components/map/fairway/Profiles.vue:408
+#: src/components/map/fairway/Profiles.vue:409
+msgid "You can now select these coordinates from the \"Saved cross profiles\" menu to restore this cross profile."
+msgstr ""
--- a/client/src/locale/translations.json	Fri Nov 30 11:12:47 2018 +0100
+++ b/client/src/locale/translations.json	Fri Nov 30 13:09:40 2018 +0100
@@ -1,1 +1,1 @@
-{"de_AT":{"Bottlenecks":"Engstellen","Enter passphrase":"Passphrase","Forgot password":"Passwort vergessen","Login":"Login","Login failed":"Login fehlgeschlagen","Map":"Karte"},"en_GB":{"Enter passphrase":"Enter passphrase","Forgot password":"Forgot password","Login":"Login","Login failed":"Login failed"}}
\ No newline at end of file
+{"de_AT":{"Bottleneck":"Engstelle","Bottlenecks":"Engstellen","Cancel Upload":"Hochladen abbrechen","choose .zip- file":"Wählen Sie eine .zip Datei ","Confirm":"Bestätigen ","Date":"Datum ","Depthreference":"Tiefenreferenz","Download Meta.json":"Meta.json Herunterladen","Enter passphrase":"Passphrase","Forgot password":"Passwort vergessen","Login":"Login","Login failed":"Login fehlgeschlagen","Map":"Karte","Projection":"Projektion","Upload":"Hochladen"},"en_GB":{"Enter passphrase":"Enter passphrase","Forgot password":"Forgot password","Login":"Login","Login failed":"Login failed"}}
\ No newline at end of file