@openmrs/esm-api 10.0.1-pre.5136 → 10.0.1-pre.5147
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/.turbo/turbo-build.log +1 -1
- package/dist/current-user.d.ts.map +1 -1
- package/dist/current-user.js +4 -0
- package/mock-jest.ts +1 -0
- package/mock.ts +1 -0
- package/package.json +9 -9
- package/src/current-user.ts +4 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"current-user.d.ts","sourceRoot":"","sources":["../src/current-user.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAiB,MAAM,SAAS,CAAC;AAEtG,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,oBAAoB,CAAC;AAErE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,IAAI,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,KAAK,CAAC;IACd,OAAO,EAAE,IAAI,CAAC;CACf,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,YAAY,0CAGvB,CAAC;AAGH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,iBAAS,cAAc,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC;AAC/C;;;;;GAKG;AACH,iBAAS,cAAc,CAAC,IAAI,EAAE;IAAE,iBAAiB,EAAE,IAAI,CAAA;CAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;AAChF;;;;;GAKG;AACH,iBAAS,cAAc,CAAC,IAAI,EAAE;IAAE,iBAAiB,EAAE,KAAK,CAAA;CAAE,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;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,IAAI,EAAE,OAAO,QAc5C;AAwBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,yBAYtE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,SAK/B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAC3B,iBAAiB,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,EACzC,IAAI,EAAE;IAAE,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;CAAE,WAa3D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,0BAmB9B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,yCAOjC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,CAW7G;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE;IACd,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB,EACD,eAAe,CAAC,EAAE,eAAe,GAChC,OAAO,CAAC,YAAY,CAAC,CAcvB"}
|
package/dist/current-user.js
CHANGED
|
@@ -78,6 +78,10 @@ function isValidLocale(locale) {
|
|
|
78
78
|
* @param data The session object containing locale information.
|
|
79
79
|
*/ export function setUserLanguage(data) {
|
|
80
80
|
let locale = data.locale ?? data.user?.userProperties?.defaultLocale;
|
|
81
|
+
// Only underscores are converted here, deliberately, rather than reusing `toLanguageTag`. i18next
|
|
82
|
+
// reads this value back off `document.lang` and uses it as the translation bundle key, and those
|
|
83
|
+
// bundles are named with the POSIX form (`uz@Latn.json`), so converting `@` would send the loader
|
|
84
|
+
// after a bundle that does not exist.
|
|
81
85
|
if (locale && locale.includes('_')) {
|
|
82
86
|
locale = locale.replaceAll('_', '-');
|
|
83
87
|
}
|
package/mock-jest.ts
CHANGED
package/mock.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-api",
|
|
3
|
-
"version": "10.0.1-pre.
|
|
3
|
+
"version": "10.0.1-pre.5147",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "The javascript module for interacting with the OpenMRS API",
|
|
6
6
|
"type": "module",
|
|
@@ -56,16 +56,16 @@
|
|
|
56
56
|
"lodash-es": "^4.17.21"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@openmrs/esm-config": "^10.0.1-pre.
|
|
60
|
-
"@openmrs/esm-error-handling": "^10.0.1-pre.
|
|
61
|
-
"@openmrs/esm-globals": "^10.0.1-pre.
|
|
62
|
-
"@openmrs/esm-navigation": "^10.0.1-pre.
|
|
59
|
+
"@openmrs/esm-config": "^10.0.1-pre.5147",
|
|
60
|
+
"@openmrs/esm-error-handling": "^10.0.1-pre.5147",
|
|
61
|
+
"@openmrs/esm-globals": "^10.0.1-pre.5147",
|
|
62
|
+
"@openmrs/esm-navigation": "^10.0.1-pre.5147"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@openmrs/esm-config": "10.0.1-pre.
|
|
66
|
-
"@openmrs/esm-error-handling": "10.0.1-pre.
|
|
67
|
-
"@openmrs/esm-globals": "10.0.1-pre.
|
|
68
|
-
"@openmrs/esm-navigation": "10.0.1-pre.
|
|
65
|
+
"@openmrs/esm-config": "10.0.1-pre.5147",
|
|
66
|
+
"@openmrs/esm-error-handling": "10.0.1-pre.5147",
|
|
67
|
+
"@openmrs/esm-globals": "10.0.1-pre.5147",
|
|
68
|
+
"@openmrs/esm-navigation": "10.0.1-pre.5147",
|
|
69
69
|
"@swc/cli": "0.8.1",
|
|
70
70
|
"@swc/core": "1.15.21",
|
|
71
71
|
"@vitest/coverage-v8": "^4.1.2",
|
package/src/current-user.ts
CHANGED
|
@@ -157,6 +157,10 @@ function isValidLocale(locale: unknown): locale is string {
|
|
|
157
157
|
export function setUserLanguage(data: Session) {
|
|
158
158
|
let locale = data.locale ?? data.user?.userProperties?.defaultLocale;
|
|
159
159
|
|
|
160
|
+
// Only underscores are converted here, deliberately, rather than reusing `toLanguageTag`. i18next
|
|
161
|
+
// reads this value back off `document.lang` and uses it as the translation bundle key, and those
|
|
162
|
+
// bundles are named with the POSIX form (`uz@Latn.json`), so converting `@` would send the loader
|
|
163
|
+
// after a bundle that does not exist.
|
|
160
164
|
if (locale && locale.includes('_')) {
|
|
161
165
|
locale = locale.replaceAll('_', '-');
|
|
162
166
|
}
|