@kosdev-code/kos-ui-sdk 3.0.29 → 3.0.30

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.
@@ -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
- return this.bundleResolver(this.namespace, lang, context);
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-CKRUzp_3.js.map
25397
+ //# sourceMappingURL=software-info-registration-BTHhITrs.js.map