Mercurial > gemma
annotate client/src/main.js @ 1019:ca628dce90dd
Licensing information added
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Wed, 24 Oct 2018 09:42:32 +0200 |
parents | aa2acb942e55 |
children | 874d19f32015 |
rev | line source |
---|---|
1019
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
1 /* |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
2 * This is Free Software under GNU Affero General Public License v >= 3.0 |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
3 * without warranty, see README.md and license for details. |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
4 * |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
5 * SPDX-License-Identifier: AGPL-3.0-or-later |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
6 * License-Filename: LICENSES/AGPL-3.0.txt |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
7 * |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
8 * Copyright (C) 2018 by via donau |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
9 * – Österreichische Wasserstraßen-Gesellschaft mbH |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
10 * Software engineering by Intevation GmbH |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
11 * |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
12 * Author(s): |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
13 * Thomas Junk <thomas.junk@intevation.de> |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
14 */ |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
880
diff
changeset
|
15 |
3 | 16 import Vue from "vue"; |
17 import App from "./App.vue"; | |
18 import router from "./router"; | |
19 import store from "./store"; | |
141 | 20 import GetTextPlugin from "vue-gettext"; |
21 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
|
22 import locale2 from "locale2"; |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
23 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
|
24 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
|
25 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
|
26 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
|
27 import "../node_modules/ol/ol.css"; |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
28 import "../node_modules/cxlt-vue2-toastr/dist/css/cxlt-vue2-toastr.css"; |
713
badbc0207418
feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents:
565
diff
changeset
|
29 import "../node_modules/highlight.js/styles/paraiso-dark.css"; |
565
4bc27eea4f09
feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents:
428
diff
changeset
|
30 import VTooltip from "v-tooltip"; |
4bc27eea4f09
feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents:
428
diff
changeset
|
31 |
4bc27eea4f09
feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents:
428
diff
changeset
|
32 Vue.use(VTooltip); |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
33 |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
34 var toastrConfigs = { |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
35 position: "bottom center", |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
36 showDuration: 2000, |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
37 timeOut: 8000, |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
38 closeButton: true |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
39 }; |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
40 |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
41 Vue.use(CxltToastr, toastrConfigs); |
141 | 42 |
159
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
43 let browserLanguage = locale2; |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
44 |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
45 // 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
|
46 const supportedLanguages = { |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
47 en_GB: "British English", |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
48 de_AT: "Deutsch" |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
49 }; |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
50 |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
51 if (browserLanguage === "de-DE") { |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
52 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
|
53 } |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
54 |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
55 const language = browserLanguage.replace("-", "_"); |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
56 const isLanguageAvailable = supportedLanguages[language]; |
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
57 let defaultLanguage = isLanguageAvailable ? language : "en_GB"; |
141 | 58 |
59 Vue.use(GetTextPlugin, { | |
60 translations: translations, | |
159
3d9341f6da4e
feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents:
141
diff
changeset
|
61 availableLanguages: supportedLanguages, |
141 | 62 defaultLanguage: defaultLanguage |
63 }); | |
64 | |
3 | 65 Vue.config.productionTip = false; |
66 | |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
67 const app = new Vue({ |
3 | 68 router, |
69 store, | |
70 render: h => h(App) | |
71 }).$mount("#app"); | |
295
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
72 |
22deb76dff2c
feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents:
159
diff
changeset
|
73 export default app; |