@appsemble/utils 0.36.6 → 0.36.7
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/README.md +3 -3
- package/i18n.d.ts +1 -0
- package/i18n.js +4 -1
- package/package.json +4 -4
- package/theme.js +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#  Appsemble Utilities
|
|
2
2
|
|
|
3
3
|
> Internal utility functions used across multiple Appsemble projects.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@appsemble/utils)
|
|
6
|
-
[](https://gitlab.com/appsemble/appsemble/-/releases/0.36.7)
|
|
7
7
|
[](https://prettier.io)
|
|
8
8
|
|
|
9
9
|
## Table of Contents
|
|
@@ -26,5 +26,5 @@ not guaranteed.
|
|
|
26
26
|
|
|
27
27
|
## License
|
|
28
28
|
|
|
29
|
-
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.36.
|
|
29
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.36.7/LICENSE.md) ©
|
|
30
30
|
[Appsemble](https://appsemble.com)
|
package/i18n.d.ts
CHANGED
package/i18n.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export function normalizeLocale(language) {
|
|
2
|
+
return language.replaceAll('_', '-').toLowerCase();
|
|
3
|
+
}
|
|
1
4
|
/**
|
|
2
5
|
* Sort locales by specificity
|
|
3
6
|
*
|
|
@@ -12,7 +15,7 @@
|
|
|
12
15
|
* @returns A sorted list of lower case languages in order of preference.
|
|
13
16
|
*/
|
|
14
17
|
export function sortLocales(languages) {
|
|
15
|
-
const copy = languages.map(
|
|
18
|
+
const copy = languages.map(normalizeLocale);
|
|
16
19
|
// Compare every language to the previous in the array. The first item is skipped, since there is
|
|
17
20
|
// nothing to compare against.
|
|
18
21
|
for (let i = 1; i < copy.length; i += 1) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/utils",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.7",
|
|
4
4
|
"description": "Utility functions used in Appsemble internally",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"test": "vitest"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@appsemble/lang-sdk": "0.36.
|
|
43
|
-
"@appsemble/types": "0.36.
|
|
42
|
+
"@appsemble/lang-sdk": "0.36.7",
|
|
43
|
+
"@appsemble/types": "0.36.7",
|
|
44
44
|
"@fortawesome/fontawesome-common-types": "^6.0.0",
|
|
45
45
|
"axios": "^1.0.0",
|
|
46
46
|
"langmap": "^0.0.16",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/langmap": "0.0.3",
|
|
53
|
-
"bulma": "=0.9.
|
|
53
|
+
"bulma": "=0.9.4",
|
|
54
54
|
"koas-core": "0.7.0",
|
|
55
55
|
"vitest": "2.1.9"
|
|
56
56
|
},
|