Mercurial > gemma
comparison client/src/components/map/contextbox/ImportSoundingresults.vue @ 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 | 15c3672e2e86 |
children | bb47531bdd22 |
comparison
equal
deleted
inserted
replaced
1438:71eb96690f91 | 1441:a4554e942954 |
---|---|
53 <translate>Please enter a reference</translate> | 53 <translate>Please enter a reference</translate> |
54 </small> | 54 </small> |
55 </span> | 55 </span> |
56 </div> | 56 </div> |
57 <div class="mt-1 text-left w-50 mr-2"> | 57 <div class="mt-1 text-left w-50 mr-2"> |
58 <small class="text-muted">Date</small> | 58 <small class="text-muted"> |
59 <translate>Date</translate> | |
60 </small> | |
59 <input | 61 <input |
60 id="importdate" | 62 id="importdate" |
61 type="date" | 63 type="date" |
62 class="form-control" | 64 class="form-control" |
63 placeholder="Date of import" | 65 placeholder="Date of import" |
113 <button | 115 <button |
114 :disabled="disableUploadButton" | 116 :disabled="disableUploadButton" |
115 @click="submit" | 117 @click="submit" |
116 class="btn btn-info" | 118 class="btn btn-info" |
117 type="button" | 119 type="button" |
118 >{{ uploadState ? "Upload" : "Confirm" }}</button> | 120 >{{ uploadState ? Upload : Confirm }}</button> |
119 </div> | 121 </div> |
120 </div> | 122 </div> |
121 </div> | 123 </div> |
122 </template> | 124 </template> |
123 | 125 |
138 */ | 140 */ |
139 import { HTTP } from "../../../lib/http"; | 141 import { HTTP } from "../../../lib/http"; |
140 import { displayError, displayInfo } from "../../../lib/errors.js"; | 142 import { displayError, displayInfo } from "../../../lib/errors.js"; |
141 import { mapState } from "vuex"; | 143 import { mapState } from "vuex"; |
142 | 144 |
143 const defaultLabel = "Choose .zip-file"; | |
144 const IMPORTSTATE = { UPLOAD: "UPLOAD", EDIT: "EDIT" }; | 145 const IMPORTSTATE = { UPLOAD: "UPLOAD", EDIT: "EDIT" }; |
145 | 146 |
146 export default { | 147 export default { |
147 name: "imports", | 148 name: "imports", |
148 data() { | 149 data() { |
150 importState: IMPORTSTATE.UPLOAD, | 151 importState: IMPORTSTATE.UPLOAD, |
151 depthReference: "", | 152 depthReference: "", |
152 bottleneck: "", | 153 bottleneck: "", |
153 projection: "", | 154 projection: "", |
154 importDate: "", | 155 importDate: "", |
155 uploadLabel: defaultLabel, | 156 uploadLabel: this.$gettext("choose .zip- file"), |
156 uploadFile: null, | 157 uploadFile: null, |
157 disableUpload: false, | 158 disableUpload: false, |
158 token: null, | 159 token: null, |
159 messages: [] | 160 messages: [] |
160 }; | 161 }; |
164 this.importState = IMPORTSTATE.UPLOAD; | 165 this.importState = IMPORTSTATE.UPLOAD; |
165 this.depthReference = ""; | 166 this.depthReference = ""; |
166 this.bottleneck = ""; | 167 this.bottleneck = ""; |
167 this.projection = ""; | 168 this.projection = ""; |
168 this.importDate = ""; | 169 this.importDate = ""; |
169 this.uploadLabel = defaultLabel; | 170 this.uploadLabel = this.$gettext("choose .zip- file"); |
170 this.uploadFile = null; | 171 this.uploadFile = null; |
171 this.disableUpload = false; | 172 this.disableUpload = false; |
172 this.token = null; | 173 this.token = null; |
173 this.messages = []; | 174 this.messages = []; |
174 }, | 175 }, |
188 this.initialState(); | 189 this.initialState(); |
189 }) | 190 }) |
190 .catch(error => { | 191 .catch(error => { |
191 const { status, data } = error.response; | 192 const { status, data } = error.response; |
192 displayError({ | 193 displayError({ |
193 title: "Backend Error", | 194 title: this.$gettext("Backend Error"), |
194 message: `${status}: ${data.message || data}` | 195 message: `${status}: ${data.message || data}` |
195 }); | 196 }); |
196 }); | 197 }); |
197 }, | 198 }, |
198 submit() { | 199 submit() { |
227 }) | 228 }) |
228 .catch(error => { | 229 .catch(error => { |
229 const { status, data } = error.response; | 230 const { status, data } = error.response; |
230 const messages = data.messages ? data.messages.join(", ") : ""; | 231 const messages = data.messages ? data.messages.join(", ") : ""; |
231 displayError({ | 232 displayError({ |
232 title: "Backend Error", | 233 title: this.$gettext("Backend Error"), |
233 message: `${status}: ${messages}` | 234 message: `${status}: ${messages}` |
234 }); | 235 }); |
235 }); | 236 }); |
236 }, | 237 }, |
237 confirm() { | 238 confirm() { |
250 "Content-Type": "multipart/form-data" | 251 "Content-Type": "multipart/form-data" |
251 } | 252 } |
252 }) | 253 }) |
253 .then(() => { | 254 .then(() => { |
254 displayInfo({ | 255 displayInfo({ |
255 title: "Import", | 256 title: this.$gettext("Import"), |
256 message: "Starting import for " + this.bottleneck | 257 message: this.$gettext("Starting import for ") + this.bottleneck |
257 }); | 258 }); |
258 this.initialState(); | 259 this.initialState(); |
259 }) | 260 }) |
260 .catch(error => { | 261 .catch(error => { |
261 const { status, data } = error.response; | 262 const { status, data } = error.response; |
262 displayError({ | 263 displayError({ |
263 title: "Backend Error", | 264 title: this.$gettext("Backend Error"), |
264 message: `${status}: ${data.message || data}` | 265 message: `${status}: ${data.message || data}` |
265 }); | 266 }); |
266 }); | 267 }); |
267 } | 268 } |
268 }, | 269 }, |
294 editState() { | 295 editState() { |
295 return this.importState === IMPORTSTATE.EDIT; | 296 return this.importState === IMPORTSTATE.EDIT; |
296 }, | 297 }, |
297 uploadState() { | 298 uploadState() { |
298 return this.importState === IMPORTSTATE.UPLOAD; | 299 return this.importState === IMPORTSTATE.UPLOAD; |
300 }, | |
301 Upload() { | |
302 return this.$gettext("Upload"); | |
303 }, | |
304 Confirm() { | |
305 return this.$gettext("Confirm"); | |
299 }, | 306 }, |
300 dataLink() { | 307 dataLink() { |
301 return ( | 308 return ( |
302 "data:text/json;charset=utf-8," + | 309 "data:text/json;charset=utf-8," + |
303 encodeURIComponent( | 310 encodeURIComponent( |