Mercurial > gemma
annotate client/src/main.js @ 615:4ffdb922db44
Document adding of external OGC services.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Mon, 10 Sep 2018 19:12:24 +0200 |
parents | 4bc27eea4f09 |
children | badbc0207418 |
rev | line source |
---|---|
3 | 1 import Vue from "vue"; |
2 import App from "./App.vue"; | |
3 import router from "./router"; | |
4 import store from "./store"; | |
141 | 5 import GetTextPlugin from "vue-gettext"; |
6 import translations from "./translations.json"; | |
159
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
7 import locale2 from "locale2"; |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
8 import CxltToastr from "cxlt-vue2-toastr"; |
159
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
9 import "../node_modules/bootstrap/dist/css/bootstrap.min.css"; |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
10 import "../node_modules/font-awesome/css/font-awesome.min.css"; |
428
d7a06b9fffc9
feat: Usability for usermanagement improved.
Thomas Junk <thomas.junk@intevation.de>
parents:
375
diff
changeset
|
11 import "../node_modules/animate.css/animate.min.css"; |
159
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
12 import "../node_modules/ol/ol.css"; |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
13 import "../node_modules/cxlt-vue2-toastr/dist/css/cxlt-vue2-toastr.css"; |
565
4bc27eea4f09
feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents:
428
diff
changeset
|
14 import VTooltip from "v-tooltip"; |
4bc27eea4f09
feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents:
428
diff
changeset
|
15 |
4bc27eea4f09
feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents:
428
diff
changeset
|
16 Vue.use(VTooltip); |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
17 |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
18 var toastrConfigs = { |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
19 position: "bottom center", |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
20 showDuration: 2000, |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
21 timeOut: 8000, |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
22 closeButton: true |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
23 }; |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
24 |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
25 Vue.use(CxltToastr, toastrConfigs); |
141 | 26 |
159
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
27 let browserLanguage = locale2; |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
28 |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
29 // planned also SK, HU, HR, RS, BiH, BG, RO, UA |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
30 const supportedLanguages = { |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
31 en_GB: "British English", |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
32 de_AT: "Deutsch" |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
33 }; |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
34 |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
35 if (browserLanguage === "de-DE") { |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
36 browserLanguage = "de-AT"; // map german to austrian variant for now |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
37 } |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
38 |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
39 const language = browserLanguage.replace("-", "_"); |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
40 const isLanguageAvailable = supportedLanguages[language]; |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
41 let defaultLanguage = isLanguageAvailable ? language : "en_GB"; |
141 | 42 |
43 Vue.use(GetTextPlugin, { | |
44 translations: translations, | |
159
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
45 availableLanguages: supportedLanguages, |
141 | 46 defaultLanguage: defaultLanguage |
47 }); | |
48 | |
3 | 49 Vue.config.productionTip = false; |
50 | |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
51 const app = new Vue({ |
3 | 52 router, |
53 store, | |
54 render: h => h(App) | |
55 }).$mount("#app"); | |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
56 |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
57 export default app; |