not-locale 0.0.28 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import nsLocale from
|
|
1
|
+
import nsLocale from "./nsLocale";
|
|
2
2
|
|
|
3
3
|
const services = { nsLocale };
|
|
4
4
|
const manifest = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
5
|
+
modules: {
|
|
6
|
+
locale: {
|
|
7
|
+
default: "ru",
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
menu: {
|
|
11
|
+
top: {
|
|
12
|
+
sections: [
|
|
13
|
+
{
|
|
14
|
+
id: "locale",
|
|
15
|
+
title: "",
|
|
16
|
+
icon: {
|
|
17
|
+
font: "language",
|
|
18
|
+
size: "medium",
|
|
19
|
+
svg: "",
|
|
20
|
+
src: "",
|
|
21
|
+
},
|
|
22
|
+
tag: {
|
|
23
|
+
padding: "small",
|
|
24
|
+
bold: true,
|
|
25
|
+
color: "success",
|
|
26
|
+
title: "",
|
|
27
|
+
},
|
|
28
|
+
showOnTouch: true,
|
|
29
|
+
place: "end",
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
export { services, manifest};
|
|
36
|
+
export { services, manifest };
|
|
@@ -151,19 +151,24 @@ class nsLocale {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
selectBest() {
|
|
154
|
-
|
|
155
|
-
if (
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if (
|
|
160
|
-
|
|
154
|
+
const onlyOneEnabled = this.app.getOptions("modules.locale.only");
|
|
155
|
+
if (onlyOneEnabled) {
|
|
156
|
+
return this.app.getWorking("locale", onlyOneEnabled);
|
|
157
|
+
} else {
|
|
158
|
+
let defaultLocale = "ru";
|
|
159
|
+
if (navigator.languages) {
|
|
160
|
+
const navigatorLocale = navigator.languages.find((itm) => {
|
|
161
|
+
return this.locales.includes(itm);
|
|
162
|
+
});
|
|
163
|
+
if (navigatorLocale) {
|
|
164
|
+
defaultLocale = navigatorLocale;
|
|
165
|
+
}
|
|
161
166
|
}
|
|
167
|
+
return this.app.getWorking(
|
|
168
|
+
"locale",
|
|
169
|
+
this.app.getOptions("modules.locale.default", defaultLocale)
|
|
170
|
+
);
|
|
162
171
|
}
|
|
163
|
-
return this.app.getWorking(
|
|
164
|
-
"locale",
|
|
165
|
-
this.app.getOptions("modules.locale.default", defaultLocale)
|
|
166
|
-
);
|
|
167
172
|
}
|
|
168
173
|
}
|
|
169
174
|
|