@bottlebooks/valid-values 10.30.0 → 10.30.1
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/CHANGELOG.md +4 -0
- package/dist/core/translate.d.ts.map +1 -1
- package/dist/core/translate.js +9 -1
- package/package.json +2 -2
- package/src/core/translate.ts +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [10.30.1](https://github.com/bottlebooks/bottlebooks/compare/@bottlebooks/valid-values@10.30.0...@bottlebooks/valid-values@10.30.1) (2024-07-19)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @bottlebooks/valid-values
|
|
9
|
+
|
|
6
10
|
# [10.30.0](https://github.com/bottlebooks/bottlebooks/compare/@bottlebooks/valid-values@10.29.2...@bottlebooks/valid-values@10.30.0) (2024-07-19)
|
|
7
11
|
|
|
8
12
|
### Features
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../src/core/translate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAEvF,wBAAgB,SAAS,CACvB,KAAK,EAAE,0BAA0B,EACjC,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../src/core/translate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAEvF,wBAAgB,SAAS,CACvB,KAAK,EAAE,0BAA0B,EACjC,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,UAyChB"}
|
package/dist/core/translate.js
CHANGED
|
@@ -18,7 +18,15 @@ function translate(title, locale, values) {
|
|
|
18
18
|
return '';
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
var unsupportedLocalesFromDashboard = ['ka' // TODO Georgian was added to E-labels dashboard but valid values are not translated. We don't want to see errors/warnings about that.
|
|
22
|
+
];
|
|
23
|
+
if (!locale) locale = 'en';
|
|
24
|
+
|
|
25
|
+
if (unsupportedLocalesFromDashboard.includes(locale)) {
|
|
26
|
+
locale = 'en';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_core.i18n.activate(locale);
|
|
22
30
|
|
|
23
31
|
var translation = _core.i18n._(messageId, values);
|
|
24
32
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@bottlebooks/valid-values",
|
|
3
3
|
"description": "The Bottlebooks lookup values, defined globally.",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "10.30.
|
|
5
|
+
"version": "10.30.1",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@lingui/core": "3.14.0"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "9459ef32ad19e1f6e1e635053231bfde83b1c95a"
|
|
40
40
|
}
|
package/src/core/translate.ts
CHANGED
|
@@ -17,8 +17,14 @@ export function translate(
|
|
|
17
17
|
);
|
|
18
18
|
return '';
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const unsupportedLocalesFromDashboard : Array<string> = [
|
|
21
|
+
'ka' // TODO Georgian was added to E-labels dashboard but valid values are not translated. We don't want to see errors/warnings about that.
|
|
22
|
+
];
|
|
23
|
+
if (!locale) locale = 'en';
|
|
24
|
+
if (unsupportedLocalesFromDashboard.includes(locale)) {
|
|
25
|
+
locale = 'en';
|
|
26
|
+
}
|
|
27
|
+
i18n.activate(locale);
|
|
22
28
|
|
|
23
29
|
const translation = i18n._(messageId, values);
|
|
24
30
|
if (translation === messageId && messageId.includes('.validvalues.')) {
|