langie 2.0.3 → 2.0.4

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/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * langie v2.0.3
2
+ * langie v2.0.4
3
3
  * (c) 2026 nlit
4
4
  * @license Apache-2.0
5
5
  *
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  // src/useLangie.ts
11
- import { watch } from "vue";
11
+ import { watch as watch2 } from "vue";
12
12
 
13
13
  // src/constants.ts
14
14
  var DEFAULT_API_HOST = "https://api.langie.uk/v1";
@@ -221,7 +221,7 @@ async function fetchAvailableLanguages(options = {}) {
221
221
  }
222
222
 
223
223
  // src/composables/useLangie-core.ts
224
- import { ref, reactive } from "vue";
224
+ import { ref, reactive, watch } from "vue";
225
225
 
226
226
  // src/utils/debug.ts
227
227
  function devDebug(...args) {
@@ -561,6 +561,13 @@ function useLangieCore(options = {}) {
561
561
  }).catch(() => {
562
562
  });
563
563
  };
564
+ watch(
565
+ [() => availableLanguages.value.length, currentLanguage],
566
+ ([count, lang]) => {
567
+ if (count) applyLocalizedNames(lang);
568
+ },
569
+ { immediate: true }
570
+ );
564
571
  const setLanguage = (lang) => {
565
572
  if (lang && lang !== currentLanguage.value) {
566
573
  }
@@ -1079,7 +1086,7 @@ function createLangieInstance(options = {}) {
1079
1086
  };
1080
1087
  loadCachedTranslations();
1081
1088
  loadCachedLanguages();
1082
- watch(currentLanguage2, () => {
1089
+ watch2(currentLanguage2, () => {
1083
1090
  Object.keys(translations2).forEach((key) => delete translations2[key]);
1084
1091
  Object.keys(uiTranslations2).forEach((key) => delete uiTranslations2[key]);
1085
1092
  loadCachedTranslations();
@@ -1362,7 +1369,7 @@ function createLangieInstance(options = {}) {
1362
1369
  isLoading.value = false;
1363
1370
  }
1364
1371
  };
1365
- watch(currentLanguage2, () => {
1372
+ watch2(currentLanguage2, () => {
1366
1373
  recentlyQueued.clear();
1367
1374
  loadCachedTranslations();
1368
1375
  batching.cleanup();
@@ -2455,7 +2462,7 @@ LanguageSelect_default.__scopeId = "data-v-5b09cc17";
2455
2462
  // vue-script:/builds/codelits/langie-sdk/src/components/InterfaceLanguageSelect.vue?type=script
2456
2463
  import { defineComponent as _defineComponent2 } from "vue";
2457
2464
  import { openBlock as _openBlock2, createBlock as _createBlock2, createCommentVNode as _createCommentVNode2, createElementVNode as _createElementVNode2, unref as _unref2, toDisplayString as _toDisplayString2, normalizeClass as _normalizeClass2, createElementBlock as _createElementBlock2 } from "vue";
2458
- import { computed as computed2, watch as watch2, onMounted, ref as ref3 } from "vue";
2465
+ import { computed as computed2, watch as watch3, onMounted, ref as ref3 } from "vue";
2459
2466
  var _hoisted_12 = { class: "interface-language-select-wrapper" };
2460
2467
  var _hoisted_22 = { class: "loader-text" };
2461
2468
  var InterfaceLanguageSelect_default = /* @__PURE__ */ _defineComponent2({
@@ -2536,12 +2543,12 @@ var InterfaceLanguageSelect_default = /* @__PURE__ */ _defineComponent2({
2536
2543
  }
2537
2544
  }
2538
2545
  }
2539
- watch2(currentLanguage2, (newLangCode) => {
2546
+ watch3(currentLanguage2, (newLangCode) => {
2540
2547
  if (newLangCode) {
2541
2548
  localStorage.setItem("interface_language", newLangCode);
2542
2549
  }
2543
2550
  });
2544
- watch2(
2551
+ watch3(
2545
2552
  () => effectiveLanguages.value,
2546
2553
  (newLanguages) => {
2547
2554
  if (newLanguages.length > 0 && !currentLanguage2.value) {
@@ -2585,7 +2592,7 @@ var InterfaceLanguageSelect_default = /* @__PURE__ */ _defineComponent2({
2585
2592
  }
2586
2593
  }
2587
2594
  });
2588
- watch2(
2595
+ watch3(
2589
2596
  currentLanguageObject,
2590
2597
  (newValue) => {
2591
2598
  if (newValue) {
@@ -2643,7 +2650,7 @@ InterfaceLanguageSelect_default.__scopeId = "data-v-258d337a";
2643
2650
  // vue-script:/builds/codelits/langie-sdk/src/components/lt.vue?type=script
2644
2651
  import { defineComponent as _defineComponent3 } from "vue";
2645
2652
  import { toDisplayString as _toDisplayString3, openBlock as _openBlock3, createElementBlock as _createElementBlock3, Transition as _Transition, withCtx as _withCtx2, createBlock as _createBlock3 } from "vue";
2646
- import { computed as computed3, useSlots, watch as watch3 } from "vue";
2653
+ import { computed as computed3, useSlots, watch as watch4 } from "vue";
2647
2654
  import { ref as ref4, nextTick as nextTick2 } from "vue";
2648
2655
  var lt_default = /* @__PURE__ */ _defineComponent3({
2649
2656
  __name: "lt",
@@ -2685,7 +2692,7 @@ var lt_default = /* @__PURE__ */ _defineComponent3({
2685
2692
  return (slotContent || "").trim();
2686
2693
  });
2687
2694
  const forceUpdate = ref4(0);
2688
- watch3(
2695
+ watch4(
2689
2696
  [uiTranslations2, translations2],
2690
2697
  () => {
2691
2698
  nextTick2(() => {