@kosdev-code/kos-ui-sdk 3.0.29 → 3.0.31
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/core/core/transport/mock/index.d.ts +2 -0
- package/core/core/transport/mock/index.d.ts.map +1 -1
- package/core/core/transport/mock/mock-boot.d.ts +39 -0
- package/core/core/transport/mock/mock-boot.d.ts.map +1 -0
- package/index.cjs +34 -4
- package/index.cjs.map +1 -1
- package/index.js +35 -5
- package/index.js.map +1 -1
- package/models/models/translation/translation-model.d.ts +4 -2
- package/models/models/translation/translation-model.d.ts.map +1 -1
- package/models/models/translation/types/index.d.ts +24 -6
- package/package.json +2 -2
- package/{software-info-registration-CA13_Qc_.cjs → software-info-registration-BPN4QLfN.cjs} +15 -9
- package/{software-info-registration-CA13_Qc_.cjs.map → software-info-registration-BPN4QLfN.cjs.map} +1 -1
- package/{software-info-registration-CKRUzp_3.js → software-info-registration-BTHhITrs.js} +15 -9
- package/{software-info-registration-CKRUzp_3.js.map → software-info-registration-BTHhITrs.js.map} +1 -1
- package/testing.cjs +1 -1
- package/testing.js +1 -1
- package/ui/contexts/translation-container/kos-translations-provider.d.ts +8 -1
- package/ui/contexts/translation-container/kos-translations-provider.d.ts.map +1 -1
|
@@ -24128,6 +24128,7 @@ const splitKey = (currentNamespace, _key) => {
|
|
|
24128
24128
|
return { namespace: currentNamespace, key: _key };
|
|
24129
24129
|
}
|
|
24130
24130
|
};
|
|
24131
|
+
const isTranslationFallback = (bundle) => bundle?.fallback === true;
|
|
24131
24132
|
let TranslationModelImpl = class {
|
|
24132
24133
|
/** Unique identifier for the model instance */
|
|
24133
24134
|
id;
|
|
@@ -24187,23 +24188,28 @@ let TranslationModelImpl = class {
|
|
|
24187
24188
|
}
|
|
24188
24189
|
return langs;
|
|
24189
24190
|
}
|
|
24191
|
+
/** The namespace's translation file for `lang`, through `resolver`; empty when it has none. */
|
|
24192
|
+
loadFile(lang) {
|
|
24193
|
+
try {
|
|
24194
|
+
const translationsPath = this.resolver(this.namespace, lang);
|
|
24195
|
+
return getTranslations(translationsPath, this.rootUrl);
|
|
24196
|
+
} catch {
|
|
24197
|
+
return Promise.resolve({});
|
|
24198
|
+
}
|
|
24199
|
+
}
|
|
24190
24200
|
/**
|
|
24191
24201
|
* Loads and merges translations for all locales in the fallback chain.
|
|
24192
24202
|
* @private
|
|
24193
24203
|
*/
|
|
24194
24204
|
async loadTranslations() {
|
|
24195
24205
|
const reversed = this.getTranslationLocales(this.currentLocale).reverse();
|
|
24196
|
-
const allTranslations = reversed.map((lang) => {
|
|
24206
|
+
const allTranslations = reversed.map(async (lang) => {
|
|
24197
24207
|
if (this.bundleResolver) {
|
|
24198
24208
|
const context = KosContextManager.getContext(this.id);
|
|
24199
|
-
|
|
24200
|
-
|
|
24201
|
-
try {
|
|
24202
|
-
const translationsPath = this.resolver(this.namespace, lang);
|
|
24203
|
-
return getTranslations(translationsPath, this.rootUrl);
|
|
24204
|
-
} catch {
|
|
24205
|
-
return Promise.resolve({});
|
|
24209
|
+
const bundle = await this.bundleResolver(this.namespace, lang, context);
|
|
24210
|
+
return isTranslationFallback(bundle) ? this.loadFile(lang) : bundle;
|
|
24206
24211
|
}
|
|
24212
|
+
return this.loadFile(lang);
|
|
24207
24213
|
});
|
|
24208
24214
|
const results = await Promise.allSettled(allTranslations);
|
|
24209
24215
|
kosAction(() => {
|
|
@@ -25388,4 +25394,4 @@ export {
|
|
|
25388
25394
|
StateBean as y,
|
|
25389
25395
|
getStateProps as z
|
|
25390
25396
|
};
|
|
25391
|
-
//# sourceMappingURL=software-info-registration-
|
|
25397
|
+
//# sourceMappingURL=software-info-registration-BTHhITrs.js.map
|