gt-i18n 1.0.3 → 1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # gt-i18n
2
2
 
3
+ ## 1.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1856](https://github.com/generaltranslation/gt/pull/1856) [`b742df9`](https://github.com/generaltranslation/gt/commit/b742df9f0684c6ea12da140c4fd73eebb42f897a) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Flatten the internal i18n cache structure: the locale-cache layer is inlined into `I18nCache`, the in-flight promise dedupe shared by the caches is extracted into one helper, and the dev-only prefetch machinery is statically gated behind `process.env.NODE_ENV !== 'production'` so production bundles drop it. No public API changes; `gt-i18n/internal` and `gt-i18n/internal/types` exports are unchanged.
8
+
9
+ - [#1855](https://github.com/generaltranslation/gt/pull/1855) [`a148737`](https://github.com/generaltranslation/gt/commit/a1487377728b662dfd749ecfbd449a1e8d47db49) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Collapse the I18nCache constructor-time validation layer into a single helper. Observable behavior is unchanged: the same warnings are logged when a custom `runtimeUrl` is configured without GT credentials, and providing `loadDictionary` without a source `dictionary` still throws. The unreachable validation branches are removed, slightly shrinking browser bundles.
10
+
3
11
  ## 1.0.3
4
12
 
5
13
  ### Patch Changes
@@ -66,6 +66,10 @@ type TranslationBatchConfig = {
66
66
  * Just a way to be more explicit about what "hash" is
67
67
  */
68
68
  type Hash = string;
69
+ /**
70
+ * Just being explicit about the purpose of this type
71
+ */
72
+ type Locale = string;
69
73
  //#endregion
70
74
  //#region src/i18n-cache/translations-manager/translations-loaders/types.d.ts
71
75
  /**
@@ -231,11 +235,5 @@ declare class WritableConditionStore extends ReadonlyConditionStore implements W
231
235
  setEnableI18n: (enableI18n: boolean) => void;
232
236
  }
233
237
  //#endregion
234
- //#region src/i18n-cache/translations-manager/LocalesCache.d.ts
235
- /**
236
- * Just being explicit about the purpose of this type
237
- */
238
- type Locale = string;
239
- //#endregion
240
- export { TranslationsLoader as _, ReadonlyConditionStoreParams as a, LocaleCandidates as c, I18nCacheConfig as d, I18nCacheConstructorParams as f, WritableConditionStoreInterface as g, ScopedConditionStoreInterface as h, ReadonlyConditionStore as i, AsyncReadonlyConditionStoreInterface as l, ReadonlyConditionStoreInterface as m, WritableConditionStore as n, I18nConfig as o, LocaleResolverConfig as p, WritableConditionStoreParams as r, I18nConfigParams as s, Locale as t, DictionaryConfig as u, Hash as v, GTConfig as y };
241
- //# sourceMappingURL=LocalesCache-BrqsSW3K.d.cts.map
238
+ export { Hash as _, I18nConfig as a, AsyncReadonlyConditionStoreInterface as c, I18nCacheConstructorParams as d, LocaleResolverConfig as f, TranslationsLoader as g, WritableConditionStoreInterface as h, ReadonlyConditionStoreParams as i, DictionaryConfig as l, ScopedConditionStoreInterface as m, WritableConditionStoreParams as n, I18nConfigParams as o, ReadonlyConditionStoreInterface as p, ReadonlyConditionStore as r, LocaleCandidates as s, WritableConditionStore as t, I18nCacheConfig as u, Locale as v, GTConfig as y };
239
+ //# sourceMappingURL=WritableConditionStore-7OwoOSxr.d.cts.map
@@ -65,6 +65,10 @@ type TranslationBatchConfig = {
65
65
  * Just a way to be more explicit about what "hash" is
66
66
  */
67
67
  type Hash = string;
68
+ /**
69
+ * Just being explicit about the purpose of this type
70
+ */
71
+ type Locale = string;
68
72
  //#endregion
69
73
  //#region src/i18n-cache/translations-manager/translations-loaders/types.d.ts
70
74
  /**
@@ -230,11 +234,5 @@ declare class WritableConditionStore extends ReadonlyConditionStore implements W
230
234
  setEnableI18n: (enableI18n: boolean) => void;
231
235
  }
232
236
  //#endregion
233
- //#region src/i18n-cache/translations-manager/LocalesCache.d.ts
234
- /**
235
- * Just being explicit about the purpose of this type
236
- */
237
- type Locale = string;
238
- //#endregion
239
- export { TranslationsLoader as _, ReadonlyConditionStoreParams as a, LocaleCandidates as c, I18nCacheConfig as d, I18nCacheConstructorParams as f, WritableConditionStoreInterface as g, ScopedConditionStoreInterface as h, ReadonlyConditionStore as i, AsyncReadonlyConditionStoreInterface as l, ReadonlyConditionStoreInterface as m, WritableConditionStore as n, I18nConfig as o, LocaleResolverConfig as p, WritableConditionStoreParams as r, I18nConfigParams as s, Locale as t, DictionaryConfig as u, Hash as v, GTConfig as y };
240
- //# sourceMappingURL=LocalesCache-Cgg8OjSV.d.mts.map
237
+ export { Hash as _, I18nConfig as a, AsyncReadonlyConditionStoreInterface as c, I18nCacheConstructorParams as d, LocaleResolverConfig as f, TranslationsLoader as g, WritableConditionStoreInterface as h, ReadonlyConditionStoreParams as i, DictionaryConfig as l, ScopedConditionStoreInterface as m, WritableConditionStoreParams as n, I18nConfigParams as o, ReadonlyConditionStoreInterface as p, ReadonlyConditionStore as r, LocaleCandidates as s, WritableConditionStore as t, I18nCacheConfig as u, Locale as v, GTConfig as y };
238
+ //# sourceMappingURL=WritableConditionStore-Y7klxD29.d.mts.map
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_versionId = require("./versionId-Bm1R4Gnm.cjs");
2
+ const require_versionId = require("./versionId-CT-IBMV6.cjs");
3
3
  let generaltranslation_internal = require("generaltranslation/internal");
4
4
  let _generaltranslation_format = require("@generaltranslation/format");
5
5
  let generaltranslation = require("generaltranslation");
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { D as logger_default, S as extractVariables, _ as resolveStringContentWithFallback, a as getDefaultLocale, b as interpolateIcuMessage, c as getLocales, d as getWritableConditionStore, g as resolveStringContent, i as hashMessage, l as getRegion, n as isEncodedTranslationOptions, o as getLocale, r as decodeOptions, s as getLocaleProperties, t as getVersionId, u as resolveCanonicalLocale, x as createInterpolationFailureMessage } from "./versionId-BMLrkyzj.mjs";
1
+ import { D as logger_default, S as extractVariables, _ as resolveStringContentWithFallback, a as getDefaultLocale, b as interpolateIcuMessage, c as getLocales, d as getWritableConditionStore, g as resolveStringContent, i as hashMessage, l as getRegion, n as isEncodedTranslationOptions, o as getLocale, r as decodeOptions, s as getLocaleProperties, t as getVersionId, u as resolveCanonicalLocale, x as createInterpolationFailureMessage } from "./versionId-JokehdDv.mjs";
2
2
  import { VAR_IDENTIFIER, encode, libraryDefaultLocale } from "generaltranslation/internal";
3
3
  import { formatMessage } from "@generaltranslation/format";
4
4
  import { declareVar, decodeVars, derive } from "generaltranslation";
@@ -1,4 +1,4 @@
1
1
  import { a as JsxTranslationOptions, c as NormalizedLookupOptions, d as TranslationOptions, f as TranslationVariables, i as GTTranslationOptions, l as RuntimeTranslationOptions, n as DictionaryLookupOptions, o as LookupOptions, r as EncodedTranslationOptions, s as LookupOptionsFor, t as DictionaryEntryOptions, u as TranslationMetadata } from "./options-BXeFwN0R.cjs";
2
- import { _ as TranslationsLoader, a as ReadonlyConditionStoreParams, c as LocaleCandidates, d as I18nCacheConfig, f as I18nCacheConstructorParams, g as WritableConditionStoreInterface, h as ScopedConditionStoreInterface, l as AsyncReadonlyConditionStoreInterface, m as ReadonlyConditionStoreInterface, p as LocaleResolverConfig, r as WritableConditionStoreParams, s as I18nConfigParams, t as Locale, u as DictionaryConfig, v as Hash, y as GTConfig } from "./LocalesCache-BrqsSW3K.cjs";
2
+ import { _ as Hash, c as AsyncReadonlyConditionStoreInterface, d as I18nCacheConstructorParams, f as LocaleResolverConfig, g as TranslationsLoader, h as WritableConditionStoreInterface, i as ReadonlyConditionStoreParams, l as DictionaryConfig, m as ScopedConditionStoreInterface, n as WritableConditionStoreParams, o as I18nConfigParams, p as ReadonlyConditionStoreInterface, s as LocaleCandidates, u as I18nCacheConfig, v as Locale, y as GTConfig } from "./WritableConditionStore-7OwoOSxr.cjs";
3
3
  import { a as DictionaryLeaf, c as DictionaryValue, i as DictionaryKey, n as Dictionary, o as DictionaryObject, r as DictionaryEntry, s as DictionaryPath, t as DictionaryLoader } from "./DictionaryCache-DjAdDNiM.cjs";
4
4
  export { type AsyncReadonlyConditionStoreInterface, type Dictionary, type DictionaryConfig, type DictionaryEntry, DictionaryEntryOptions, type DictionaryKey, type DictionaryLeaf, type DictionaryLoader, DictionaryLookupOptions, type DictionaryObject, type DictionaryPath, type DictionaryValue, EncodedTranslationOptions, type GTConfig, GTTranslationOptions, type Hash, type I18nCacheConfig, type I18nCacheConstructorParams, type I18nConfigParams, JsxTranslationOptions, type Locale, type LocaleCandidates, type LocaleResolverConfig, LookupOptions, LookupOptionsFor, NormalizedLookupOptions, type ReadonlyConditionStoreInterface, type ReadonlyConditionStoreParams, RuntimeTranslationOptions, type ScopedConditionStoreInterface, TranslationMetadata, TranslationOptions, TranslationVariables, type TranslationsLoader, type WritableConditionStoreInterface, type WritableConditionStoreParams };
@@ -1,4 +1,4 @@
1
1
  import { a as JsxTranslationOptions, c as NormalizedLookupOptions, d as TranslationOptions, f as TranslationVariables, i as GTTranslationOptions, l as RuntimeTranslationOptions, n as DictionaryLookupOptions, o as LookupOptions, r as EncodedTranslationOptions, s as LookupOptionsFor, t as DictionaryEntryOptions, u as TranslationMetadata } from "./options-DDUyXaLT.mjs";
2
- import { _ as TranslationsLoader, a as ReadonlyConditionStoreParams, c as LocaleCandidates, d as I18nCacheConfig, f as I18nCacheConstructorParams, g as WritableConditionStoreInterface, h as ScopedConditionStoreInterface, l as AsyncReadonlyConditionStoreInterface, m as ReadonlyConditionStoreInterface, p as LocaleResolverConfig, r as WritableConditionStoreParams, s as I18nConfigParams, t as Locale, u as DictionaryConfig, v as Hash, y as GTConfig } from "./LocalesCache-Cgg8OjSV.mjs";
2
+ import { _ as Hash, c as AsyncReadonlyConditionStoreInterface, d as I18nCacheConstructorParams, f as LocaleResolverConfig, g as TranslationsLoader, h as WritableConditionStoreInterface, i as ReadonlyConditionStoreParams, l as DictionaryConfig, m as ScopedConditionStoreInterface, n as WritableConditionStoreParams, o as I18nConfigParams, p as ReadonlyConditionStoreInterface, s as LocaleCandidates, u as I18nCacheConfig, v as Locale, y as GTConfig } from "./WritableConditionStore-Y7klxD29.mjs";
3
3
  import { a as DictionaryLeaf, c as DictionaryValue, i as DictionaryKey, n as Dictionary, o as DictionaryObject, r as DictionaryEntry, s as DictionaryPath, t as DictionaryLoader } from "./DictionaryCache-B7oTBs5W.mjs";
4
4
  export { type AsyncReadonlyConditionStoreInterface, type Dictionary, type DictionaryConfig, type DictionaryEntry, DictionaryEntryOptions, type DictionaryKey, type DictionaryLeaf, type DictionaryLoader, DictionaryLookupOptions, type DictionaryObject, type DictionaryPath, type DictionaryValue, EncodedTranslationOptions, type GTConfig, GTTranslationOptions, type Hash, type I18nCacheConfig, type I18nCacheConstructorParams, type I18nConfigParams, JsxTranslationOptions, type Locale, type LocaleCandidates, type LocaleResolverConfig, LookupOptions, LookupOptionsFor, NormalizedLookupOptions, type ReadonlyConditionStoreInterface, type ReadonlyConditionStoreParams, RuntimeTranslationOptions, type ScopedConditionStoreInterface, TranslationMetadata, TranslationOptions, TranslationVariables, type TranslationsLoader, type WritableConditionStoreInterface, type WritableConditionStoreParams };