annotate client/src/main.js @ 1463:a6dd2a8183a4

sidebar: added spacer class to import schedule
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 03 Dec 2018 16:24:19 +0100
parents dadf309eec51
children 197e932772fd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1243
24797f66f268 Client: remove (minor) superfluous things
Bernhard Reiter <bernhard@intevation.de>
parents: 1163
diff changeset
1 /* This is Free Software under GNU Affero General Public License v >= 3.0
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
2 * without warranty, see README.md and license for details.
1243
24797f66f268 Client: remove (minor) superfluous things
Bernhard Reiter <bernhard@intevation.de>
parents: 1163
diff changeset
3 *
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
4 * SPDX-License-Identifier: AGPL-3.0-or-later
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
5 * License-Filename: LICENSES/AGPL-3.0.txt
1243
24797f66f268 Client: remove (minor) superfluous things
Bernhard Reiter <bernhard@intevation.de>
parents: 1163
diff changeset
6 *
1363
d0c4d17ee7ab add missing authors
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
7 * Copyright (C) 2018 by via donau
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
8 * – Österreichische Wasserstraßen-Gesellschaft mbH
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
9 * Software engineering by Intevation GmbH
1243
24797f66f268 Client: remove (minor) superfluous things
Bernhard Reiter <bernhard@intevation.de>
parents: 1163
diff changeset
10 *
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
11 * Author(s):
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 880
diff changeset
12 * Thomas Junk <thomas.junk@intevation.de>
1363
d0c4d17ee7ab add missing authors
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
13 * Markus Kottländer <markus@intevation.de>
1019
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
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
16 import Vue from "vue";
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents: 1243
diff changeset
17 import App from "./components/App.vue";
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
18 import router from "./router";
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
19 import store from "./store";
141
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
20 import GetTextPlugin from "vue-gettext";
1272
bc55ffaeb639 cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents: 1243
diff changeset
21 import translations from "./locale/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";
1368
d1d8c7bd16a1 switched from vue2-toastr to vue-snotify
Thomas Junk <thomas.junk@intevation.de>
parents: 1363
diff changeset
23 import Snotify, { SnotifyPosition } from "vue-snotify";
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";
428
d7a06b9fffc9 feat: Usability for usermanagement improved.
Thomas Junk <thomas.junk@intevation.de>
parents: 375
diff changeset
25 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
26 import "../node_modules/ol/ol.css";
713
badbc0207418 feat: systeminformation feature added
Thomas Junk <thomas.junk@intevation.de>
parents: 565
diff changeset
27 import "../node_modules/highlight.js/styles/paraiso-dark.css";
1368
d1d8c7bd16a1 switched from vue2-toastr to vue-snotify
Thomas Junk <thomas.junk@intevation.de>
parents: 1363
diff changeset
28 import "../node_modules/vue-snotify/styles/material.css";
565
4bc27eea4f09 feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents: 428
diff changeset
29 import VTooltip from "v-tooltip";
1097
874d19f32015 added fontawesome5 and implemented one example icon on login screen
Markus Kottlaender <markus@intevation.de>
parents: 1019
diff changeset
30 import { library } from "@fortawesome/fontawesome-svg-core";
1299
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
31 import {
1429
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
32 faAngleDown,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
33 faAngleLeft,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
34 faAngleRight,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
35 faAngleUp,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
36 faBars,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
37 faBook,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
38 faChartArea,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
39 faCheck,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
40 faCity,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
41 faClipboardCheck,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
42 faClock,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
43 faCopy,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
44 faDrawPolygon,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
45 faExclamationTriangle,
1299
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
46 faEye,
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
47 faEyeSlash,
1429
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
48 faFilePdf,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
49 faFolderPlus,
1299
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
50 faInfo,
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
51 faLayerGroup,
1429
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
52 faMapMarkedAlt,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
53 faMinus,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
54 faPaperPlane,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
55 faPencilAlt,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
56 faPlus,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
57 faPowerOff,
1299
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
58 faRuler,
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
59 faSearch,
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
60 faShip,
1429
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
61 faSortAmountDown,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
62 faSortAmountUp,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
63 faSpinner,
1299
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
64 faStar,
1429
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
65 faTasks,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
66 faTimes,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
67 faTrash,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
68 faUpload,
1299
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
69 faUser,
1429
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
70 faUsersCog,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
71 faWater,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
72 faWrench
1299
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
73 } from "@fortawesome/free-solid-svg-icons";
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
74 import { faAdn } from "@fortawesome/free-brands-svg-icons";
1097
874d19f32015 added fontawesome5 and implemented one example icon on login screen
Markus Kottlaender <markus@intevation.de>
parents: 1019
diff changeset
75 import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
1163
fb5c83d4ea1d added copy coordinates button to fairway profile
Markus Kottlaender <markus@intevation.de>
parents: 1097
diff changeset
76 import VueClipboard from "vue-clipboard2";
1097
874d19f32015 added fontawesome5 and implemented one example icon on login screen
Markus Kottlaender <markus@intevation.de>
parents: 1019
diff changeset
77
1299
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
78 library.add(
1429
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
79 faAdn,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
80 faAngleDown,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
81 faAngleLeft,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
82 faAngleRight,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
83 faAngleUp,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
84 faBars,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
85 faBook,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
86 faChartArea,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
87 faCheck,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
88 faCity,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
89 faClipboardCheck,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
90 faClock,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
91 faCopy,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
92 faDrawPolygon,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
93 faExclamationTriangle,
1299
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
94 faEye,
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
95 faEyeSlash,
1429
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
96 faFilePdf,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
97 faFolderPlus,
1299
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
98 faInfo,
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
99 faLayerGroup,
1429
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
100 faMapMarkedAlt,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
101 faMinus,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
102 faPaperPlane,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
103 faPencilAlt,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
104 faPlus,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
105 faPowerOff,
1299
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
106 faRuler,
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
107 faSearch,
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
108 faShip,
1429
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
109 faSortAmountDown,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
110 faSortAmountUp,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
111 faSpinner,
1299
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
112 faStar,
1429
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
113 faTasks,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
114 faTimes,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
115 faTrash,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
116 faUpload,
1299
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
117 faUser,
1429
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
118 faUsersCog,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
119 faWater,
f4b3fb43b311 automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents: 1399
diff changeset
120 faWrench
1299
2738a6ae9ad8 fontawesome 4 -> 5
Markus Kottlaender <markus@intevation.de>
parents: 1272
diff changeset
121 );
1097
874d19f32015 added fontawesome5 and implemented one example icon on login screen
Markus Kottlaender <markus@intevation.de>
parents: 1019
diff changeset
122 Vue.component("font-awesome-icon", FontAwesomeIcon);
565
4bc27eea4f09 feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents: 428
diff changeset
123
4bc27eea4f09 feat: Added tooltips for user roles
Thomas Junk <thomas.junk@intevation.de>
parents: 428
diff changeset
124 Vue.use(VTooltip);
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
125
1368
d1d8c7bd16a1 switched from vue2-toastr to vue-snotify
Thomas Junk <thomas.junk@intevation.de>
parents: 1363
diff changeset
126 const options = {
d1d8c7bd16a1 switched from vue2-toastr to vue-snotify
Thomas Junk <thomas.junk@intevation.de>
parents: 1363
diff changeset
127 toast: {
d1d8c7bd16a1 switched from vue2-toastr to vue-snotify
Thomas Junk <thomas.junk@intevation.de>
parents: 1363
diff changeset
128 position: SnotifyPosition.centerBottom
d1d8c7bd16a1 switched from vue2-toastr to vue-snotify
Thomas Junk <thomas.junk@intevation.de>
parents: 1363
diff changeset
129 }
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
130 };
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
131
1368
d1d8c7bd16a1 switched from vue2-toastr to vue-snotify
Thomas Junk <thomas.junk@intevation.de>
parents: 1363
diff changeset
132 Vue.use(Snotify, options);
d1d8c7bd16a1 switched from vue2-toastr to vue-snotify
Thomas Junk <thomas.junk@intevation.de>
parents: 1363
diff changeset
133
d1d8c7bd16a1 switched from vue2-toastr to vue-snotify
Thomas Junk <thomas.junk@intevation.de>
parents: 1363
diff changeset
134 Vue.use(VueClipboard);
141
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
135
159
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
136 let browserLanguage = locale2;
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
137
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
138 // 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
139 const supportedLanguages = {
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
140 en_GB: "British English",
1456
dadf309eec51 translations: add language Solvak
Bernhard Reiter <bernhard@intevation.de>
parents: 1429
diff changeset
141 de_AT: "Deutsch",
dadf309eec51 translations: add language Solvak
Bernhard Reiter <bernhard@intevation.de>
parents: 1429
diff changeset
142 sk_SK: "slovenčina"
159
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
143 };
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
144
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
145 if (browserLanguage === "de-DE") {
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
146 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
147 }
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
148
1456
dadf309eec51 translations: add language Solvak
Bernhard Reiter <bernhard@intevation.de>
parents: 1429
diff changeset
149 if (browserLanguage === "sk") {
dadf309eec51 translations: add language Solvak
Bernhard Reiter <bernhard@intevation.de>
parents: 1429
diff changeset
150 browserLanguage = "sk_SK";
dadf309eec51 translations: add language Solvak
Bernhard Reiter <bernhard@intevation.de>
parents: 1429
diff changeset
151 }
dadf309eec51 translations: add language Solvak
Bernhard Reiter <bernhard@intevation.de>
parents: 1429
diff changeset
152
159
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
153 const language = browserLanguage.replace("-", "_");
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
154 const isLanguageAvailable = supportedLanguages[language];
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
155 let defaultLanguage = isLanguageAvailable ? language : "en_GB";
141
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
156
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
157 Vue.use(GetTextPlugin, {
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
158 translations: translations,
159
3d9341f6da4e feat: Locale of browser determines the default language
Thomas Junk <thomas.junk@intevation.de>
parents: 141
diff changeset
159 availableLanguages: supportedLanguages,
141
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
160 defaultLanguage: defaultLanguage
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
161 });
Thomas Junk <thomas.junk@intevation.de>
parents: 30
diff changeset
162
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
163 Vue.config.productionTip = false;
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
164
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
165 const app = new Vue({
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
166 router,
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
167 store,
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
168 render: h => h(App)
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
169 }).$mount("#app");
295
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
170
22deb76dff2c feat: Added vue2-toastr
Thomas Junk <thomas.junk@intevation.de>
parents: 159
diff changeset
171 export default app;