gt-i18n 0.9.8 → 0.9.9

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/fallbacks.cjs +1 -1
  3. package/dist/fallbacks.d.cts +1 -1
  4. package/dist/fallbacks.d.mts +1 -1
  5. package/dist/fallbacks.mjs +1 -1
  6. package/dist/{functions-DI1QpQoC.d.cts → functions-BPxoOb-T.d.cts} +2 -2
  7. package/dist/{functions-Dojd5CfY.d.mts → functions-QaonTfxv.d.mts} +2 -2
  8. package/dist/{index-B7BrS8Jn.d.mts → index-CiVQJKIT.d.mts} +2 -2
  9. package/dist/{index-BLWcN0wI.d.cts → index-DvPn0FyQ.d.cts} +2 -2
  10. package/dist/index.cjs +3 -3
  11. package/dist/index.d.cts +2 -2
  12. package/dist/index.d.mts +2 -2
  13. package/dist/index.mjs +3 -3
  14. package/dist/internal-types.d.cts +3 -3
  15. package/dist/internal-types.d.mts +3 -3
  16. package/dist/internal.cjs +2 -2
  17. package/dist/internal.d.cts +4 -4
  18. package/dist/internal.d.mts +4 -4
  19. package/dist/internal.mjs +2 -2
  20. package/dist/{isEncodedTranslationOptions-BOwWa_-J.mjs → isEncodedTranslationOptions-69ZmAUR2.mjs} +2 -2
  21. package/dist/isEncodedTranslationOptions-69ZmAUR2.mjs.map +1 -0
  22. package/dist/{isEncodedTranslationOptions-eqrZWcmP.cjs → isEncodedTranslationOptions-B7rb2W7h.cjs} +2 -2
  23. package/dist/isEncodedTranslationOptions-B7rb2W7h.cjs.map +1 -0
  24. package/dist/{localeResolver-BSGZjvxg.d.cts → localeResolver-BByzii-9.d.mts} +3 -3
  25. package/dist/{localeResolver-DjL1m1_w.d.mts → localeResolver-DEvF0xFF.d.cts} +3 -3
  26. package/dist/{mFallback-pqVm9wDk.mjs → mFallback-B1u9ppFR.mjs} +2 -2
  27. package/dist/{mFallback-pqVm9wDk.mjs.map → mFallback-B1u9ppFR.mjs.map} +1 -1
  28. package/dist/{mFallback-DSBMUg3c.cjs → mFallback-DUDKkPGj.cjs} +2 -2
  29. package/dist/{mFallback-DSBMUg3c.cjs.map → mFallback-DUDKkPGj.cjs.map} +1 -1
  30. package/dist/{options-CczghSzj.d.mts → options-DltHK8u3.d.cts} +6 -2
  31. package/dist/{options-D0Lnxv2X.d.cts → options-Gk6vb5Hx.d.mts} +6 -2
  32. package/dist/{types-PZn6hXxt.d.mts → types-DWixkDmD.d.mts} +2 -2
  33. package/dist/{types-BtGFavAy.d.cts → types-W8aRF-m4.d.cts} +2 -2
  34. package/dist/types.d.cts +3 -3
  35. package/dist/types.d.mts +3 -3
  36. package/dist/{versionId-BTjLA0FZ.mjs → versionId-C6FQLPr1.mjs} +4 -2
  37. package/dist/versionId-C6FQLPr1.mjs.map +1 -0
  38. package/dist/{versionId-7sHbIIgr.cjs → versionId-DhTK9jpz.cjs} +4 -2
  39. package/dist/versionId-DhTK9jpz.cjs.map +1 -0
  40. package/package.json +3 -3
  41. package/dist/isEncodedTranslationOptions-BOwWa_-J.mjs.map +0 -1
  42. package/dist/isEncodedTranslationOptions-eqrZWcmP.cjs.map +0 -1
  43. package/dist/versionId-7sHbIIgr.cjs.map +0 -1
  44. package/dist/versionId-BTjLA0FZ.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # gt-i18n
2
2
 
3
+ ## 0.9.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1786](https://github.com/generaltranslation/gt/pull/1786) [`6945a98`](https://github.com/generaltranslation/gt/commit/6945a9871ea260dd999dcb2246c48b21134721f6) Thanks [@fernando-aviles](https://github.com/fernando-aviles)! - Add `requiresReview`
8
+
9
+ - Updated dependencies [[`6945a98`](https://github.com/generaltranslation/gt/commit/6945a9871ea260dd999dcb2246c48b21134721f6)]:
10
+ - generaltranslation@8.2.19
11
+ - @generaltranslation/supported-locales@2.1.5
12
+
3
13
  ## 0.9.8
4
14
 
5
15
  ### Patch Changes
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_mFallback = require("./mFallback-DSBMUg3c.cjs");
2
+ const require_mFallback = require("./mFallback-DUDKkPGj.cjs");
3
3
  exports.gtFallback = require_mFallback.gtFallback;
4
4
  exports.mFallback = require_mFallback.mFallback;
@@ -1,2 +1,2 @@
1
- import { n as gtFallback, t as mFallback } from "./index-BLWcN0wI.cjs";
1
+ import { n as gtFallback, t as mFallback } from "./index-DvPn0FyQ.cjs";
2
2
  export { gtFallback, mFallback };
@@ -1,2 +1,2 @@
1
- import { n as gtFallback, t as mFallback } from "./index-B7BrS8Jn.mjs";
1
+ import { n as gtFallback, t as mFallback } from "./index-CiVQJKIT.mjs";
2
2
  export { gtFallback, mFallback };
@@ -1,2 +1,2 @@
1
- import { n as gtFallback, t as mFallback } from "./mFallback-pqVm9wDk.mjs";
1
+ import { n as gtFallback, t as mFallback } from "./mFallback-B1u9ppFR.mjs";
2
2
  export { gtFallback, mFallback };
@@ -1,4 +1,4 @@
1
- import { c as JsxTranslationOptions, i as DictionaryTranslationOptions, s as InlineTranslationOptions } from "./options-D0Lnxv2X.cjs";
1
+ import { c as JsxTranslationOptions, i as DictionaryTranslationOptions, s as InlineTranslationOptions } from "./options-DltHK8u3.cjs";
2
2
  import { JsxChildren } from "@generaltranslation/format/types";
3
3
 
4
4
  //#region src/translation-functions/types/functions.d.ts
@@ -63,4 +63,4 @@ type TFunctionType = ((id: string, options?: DictionaryTranslationOptions) => st
63
63
  type ResolveJsxTranslationFunction = (locale: string, children: JsxChildren, options?: JsxTranslationOptions) => JsxChildren | undefined;
64
64
  //#endregion
65
65
  export { SyncResolutionFunction as a, ResolveJsxTranslationFunction as i, GTFunctionType as n, SyncResolutionFunctionWithFallback as o, MFunctionType as r, TFunctionType as s, DictionaryObjectTranslation as t };
66
- //# sourceMappingURL=functions-DI1QpQoC.d.cts.map
66
+ //# sourceMappingURL=functions-BPxoOb-T.d.cts.map
@@ -1,4 +1,4 @@
1
- import { c as JsxTranslationOptions, i as DictionaryTranslationOptions, s as InlineTranslationOptions } from "./options-CczghSzj.mjs";
1
+ import { c as JsxTranslationOptions, i as DictionaryTranslationOptions, s as InlineTranslationOptions } from "./options-Gk6vb5Hx.mjs";
2
2
  import { JsxChildren } from "@generaltranslation/format/types";
3
3
 
4
4
  //#region src/translation-functions/types/functions.d.ts
@@ -63,4 +63,4 @@ type TFunctionType = ((id: string, options?: DictionaryTranslationOptions) => st
63
63
  type ResolveJsxTranslationFunction = (locale: string, children: JsxChildren, options?: JsxTranslationOptions) => JsxChildren | undefined;
64
64
  //#endregion
65
65
  export { SyncResolutionFunction as a, ResolveJsxTranslationFunction as i, GTFunctionType as n, SyncResolutionFunctionWithFallback as o, MFunctionType as r, TFunctionType as s, DictionaryObjectTranslation as t };
66
- //# sourceMappingURL=functions-Dojd5CfY.d.mts.map
66
+ //# sourceMappingURL=functions-QaonTfxv.d.mts.map
@@ -1,4 +1,4 @@
1
- import { n as GTFunctionType, r as MFunctionType } from "./functions-Dojd5CfY.mjs";
1
+ import { n as GTFunctionType, r as MFunctionType } from "./functions-QaonTfxv.mjs";
2
2
 
3
3
  //#region src/translation-functions/fallbacks/gtFallback.d.ts
4
4
  /**
@@ -57,4 +57,4 @@ declare const gtFallback: GTFunctionType;
57
57
  declare const mFallback: MFunctionType;
58
58
  //#endregion
59
59
  export { gtFallback as n, mFallback as t };
60
- //# sourceMappingURL=index-B7BrS8Jn.d.mts.map
60
+ //# sourceMappingURL=index-CiVQJKIT.d.mts.map
@@ -1,4 +1,4 @@
1
- import { n as GTFunctionType, r as MFunctionType } from "./functions-DI1QpQoC.cjs";
1
+ import { n as GTFunctionType, r as MFunctionType } from "./functions-BPxoOb-T.cjs";
2
2
 
3
3
  //#region src/translation-functions/fallbacks/gtFallback.d.ts
4
4
  /**
@@ -57,4 +57,4 @@ declare const gtFallback: GTFunctionType;
57
57
  declare const mFallback: MFunctionType;
58
58
  //#endregion
59
59
  export { gtFallback as n, mFallback as t };
60
- //# sourceMappingURL=index-BLWcN0wI.d.cts.map
60
+ //# sourceMappingURL=index-DvPn0FyQ.d.cts.map
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_isEncodedTranslationOptions = require("./isEncodedTranslationOptions-eqrZWcmP.cjs");
3
- const require_versionId = require("./versionId-7sHbIIgr.cjs");
4
- const require_mFallback = require("./mFallback-DSBMUg3c.cjs");
2
+ const require_isEncodedTranslationOptions = require("./isEncodedTranslationOptions-B7rb2W7h.cjs");
3
+ const require_versionId = require("./versionId-DhTK9jpz.cjs");
4
+ const require_mFallback = require("./mFallback-DUDKkPGj.cjs");
5
5
  let generaltranslation_internal = require("generaltranslation/internal");
6
6
  let _generaltranslation_format = require("@generaltranslation/format");
7
7
  //#region src/translation-functions/t.ts
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { s as InlineTranslationOptions } from "./options-D0Lnxv2X.cjs";
2
- import { n as gtFallback, t as mFallback } from "./index-BLWcN0wI.cjs";
1
+ import { s as InlineTranslationOptions } from "./options-DltHK8u3.cjs";
2
+ import { n as gtFallback, t as mFallback } from "./index-DvPn0FyQ.cjs";
3
3
  import { t as RegisterableMessages } from "./message-C62MTLwE.cjs";
4
4
  import { a as getLocales, i as getLocaleProperties, n as getDefaultLocale, r as getLocale, t as getVersionId } from "./index-UDlCzB02.cjs";
5
5
  import { declareStatic, declareVar, decodeVars, derive } from "generaltranslation/internal";
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { s as InlineTranslationOptions } from "./options-CczghSzj.mjs";
2
- import { n as gtFallback, t as mFallback } from "./index-B7BrS8Jn.mjs";
1
+ import { s as InlineTranslationOptions } from "./options-Gk6vb5Hx.mjs";
2
+ import { n as gtFallback, t as mFallback } from "./index-CiVQJKIT.mjs";
3
3
  import { t as RegisterableMessages } from "./message-BN4DirTg.mjs";
4
4
  import { a as getLocales, i as getLocaleProperties, n as getDefaultLocale, r as getLocale, t as getVersionId } from "./index-Bc5qKE7T.mjs";
5
5
  import { declareStatic, declareVar, decodeVars, derive } from "generaltranslation/internal";
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { a as extractVariables, i as createInterpolationFailureMessage, n as decodeOptions, o as logger_default } from "./isEncodedTranslationOptions-BOwWa_-J.mjs";
2
- import { C as hashMessage, a as getLocales, d as resolveStringContentWithFallback, i as getLocaleProperties, m as getCurrentLocale, n as getDefaultLocale, r as getLocale, t as getVersionId } from "./versionId-BTjLA0FZ.mjs";
3
- import { n as gtFallback, r as decodeMsg, t as mFallback } from "./mFallback-pqVm9wDk.mjs";
1
+ import { a as extractVariables, i as createInterpolationFailureMessage, n as decodeOptions, o as logger_default } from "./isEncodedTranslationOptions-69ZmAUR2.mjs";
2
+ import { C as hashMessage, a as getLocales, d as resolveStringContentWithFallback, i as getLocaleProperties, m as getCurrentLocale, n as getDefaultLocale, r as getLocale, t as getVersionId } from "./versionId-C6FQLPr1.mjs";
3
+ import { n as gtFallback, r as decodeMsg, t as mFallback } from "./mFallback-B1u9ppFR.mjs";
4
4
  import { VAR_IDENTIFIER, declareStatic, declareVar, decodeVars, derive, encode, libraryDefaultLocale } from "generaltranslation/internal";
5
5
  import { formatMessage } from "@generaltranslation/format";
6
6
  //#region src/translation-functions/t.ts
@@ -1,4 +1,4 @@
1
- import { a as EncodedTranslationOptions, c as JsxTranslationOptions, d as ResolutionOptions, f as RuntimeTranslationOptions, i as DictionaryTranslationOptions, l as LookupOptions, n as DictionaryLookupOptions, o as InlineResolveOptions, r as DictionaryOptions, s as InlineTranslationOptions, t as BaseTranslationOptions, u as NormalizedLookupOptions } from "./options-D0Lnxv2X.cjs";
2
- import { a as ConditionStore, c as I18nManagerConfig, d as WritableConditionStore, f as GTConfig, l as I18nManagerConstructorParams, o as ConditionStoreConfig, p as RenderMethod, s as DictionaryConfig, t as LocaleCandidates, u as ScopedConditionStore } from "./localeResolver-BSGZjvxg.cjs";
3
- import { c as DictionaryEntry, d as DictionaryObject, f as DictionaryPath, i as LifecycleCallbacks, l as DictionaryKey, o as DictionaryLoader, p as DictionaryValue, s as Dictionary, t as TranslationsLoader, u as DictionaryLeaf } from "./types-BtGFavAy.cjs";
1
+ import { a as EncodedTranslationOptions, c as JsxTranslationOptions, d as ResolutionOptions, f as RuntimeTranslationOptions, i as DictionaryTranslationOptions, l as LookupOptions, n as DictionaryLookupOptions, o as InlineResolveOptions, r as DictionaryOptions, s as InlineTranslationOptions, t as BaseTranslationOptions, u as NormalizedLookupOptions } from "./options-DltHK8u3.cjs";
2
+ import { a as ConditionStore, c as I18nManagerConfig, d as WritableConditionStore, f as GTConfig, l as I18nManagerConstructorParams, o as ConditionStoreConfig, p as RenderMethod, s as DictionaryConfig, t as LocaleCandidates, u as ScopedConditionStore } from "./localeResolver-DEvF0xFF.cjs";
3
+ import { c as DictionaryEntry, d as DictionaryObject, f as DictionaryPath, i as LifecycleCallbacks, l as DictionaryKey, o as DictionaryLoader, p as DictionaryValue, s as Dictionary, t as TranslationsLoader, u as DictionaryLeaf } from "./types-W8aRF-m4.cjs";
4
4
  export { BaseTranslationOptions, type ConditionStore, type ConditionStoreConfig, type Dictionary, type DictionaryConfig, type DictionaryEntry, type DictionaryKey, type DictionaryLeaf, type DictionaryLoader, DictionaryLookupOptions, type DictionaryObject, type DictionaryOptions, type DictionaryPath, DictionaryTranslationOptions, type DictionaryValue, EncodedTranslationOptions, GTConfig, type I18nManagerConfig, type I18nManagerConstructorParams, InlineResolveOptions, InlineTranslationOptions, JsxTranslationOptions, type LifecycleCallbacks, type LocaleCandidates, LookupOptions, NormalizedLookupOptions, RenderMethod, ResolutionOptions, RuntimeTranslationOptions, type ScopedConditionStore, type TranslationsLoader, type WritableConditionStore };
@@ -1,4 +1,4 @@
1
- import { a as EncodedTranslationOptions, c as JsxTranslationOptions, d as ResolutionOptions, f as RuntimeTranslationOptions, i as DictionaryTranslationOptions, l as LookupOptions, n as DictionaryLookupOptions, o as InlineResolveOptions, r as DictionaryOptions, s as InlineTranslationOptions, t as BaseTranslationOptions, u as NormalizedLookupOptions } from "./options-CczghSzj.mjs";
2
- import { a as ConditionStore, c as I18nManagerConfig, d as WritableConditionStore, f as GTConfig, l as I18nManagerConstructorParams, o as ConditionStoreConfig, p as RenderMethod, s as DictionaryConfig, t as LocaleCandidates, u as ScopedConditionStore } from "./localeResolver-DjL1m1_w.mjs";
3
- import { c as DictionaryEntry, d as DictionaryObject, f as DictionaryPath, i as LifecycleCallbacks, l as DictionaryKey, o as DictionaryLoader, p as DictionaryValue, s as Dictionary, t as TranslationsLoader, u as DictionaryLeaf } from "./types-PZn6hXxt.mjs";
1
+ import { a as EncodedTranslationOptions, c as JsxTranslationOptions, d as ResolutionOptions, f as RuntimeTranslationOptions, i as DictionaryTranslationOptions, l as LookupOptions, n as DictionaryLookupOptions, o as InlineResolveOptions, r as DictionaryOptions, s as InlineTranslationOptions, t as BaseTranslationOptions, u as NormalizedLookupOptions } from "./options-Gk6vb5Hx.mjs";
2
+ import { a as ConditionStore, c as I18nManagerConfig, d as WritableConditionStore, f as GTConfig, l as I18nManagerConstructorParams, o as ConditionStoreConfig, p as RenderMethod, s as DictionaryConfig, t as LocaleCandidates, u as ScopedConditionStore } from "./localeResolver-BByzii-9.mjs";
3
+ import { c as DictionaryEntry, d as DictionaryObject, f as DictionaryPath, i as LifecycleCallbacks, l as DictionaryKey, o as DictionaryLoader, p as DictionaryValue, s as Dictionary, t as TranslationsLoader, u as DictionaryLeaf } from "./types-DWixkDmD.mjs";
4
4
  export { BaseTranslationOptions, type ConditionStore, type ConditionStoreConfig, type Dictionary, type DictionaryConfig, type DictionaryEntry, type DictionaryKey, type DictionaryLeaf, type DictionaryLoader, DictionaryLookupOptions, type DictionaryObject, type DictionaryOptions, type DictionaryPath, DictionaryTranslationOptions, type DictionaryValue, EncodedTranslationOptions, GTConfig, type I18nManagerConfig, type I18nManagerConstructorParams, InlineResolveOptions, InlineTranslationOptions, JsxTranslationOptions, type LifecycleCallbacks, type LocaleCandidates, LookupOptions, NormalizedLookupOptions, RenderMethod, ResolutionOptions, RuntimeTranslationOptions, type ScopedConditionStore, type TranslationsLoader, type WritableConditionStore };
package/dist/internal.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_isEncodedTranslationOptions = require("./isEncodedTranslationOptions-eqrZWcmP.cjs");
3
- const require_versionId = require("./versionId-7sHbIIgr.cjs");
2
+ const require_isEncodedTranslationOptions = require("./isEncodedTranslationOptions-B7rb2W7h.cjs");
3
+ const require_versionId = require("./versionId-DhTK9jpz.cjs");
4
4
  let generaltranslation_internal = require("generaltranslation/internal");
5
5
  let _generaltranslation_format = require("@generaltranslation/format");
6
6
  //#region src/translation-functions/internal/getGT.ts
@@ -1,8 +1,8 @@
1
- import { c as JsxTranslationOptions, d as ResolutionOptions, f as RuntimeTranslationOptions, l as LookupOptions, s as InlineTranslationOptions, u as NormalizedLookupOptions } from "./options-D0Lnxv2X.cjs";
2
- import { n as GTFunctionType, r as MFunctionType, s as TFunctionType } from "./functions-DI1QpQoC.cjs";
1
+ import { c as JsxTranslationOptions, d as ResolutionOptions, f as RuntimeTranslationOptions, l as LookupOptions, s as InlineTranslationOptions, u as NormalizedLookupOptions } from "./options-DltHK8u3.cjs";
2
+ import { n as GTFunctionType, r as MFunctionType, s as TFunctionType } from "./functions-BPxoOb-T.cjs";
3
3
  import { a as getLocales, i as getLocaleProperties, n as getDefaultLocale, r as getLocale, t as getVersionId } from "./index-UDlCzB02.cjs";
4
- import { a as ConditionStore, c as I18nManagerConfig, i as resolveSupportedLocale, l as I18nManagerConstructorParams, n as createLocaleResolver, r as determineSupportedLocale, t as LocaleCandidates } from "./localeResolver-BSGZjvxg.cjs";
5
- import { a as Locale, c as DictionaryEntry, d as DictionaryObject, f as DictionaryPath, m as Translation, n as Hash, p as DictionaryValue, s as Dictionary, t as TranslationsLoader } from "./types-BtGFavAy.cjs";
4
+ import { a as ConditionStore, c as I18nManagerConfig, i as resolveSupportedLocale, l as I18nManagerConstructorParams, n as createLocaleResolver, r as determineSupportedLocale, t as LocaleCandidates } from "./localeResolver-DEvF0xFF.cjs";
5
+ import { a as Locale, c as DictionaryEntry, d as DictionaryObject, f as DictionaryPath, m as Translation, n as Hash, p as DictionaryValue, s as Dictionary, t as TranslationsLoader } from "./types-W8aRF-m4.cjs";
6
6
  import { CustomMapping, DataFormat, JsxChildren, StringContent, StringFormat } from "@generaltranslation/format/types";
7
7
  import { GT } from "generaltranslation";
8
8
 
@@ -1,8 +1,8 @@
1
- import { c as JsxTranslationOptions, d as ResolutionOptions, f as RuntimeTranslationOptions, l as LookupOptions, s as InlineTranslationOptions, u as NormalizedLookupOptions } from "./options-CczghSzj.mjs";
2
- import { n as GTFunctionType, r as MFunctionType, s as TFunctionType } from "./functions-Dojd5CfY.mjs";
1
+ import { c as JsxTranslationOptions, d as ResolutionOptions, f as RuntimeTranslationOptions, l as LookupOptions, s as InlineTranslationOptions, u as NormalizedLookupOptions } from "./options-Gk6vb5Hx.mjs";
2
+ import { n as GTFunctionType, r as MFunctionType, s as TFunctionType } from "./functions-QaonTfxv.mjs";
3
3
  import { a as getLocales, i as getLocaleProperties, n as getDefaultLocale, r as getLocale, t as getVersionId } from "./index-Bc5qKE7T.mjs";
4
- import { a as ConditionStore, c as I18nManagerConfig, i as resolveSupportedLocale, l as I18nManagerConstructorParams, n as createLocaleResolver, r as determineSupportedLocale, t as LocaleCandidates } from "./localeResolver-DjL1m1_w.mjs";
5
- import { a as Locale, c as DictionaryEntry, d as DictionaryObject, f as DictionaryPath, m as Translation, n as Hash, p as DictionaryValue, s as Dictionary, t as TranslationsLoader } from "./types-PZn6hXxt.mjs";
4
+ import { a as ConditionStore, c as I18nManagerConfig, i as resolveSupportedLocale, l as I18nManagerConstructorParams, n as createLocaleResolver, r as determineSupportedLocale, t as LocaleCandidates } from "./localeResolver-BByzii-9.mjs";
5
+ import { a as Locale, c as DictionaryEntry, d as DictionaryObject, f as DictionaryPath, m as Translation, n as Hash, p as DictionaryValue, s as Dictionary, t as TranslationsLoader } from "./types-DWixkDmD.mjs";
6
6
  import { GT } from "generaltranslation";
7
7
  import { CustomMapping, DataFormat, JsxChildren, StringContent, StringFormat } from "@generaltranslation/format/types";
8
8
 
package/dist/internal.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { a as extractVariables, n as decodeOptions, r as interpolateIcuMessage, t as isEncodedTranslationOptions } from "./isEncodedTranslationOptions-BOwWa_-J.mjs";
2
- import { E as resolveDictionaryLookupOptions, S as TRANSLATIONS_CACHE_MISS_EVENT_NAME, T as isDictionaryObject, _ as setI18nManager, a as getLocales, b as LOCALES_CACHE_MISS_EVENT_NAME, c as resolveJsxWithFallback, d as resolveStringContentWithFallback, f as resolveStringContentWithRuntimeFallback, g as setConditionStore, h as getI18nManager, i as getLocaleProperties, l as resolveJsxWithRuntimeFallback, m as getCurrentLocale, n as getDefaultLocale, o as createLookupOptions, p as interpolateMessage, r as getLocale, s as resolveJsx, t as getVersionId, u as resolveStringContent, v as I18nManager, w as getDictionaryEntry, x as LOCALES_DICTIONARY_CACHE_MISS_EVENT_NAME, y as DICTIONARY_CACHE_MISS_EVENT_NAME } from "./versionId-BTjLA0FZ.mjs";
1
+ import { a as extractVariables, n as decodeOptions, r as interpolateIcuMessage, t as isEncodedTranslationOptions } from "./isEncodedTranslationOptions-69ZmAUR2.mjs";
2
+ import { E as resolveDictionaryLookupOptions, S as TRANSLATIONS_CACHE_MISS_EVENT_NAME, T as isDictionaryObject, _ as setI18nManager, a as getLocales, b as LOCALES_CACHE_MISS_EVENT_NAME, c as resolveJsxWithFallback, d as resolveStringContentWithFallback, f as resolveStringContentWithRuntimeFallback, g as setConditionStore, h as getI18nManager, i as getLocaleProperties, l as resolveJsxWithRuntimeFallback, m as getCurrentLocale, n as getDefaultLocale, o as createLookupOptions, p as interpolateMessage, r as getLocale, s as resolveJsx, t as getVersionId, u as resolveStringContent, v as I18nManager, w as getDictionaryEntry, x as LOCALES_DICTIONARY_CACHE_MISS_EVENT_NAME, y as DICTIONARY_CACHE_MISS_EVENT_NAME } from "./versionId-C6FQLPr1.mjs";
3
3
  import { libraryDefaultLocale } from "generaltranslation/internal";
4
4
  import { LocaleConfig } from "@generaltranslation/format";
5
5
  //#region src/translation-functions/internal/getGT.ts
@@ -24,7 +24,7 @@ var logger_default = {
24
24
  * TODO: next major version, options should be Record<string, string>
25
25
  */
26
26
  function extractVariables(options) {
27
- return Object.fromEntries(Object.entries(options).filter(([key]) => key !== "$id" && key !== "$context" && key !== "$maxChars" && key !== "$hash" && key !== "$_hash" && key !== "$_source" && key !== "$_fallback" && key !== "$format" && key !== "$_locales" && key !== "$locale"));
27
+ return Object.fromEntries(Object.entries(options).filter(([key]) => key !== "$id" && key !== "$context" && key !== "$maxChars" && key !== "$hash" && key !== "$_hash" && key !== "$_source" && key !== "$_fallback" && key !== "$format" && key !== "$_locales" && key !== "$locale" && key !== "$requiresReview"));
28
28
  }
29
29
  //#endregion
30
30
  //#region src/translation-functions/utils/messages.ts
@@ -106,4 +106,4 @@ function isEncodedTranslationOptions(decodedOptions) {
106
106
  //#endregion
107
107
  export { extractVariables as a, createInterpolationFailureMessage as i, decodeOptions as n, logger_default as o, interpolateIcuMessage as r, isEncodedTranslationOptions as t };
108
108
 
109
- //# sourceMappingURL=isEncodedTranslationOptions-BOwWa_-J.mjs.map
109
+ //# sourceMappingURL=isEncodedTranslationOptions-69ZmAUR2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isEncodedTranslationOptions-69ZmAUR2.mjs","names":["formatMessage","_formatMessage","formatMessage"],"sources":["../src/logs/logger.ts","../src/utils/extractVariables.ts","../src/translation-functions/utils/messages.ts","../src/translation-functions/utils/formatMessage.ts","../src/translation-functions/utils/interpolation/interpolateIcuMessage.ts","../src/translation-functions/msg/decodeOptions.ts","../src/translation-functions/utils/isEncodedTranslationOptions.ts"],"sourcesContent":["export default {\n warn(message: string) {\n console.warn(message);\n },\n\n error(message: string) {\n console.error(message);\n },\n\n info(message: string) {\n // eslint-disable-next-line no-console\n console.info(message);\n },\n\n debug(message: string) {\n // eslint-disable-next-line no-console\n console.debug(message);\n },\n};\n","import { BaseTranslationOptions } from '../translation-functions/types/options';\n/**\n * Given an object of options, returns an object with no gt-related options\n *\n * TODO: next major version, this should extract any sugar syntax options\n * TODO: next major version, options should be Record<string, string>\n */\nexport function extractVariables<T extends BaseTranslationOptions>(\n options: T\n): BaseTranslationOptions {\n return Object.fromEntries(\n Object.entries(options).filter(\n ([key]) =>\n key !== '$id' &&\n key !== '$context' &&\n key !== '$maxChars' &&\n key !== '$hash' && // this is already being done in @gt/react-core\n key !== '$_hash' &&\n key !== '$_source' &&\n key !== '$_fallback' &&\n key !== '$format' &&\n key !== '$_locales' &&\n key !== '$locale' &&\n key !== '$requiresReview'\n )\n );\n}\n","export const createInterpolationFailureMessage = (message: string) =>\n `String interpolation failed for message: \"${message}\".`;\n","import type { StringFormat } from '@generaltranslation/format/types';\nimport logger from '../../logs/logger';\nimport { createInterpolationFailureMessage } from './messages';\nimport { formatMessage as _formatMessage } from '@generaltranslation/format';\n\n/**\n * Given an encoded message and variables, formats the message.\n * On error, the original encoded message is returned with a warning.\n * @param encodedMsg\n * @param variables\n * @returns\n */\nexport function formatMessage(\n encodedMsg: string,\n variables: Record<string, string>,\n locales?: string | string[],\n dataFormat?: StringFormat\n): string {\n try {\n return _formatMessage(encodedMsg, { variables, locales, dataFormat });\n } catch {\n logger.warn(createInterpolationFailureMessage(encodedMsg));\n return encodedMsg;\n }\n}\n","import { extractVariables } from '../../../utils/extractVariables';\nimport { formatMessage } from '../formatMessage';\nimport {\n VAR_IDENTIFIER,\n extractVars,\n condenseVars,\n} from 'generaltranslation/internal';\nimport { formatCutoff } from '@generaltranslation/format';\nimport logger from '../../../logs/logger';\nimport { createInterpolationFailureMessage } from '../messages';\nimport type { InlineTranslationOptions } from '../../types/options';\n\n/**\n * Applies string interpolation and cutoff formatting. Fallsback to the original message if interpolation fails.\n * @param {string} message - The message to interpolate.\n * @param {InlineTranslationOptions} options - The options to interpolate.\n * @returns {string} - The interpolated message.\n */\nexport function interpolateIcuMessage<T extends string | null | undefined>(\n encodedMsg: T,\n options: InlineTranslationOptions\n): T extends string ? string : T {\n // Return if the encoded message is null or undefined\n if (!encodedMsg) return encodedMsg as T extends string ? string : T;\n\n // Get the source to use as a fallback\n const source = options.$_fallback;\n\n // Remove any gt related options\n const variables = extractVariables(options);\n\n try {\n // Extract declared variable values from the source/fallback\n const declaredVars = extractVars(source || '');\n\n // Condense indexed selects to arguments if declared vars exist\n const message = Object.keys(declaredVars).length\n ? condenseVars(encodedMsg)\n : encodedMsg;\n\n // Interpolate the message\n const interpolatedMessage = formatMessage(\n message,\n {\n ...variables,\n ...declaredVars,\n [VAR_IDENTIFIER]: 'other',\n },\n options.$locale ?? options.$_locales,\n options.$format\n );\n // Apply cutoff formatting\n const cutoffMessage = formatCutoff(interpolatedMessage, {\n maxChars: options.$maxChars,\n });\n return cutoffMessage as T extends string ? string : T;\n } catch {\n logger.warn(createInterpolationFailureMessage(encodedMsg));\n\n // If formatting the translation failed and we have a fallback, try formatting the source instead\n if (options.$_fallback != null) {\n return interpolateIcuMessage(options.$_fallback, {\n ...options,\n $_fallback: undefined,\n }) as T extends string ? string : T;\n }\n\n // Apply cutoff formatting\n const cutoffMessage = formatCutoff(encodedMsg, {\n maxChars: options.$maxChars,\n });\n return cutoffMessage as T extends string ? string : T;\n }\n}\n","import { decode } from 'generaltranslation/internal';\nimport type { InlineTranslationOptions } from '../types/options';\n\n/**\n * Decodes the options from an encoded message.\n * @param encodedMsg The message to decode.\n * @returns The decoded options.\n */\nexport function decodeOptions(\n encodedMsg: string\n): InlineTranslationOptions | null {\n if (encodedMsg.lastIndexOf(':') === -1) {\n return null;\n }\n\n // Extract encoded options\n const optionsEncoding = encodedMsg.slice(encodedMsg.lastIndexOf(':') + 1);\n\n try {\n // Parse options\n const options = JSON.parse(decode(optionsEncoding));\n return options;\n } catch {\n return null;\n }\n}\n","import { EncodedTranslationOptions } from '../types/options';\n\n/**\n * Given a decoded options object, validate that includes required decoded options\n * These required options are added by msg() during the encoding process.\n */\nexport function isEncodedTranslationOptions(\n decodedOptions: Record<string, unknown> // TODO: next major version, this should be Record<string, string>\n): decodedOptions is EncodedTranslationOptions {\n return !!(decodedOptions.$_hash && decodedOptions.$_source);\n}\n"],"mappings":";;;AAAA,IAAA,iBAAe;CACb,KAAK,SAAiB;AACpB,UAAQ,KAAK,QAAQ;;CAGvB,MAAM,SAAiB;AACrB,UAAQ,MAAM,QAAQ;;CAGxB,KAAK,SAAiB;AAEpB,UAAQ,KAAK,QAAQ;;CAGvB,MAAM,SAAiB;AAErB,UAAQ,MAAM,QAAQ;;CAEzB;;;;;;;;;ACXD,SAAgB,iBACd,SACwB;AACxB,QAAO,OAAO,YACZ,OAAO,QAAQ,QAAQ,CAAC,QACrB,CAAC,SACA,QAAQ,SACR,QAAQ,cACR,QAAQ,eACR,QAAQ,WACR,QAAQ,YACR,QAAQ,cACR,QAAQ,gBACR,QAAQ,aACR,QAAQ,eACR,QAAQ,aACR,QAAQ,kBACX,CACF;;;;ACzBH,MAAa,qCAAqC,YAChD,6CAA6C,QAAQ;;;;;;;;;;ACWvD,SAAgBA,gBACd,YACA,WACA,SACA,YACQ;AACR,KAAI;AACF,SAAOC,cAAe,YAAY;GAAE;GAAW;GAAS;GAAY,CAAC;SAC/D;AACN,iBAAO,KAAK,kCAAkC,WAAW,CAAC;AAC1D,SAAO;;;;;;;;;;;ACJX,SAAgB,sBACd,YACA,SAC+B;AAE/B,KAAI,CAAC,WAAY,QAAO;CAGxB,MAAM,SAAS,QAAQ;CAGvB,MAAM,YAAY,iBAAiB,QAAQ;AAE3C,KAAI;EAEF,MAAM,eAAe,YAAY,UAAU,GAAG;AAsB9C,SAHsB,aAXMC,gBALZ,OAAO,KAAK,aAAa,CAAC,SACtC,aAAa,WAAW,GACxB,YAKF;GACE,GAAG;GACH,GAAG;IACF,iBAAiB;GACnB,EACD,QAAQ,WAAW,QAAQ,WAC3B,QAAQ,QAG4C,EAAE,EACtD,UAAU,QAAQ,WACnB,CACmB;SACd;AACN,iBAAO,KAAK,kCAAkC,WAAW,CAAC;AAG1D,MAAI,QAAQ,cAAc,KACxB,QAAO,sBAAsB,QAAQ,YAAY;GAC/C,GAAG;GACH,YAAY,KAAA;GACb,CAAC;AAOJ,SAHsB,aAAa,YAAY,EAC7C,UAAU,QAAQ,WACnB,CACmB;;;;;;;;;;AC/DxB,SAAgB,cACd,YACiC;AACjC,KAAI,WAAW,YAAY,IAAI,KAAK,GAClC,QAAO;CAIT,MAAM,kBAAkB,WAAW,MAAM,WAAW,YAAY,IAAI,GAAG,EAAE;AAEzE,KAAI;AAGF,SADgB,KAAK,MAAM,OAAO,gBAAgB,CACpC;SACR;AACN,SAAO;;;;;;;;;ACjBX,SAAgB,4BACd,gBAC6C;AAC7C,QAAO,CAAC,EAAE,eAAe,UAAU,eAAe"}
@@ -24,7 +24,7 @@ var logger_default = {
24
24
  * TODO: next major version, options should be Record<string, string>
25
25
  */
26
26
  function extractVariables(options) {
27
- return Object.fromEntries(Object.entries(options).filter(([key]) => key !== "$id" && key !== "$context" && key !== "$maxChars" && key !== "$hash" && key !== "$_hash" && key !== "$_source" && key !== "$_fallback" && key !== "$format" && key !== "$_locales" && key !== "$locale"));
27
+ return Object.fromEntries(Object.entries(options).filter(([key]) => key !== "$id" && key !== "$context" && key !== "$maxChars" && key !== "$hash" && key !== "$_hash" && key !== "$_source" && key !== "$_fallback" && key !== "$format" && key !== "$_locales" && key !== "$locale" && key !== "$requiresReview"));
28
28
  }
29
29
  //#endregion
30
30
  //#region src/translation-functions/utils/messages.ts
@@ -141,4 +141,4 @@ Object.defineProperty(exports, "logger_default", {
141
141
  }
142
142
  });
143
143
 
144
- //# sourceMappingURL=isEncodedTranslationOptions-eqrZWcmP.cjs.map
144
+ //# sourceMappingURL=isEncodedTranslationOptions-B7rb2W7h.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isEncodedTranslationOptions-B7rb2W7h.cjs","names":["VAR_IDENTIFIER"],"sources":["../src/logs/logger.ts","../src/utils/extractVariables.ts","../src/translation-functions/utils/messages.ts","../src/translation-functions/utils/formatMessage.ts","../src/translation-functions/utils/interpolation/interpolateIcuMessage.ts","../src/translation-functions/msg/decodeOptions.ts","../src/translation-functions/utils/isEncodedTranslationOptions.ts"],"sourcesContent":["export default {\n warn(message: string) {\n console.warn(message);\n },\n\n error(message: string) {\n console.error(message);\n },\n\n info(message: string) {\n // eslint-disable-next-line no-console\n console.info(message);\n },\n\n debug(message: string) {\n // eslint-disable-next-line no-console\n console.debug(message);\n },\n};\n","import { BaseTranslationOptions } from '../translation-functions/types/options';\n/**\n * Given an object of options, returns an object with no gt-related options\n *\n * TODO: next major version, this should extract any sugar syntax options\n * TODO: next major version, options should be Record<string, string>\n */\nexport function extractVariables<T extends BaseTranslationOptions>(\n options: T\n): BaseTranslationOptions {\n return Object.fromEntries(\n Object.entries(options).filter(\n ([key]) =>\n key !== '$id' &&\n key !== '$context' &&\n key !== '$maxChars' &&\n key !== '$hash' && // this is already being done in @gt/react-core\n key !== '$_hash' &&\n key !== '$_source' &&\n key !== '$_fallback' &&\n key !== '$format' &&\n key !== '$_locales' &&\n key !== '$locale' &&\n key !== '$requiresReview'\n )\n );\n}\n","export const createInterpolationFailureMessage = (message: string) =>\n `String interpolation failed for message: \"${message}\".`;\n","import type { StringFormat } from '@generaltranslation/format/types';\nimport logger from '../../logs/logger';\nimport { createInterpolationFailureMessage } from './messages';\nimport { formatMessage as _formatMessage } from '@generaltranslation/format';\n\n/**\n * Given an encoded message and variables, formats the message.\n * On error, the original encoded message is returned with a warning.\n * @param encodedMsg\n * @param variables\n * @returns\n */\nexport function formatMessage(\n encodedMsg: string,\n variables: Record<string, string>,\n locales?: string | string[],\n dataFormat?: StringFormat\n): string {\n try {\n return _formatMessage(encodedMsg, { variables, locales, dataFormat });\n } catch {\n logger.warn(createInterpolationFailureMessage(encodedMsg));\n return encodedMsg;\n }\n}\n","import { extractVariables } from '../../../utils/extractVariables';\nimport { formatMessage } from '../formatMessage';\nimport {\n VAR_IDENTIFIER,\n extractVars,\n condenseVars,\n} from 'generaltranslation/internal';\nimport { formatCutoff } from '@generaltranslation/format';\nimport logger from '../../../logs/logger';\nimport { createInterpolationFailureMessage } from '../messages';\nimport type { InlineTranslationOptions } from '../../types/options';\n\n/**\n * Applies string interpolation and cutoff formatting. Fallsback to the original message if interpolation fails.\n * @param {string} message - The message to interpolate.\n * @param {InlineTranslationOptions} options - The options to interpolate.\n * @returns {string} - The interpolated message.\n */\nexport function interpolateIcuMessage<T extends string | null | undefined>(\n encodedMsg: T,\n options: InlineTranslationOptions\n): T extends string ? string : T {\n // Return if the encoded message is null or undefined\n if (!encodedMsg) return encodedMsg as T extends string ? string : T;\n\n // Get the source to use as a fallback\n const source = options.$_fallback;\n\n // Remove any gt related options\n const variables = extractVariables(options);\n\n try {\n // Extract declared variable values from the source/fallback\n const declaredVars = extractVars(source || '');\n\n // Condense indexed selects to arguments if declared vars exist\n const message = Object.keys(declaredVars).length\n ? condenseVars(encodedMsg)\n : encodedMsg;\n\n // Interpolate the message\n const interpolatedMessage = formatMessage(\n message,\n {\n ...variables,\n ...declaredVars,\n [VAR_IDENTIFIER]: 'other',\n },\n options.$locale ?? options.$_locales,\n options.$format\n );\n // Apply cutoff formatting\n const cutoffMessage = formatCutoff(interpolatedMessage, {\n maxChars: options.$maxChars,\n });\n return cutoffMessage as T extends string ? string : T;\n } catch {\n logger.warn(createInterpolationFailureMessage(encodedMsg));\n\n // If formatting the translation failed and we have a fallback, try formatting the source instead\n if (options.$_fallback != null) {\n return interpolateIcuMessage(options.$_fallback, {\n ...options,\n $_fallback: undefined,\n }) as T extends string ? string : T;\n }\n\n // Apply cutoff formatting\n const cutoffMessage = formatCutoff(encodedMsg, {\n maxChars: options.$maxChars,\n });\n return cutoffMessage as T extends string ? string : T;\n }\n}\n","import { decode } from 'generaltranslation/internal';\nimport type { InlineTranslationOptions } from '../types/options';\n\n/**\n * Decodes the options from an encoded message.\n * @param encodedMsg The message to decode.\n * @returns The decoded options.\n */\nexport function decodeOptions(\n encodedMsg: string\n): InlineTranslationOptions | null {\n if (encodedMsg.lastIndexOf(':') === -1) {\n return null;\n }\n\n // Extract encoded options\n const optionsEncoding = encodedMsg.slice(encodedMsg.lastIndexOf(':') + 1);\n\n try {\n // Parse options\n const options = JSON.parse(decode(optionsEncoding));\n return options;\n } catch {\n return null;\n }\n}\n","import { EncodedTranslationOptions } from '../types/options';\n\n/**\n * Given a decoded options object, validate that includes required decoded options\n * These required options are added by msg() during the encoding process.\n */\nexport function isEncodedTranslationOptions(\n decodedOptions: Record<string, unknown> // TODO: next major version, this should be Record<string, string>\n): decodedOptions is EncodedTranslationOptions {\n return !!(decodedOptions.$_hash && decodedOptions.$_source);\n}\n"],"mappings":";;;AAAA,IAAA,iBAAe;CACb,KAAK,SAAiB;AACpB,UAAQ,KAAK,QAAQ;;CAGvB,MAAM,SAAiB;AACrB,UAAQ,MAAM,QAAQ;;CAGxB,KAAK,SAAiB;AAEpB,UAAQ,KAAK,QAAQ;;CAGvB,MAAM,SAAiB;AAErB,UAAQ,MAAM,QAAQ;;CAEzB;;;;;;;;;ACXD,SAAgB,iBACd,SACwB;AACxB,QAAO,OAAO,YACZ,OAAO,QAAQ,QAAQ,CAAC,QACrB,CAAC,SACA,QAAQ,SACR,QAAQ,cACR,QAAQ,eACR,QAAQ,WACR,QAAQ,YACR,QAAQ,cACR,QAAQ,gBACR,QAAQ,aACR,QAAQ,eACR,QAAQ,aACR,QAAQ,kBACX,CACF;;;;ACzBH,MAAa,qCAAqC,YAChD,6CAA6C,QAAQ;;;;;;;;;;ACWvD,SAAgB,cACd,YACA,WACA,SACA,YACQ;AACR,KAAI;AACF,UAAA,GAAA,2BAAA,eAAsB,YAAY;GAAE;GAAW;GAAS;GAAY,CAAC;SAC/D;AACN,iBAAO,KAAK,kCAAkC,WAAW,CAAC;AAC1D,SAAO;;;;;;;;;;;ACJX,SAAgB,sBACd,YACA,SAC+B;AAE/B,KAAI,CAAC,WAAY,QAAO;CAGxB,MAAM,SAAS,QAAQ;CAGvB,MAAM,YAAY,iBAAiB,QAAQ;AAE3C,KAAI;EAEF,MAAM,gBAAA,GAAA,4BAAA,aAA2B,UAAU,GAAG;AAsB9C,UAAA,GAAA,2BAAA,cAd4B,cALZ,OAAO,KAAK,aAAa,CAAC,UAAA,GAAA,4BAAA,cACzB,WAAW,GACxB,YAKF;GACE,GAAG;GACH,GAAG;IACFA,4BAAAA,iBAAiB;GACnB,EACD,QAAQ,WAAW,QAAQ,WAC3B,QAAQ,QAG4C,EAAE,EACtD,UAAU,QAAQ,WACnB,CACmB;SACd;AACN,iBAAO,KAAK,kCAAkC,WAAW,CAAC;AAG1D,MAAI,QAAQ,cAAc,KACxB,QAAO,sBAAsB,QAAQ,YAAY;GAC/C,GAAG;GACH,YAAY,KAAA;GACb,CAAC;AAOJ,UAAA,GAAA,2BAAA,cAHmC,YAAY,EAC7C,UAAU,QAAQ,WACnB,CACmB;;;;;;;;;;AC/DxB,SAAgB,cACd,YACiC;AACjC,KAAI,WAAW,YAAY,IAAI,KAAK,GAClC,QAAO;CAIT,MAAM,kBAAkB,WAAW,MAAM,WAAW,YAAY,IAAI,GAAG,EAAE;AAEzE,KAAI;AAGF,SADgB,KAAK,OAAA,GAAA,4BAAA,QAAa,gBAAgB,CACpC;SACR;AACN,SAAO;;;;;;;;;ACjBX,SAAgB,4BACd,gBAC6C;AAC7C,QAAO,CAAC,EAAE,eAAe,UAAU,eAAe"}
@@ -1,6 +1,6 @@
1
- import { i as LifecycleCallbacks, m as Translation, o as DictionaryLoader, r as TranslationBatchConfig, s as Dictionary, t as TranslationsLoader } from "./types-BtGFavAy.cjs";
2
- import { CustomMapping } from "@generaltranslation/format/types";
1
+ import { i as LifecycleCallbacks, m as Translation, o as DictionaryLoader, r as TranslationBatchConfig, s as Dictionary, t as TranslationsLoader } from "./types-DWixkDmD.mjs";
3
2
  import { RuntimeTranslateManyOptions } from "generaltranslation/internal";
3
+ import { CustomMapping } from "@generaltranslation/format/types";
4
4
 
5
5
  //#region src/config/types.d.ts
6
6
  /**
@@ -149,4 +149,4 @@ declare function resolveSupportedLocale(candidates: LocaleCandidates, config?: C
149
149
  declare function createLocaleResolver(config?: ConditionStoreConfig): (candidates?: LocaleCandidates) => string;
150
150
  //#endregion
151
151
  export { ConditionStore as a, I18nManagerConfig as c, WritableConditionStore as d, GTConfig as f, resolveSupportedLocale as i, I18nManagerConstructorParams as l, createLocaleResolver as n, ConditionStoreConfig as o, RenderMethod as p, determineSupportedLocale as r, DictionaryConfig as s, LocaleCandidates as t, ScopedConditionStore as u };
152
- //# sourceMappingURL=localeResolver-BSGZjvxg.d.cts.map
152
+ //# sourceMappingURL=localeResolver-BByzii-9.d.mts.map
@@ -1,6 +1,6 @@
1
- import { i as LifecycleCallbacks, m as Translation, o as DictionaryLoader, r as TranslationBatchConfig, s as Dictionary, t as TranslationsLoader } from "./types-PZn6hXxt.mjs";
2
- import { RuntimeTranslateManyOptions } from "generaltranslation/internal";
1
+ import { i as LifecycleCallbacks, m as Translation, o as DictionaryLoader, r as TranslationBatchConfig, s as Dictionary, t as TranslationsLoader } from "./types-W8aRF-m4.cjs";
3
2
  import { CustomMapping } from "@generaltranslation/format/types";
3
+ import { RuntimeTranslateManyOptions } from "generaltranslation/internal";
4
4
 
5
5
  //#region src/config/types.d.ts
6
6
  /**
@@ -149,4 +149,4 @@ declare function resolveSupportedLocale(candidates: LocaleCandidates, config?: C
149
149
  declare function createLocaleResolver(config?: ConditionStoreConfig): (candidates?: LocaleCandidates) => string;
150
150
  //#endregion
151
151
  export { ConditionStore as a, I18nManagerConfig as c, WritableConditionStore as d, GTConfig as f, resolveSupportedLocale as i, I18nManagerConstructorParams as l, createLocaleResolver as n, ConditionStoreConfig as o, RenderMethod as p, determineSupportedLocale as r, DictionaryConfig as s, LocaleCandidates as t, ScopedConditionStore as u };
152
- //# sourceMappingURL=localeResolver-DjL1m1_w.d.mts.map
152
+ //# sourceMappingURL=localeResolver-DEvF0xFF.d.cts.map
@@ -1,4 +1,4 @@
1
- import { n as decodeOptions, r as interpolateIcuMessage, t as isEncodedTranslationOptions } from "./isEncodedTranslationOptions-BOwWa_-J.mjs";
1
+ import { n as decodeOptions, r as interpolateIcuMessage, t as isEncodedTranslationOptions } from "./isEncodedTranslationOptions-69ZmAUR2.mjs";
2
2
  //#region src/translation-functions/msg/decodeMsg.ts
3
3
  function decodeMsg(encodedMsg) {
4
4
  if (typeof encodedMsg === "string" && encodedMsg.lastIndexOf(":") !== -1) return encodedMsg.slice(0, encodedMsg.lastIndexOf(":"));
@@ -69,4 +69,4 @@ const mFallback = (encodedMsg, options = {}) => {
69
69
  //#endregion
70
70
  export { gtFallback as n, decodeMsg as r, mFallback as t };
71
71
 
72
- //# sourceMappingURL=mFallback-pqVm9wDk.mjs.map
72
+ //# sourceMappingURL=mFallback-B1u9ppFR.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mFallback-pqVm9wDk.mjs","names":[],"sources":["../src/translation-functions/msg/decodeMsg.ts","../src/translation-functions/fallbacks/gtFallback.ts","../src/translation-functions/fallbacks/mFallback.ts"],"sourcesContent":["/**\n * Extracts the original interpolated message string.\n * If the message cannot be decoded (i.e., it does not contain a colon separator),\n * the input is returned as-is.\n * @param encodedMsg The message to decode.\n * @returns The decoded message, or the input if it cannot be decoded.\n */\nexport function decodeMsg(encodedMsg: string): string;\nexport function decodeMsg<T extends null | undefined>(encodedMsg: T): T;\nexport function decodeMsg<T extends string | null | undefined>(\n encodedMsg: T\n): T extends string ? string : T;\nexport function decodeMsg<T extends string | null | undefined>(\n encodedMsg: T\n): string | T {\n if (typeof encodedMsg === 'string' && encodedMsg.lastIndexOf(':') !== -1) {\n return encodedMsg.slice(0, encodedMsg.lastIndexOf(':'));\n }\n return encodedMsg;\n}\n","import { InlineTranslationOptions } from '../types/options';\nimport { GTFunctionType } from '../types/functions';\nimport { interpolateIcuMessage } from '../utils/interpolation/interpolateIcuMessage';\n\n/**\n * A fallback function for the gt() function that decodes and interpolates.\n * @param {string | null | undefined} message - The ICU formatted message to interpolate.\n * @param {InlineTranslationOptions} options - The options to interpolate.\n * @returns - The decoded and interpolated message.\n *\n * @note This function is useful as a placeholder when for incrementally migrating to the m() function.\n * @example\n * // A backwards compatible translation function\n * function getMessage(gt: GTFunctionType = gtFallback) {\n * return gt('Hello, world!');\n * }\n *\n * // Here i18n has been implemented\n * function WithTranslation() {\n * const gt = useGT();\n * return <>{getMessage(gt)}</>;\n * }\n *\n *\n * // i18n has not yet been implemented yet\n * function WithoutTranslations() {\n * return <>{getMessage()}</>;\n * }\n */\nexport const gtFallback: GTFunctionType = <T extends string | null | undefined>(\n message: T,\n options: InlineTranslationOptions = {}\n): T extends string ? string : T => {\n return interpolateIcuMessage(message, options);\n};\n","import { decodeMsg } from '../msg/decodeMsg';\nimport { InlineResolveOptions } from '../types/options';\nimport { MFunctionType } from '../types/functions';\nimport { decodeOptions } from '../msg/decodeOptions';\nimport { isEncodedTranslationOptions } from '../utils/isEncodedTranslationOptions';\nimport { interpolateIcuMessage } from '../utils/interpolation/interpolateIcuMessage';\n\n/**\n * A fallback function for the m() function that decodes and interpolates.\n * @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.\n * @param {InlineTranslationOptions} options - The options to interpolate.\n * @returns - The decoded and interpolated message.\n *\n * @note This function is useful as a placeholder when for incrementally migrating to the m() function.\n * @example\n * // A backwards compatible translation function\n * function getMessage(m: MFunctionType = mFallback) {\n * return m(msg('Hello, world!'));\n * }\n *\n * // Here i18n has been implemented\n * function WithTranslation() {\n * const m = useMessages();\n * return <>{getMessage(m)}</>;\n * }\n *\n *\n * // i18n has not yet been implemented yet\n * function WithoutTranslations() {\n * return <>{getMessage()}</>;\n * }\n */\nexport const mFallback: MFunctionType = <T extends string | null | undefined>(\n encodedMsg: T,\n options: InlineResolveOptions = {}\n): T extends string ? string : T => {\n // Return if the encoded message is null or undefined\n if (!encodedMsg) return encodedMsg as T extends string ? string : T;\n\n // Get any encoded options\n const decodedOptions = decodeOptions(encodedMsg) ?? {};\n\n // Return early if string already interpolated eg: mFallback(msg('Hello, {name}!', { name: 'Brian' }))\n if (isEncodedTranslationOptions(decodedOptions)) {\n // This is an encoded string, msg already interpolated, just return decoded string\n return decodeMsg(encodedMsg) as T extends string ? string : T;\n }\n\n // Not using decoded options to match behavior in @gt/react-core\n return interpolateIcuMessage(encodedMsg, options);\n};\n"],"mappings":";;AAYA,SAAgB,UACd,YACY;AACZ,KAAI,OAAO,eAAe,YAAY,WAAW,YAAY,IAAI,KAAK,GACpE,QAAO,WAAW,MAAM,GAAG,WAAW,YAAY,IAAI,CAAC;AAEzD,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACWT,MAAa,cACX,SACA,UAAoC,EAAE,KACJ;AAClC,QAAO,sBAAsB,SAAS,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACDhD,MAAa,aACX,YACA,UAAgC,EAAE,KACA;AAElC,KAAI,CAAC,WAAY,QAAO;AAMxB,KAAI,4BAHmB,cAAc,WAAW,IAAI,EAAE,CAGP,CAE7C,QAAO,UAAU,WAAW;AAI9B,QAAO,sBAAsB,YAAY,QAAQ"}
1
+ {"version":3,"file":"mFallback-B1u9ppFR.mjs","names":[],"sources":["../src/translation-functions/msg/decodeMsg.ts","../src/translation-functions/fallbacks/gtFallback.ts","../src/translation-functions/fallbacks/mFallback.ts"],"sourcesContent":["/**\n * Extracts the original interpolated message string.\n * If the message cannot be decoded (i.e., it does not contain a colon separator),\n * the input is returned as-is.\n * @param encodedMsg The message to decode.\n * @returns The decoded message, or the input if it cannot be decoded.\n */\nexport function decodeMsg(encodedMsg: string): string;\nexport function decodeMsg<T extends null | undefined>(encodedMsg: T): T;\nexport function decodeMsg<T extends string | null | undefined>(\n encodedMsg: T\n): T extends string ? string : T;\nexport function decodeMsg<T extends string | null | undefined>(\n encodedMsg: T\n): string | T {\n if (typeof encodedMsg === 'string' && encodedMsg.lastIndexOf(':') !== -1) {\n return encodedMsg.slice(0, encodedMsg.lastIndexOf(':'));\n }\n return encodedMsg;\n}\n","import { InlineTranslationOptions } from '../types/options';\nimport { GTFunctionType } from '../types/functions';\nimport { interpolateIcuMessage } from '../utils/interpolation/interpolateIcuMessage';\n\n/**\n * A fallback function for the gt() function that decodes and interpolates.\n * @param {string | null | undefined} message - The ICU formatted message to interpolate.\n * @param {InlineTranslationOptions} options - The options to interpolate.\n * @returns - The decoded and interpolated message.\n *\n * @note This function is useful as a placeholder when for incrementally migrating to the m() function.\n * @example\n * // A backwards compatible translation function\n * function getMessage(gt: GTFunctionType = gtFallback) {\n * return gt('Hello, world!');\n * }\n *\n * // Here i18n has been implemented\n * function WithTranslation() {\n * const gt = useGT();\n * return <>{getMessage(gt)}</>;\n * }\n *\n *\n * // i18n has not yet been implemented yet\n * function WithoutTranslations() {\n * return <>{getMessage()}</>;\n * }\n */\nexport const gtFallback: GTFunctionType = <T extends string | null | undefined>(\n message: T,\n options: InlineTranslationOptions = {}\n): T extends string ? string : T => {\n return interpolateIcuMessage(message, options);\n};\n","import { decodeMsg } from '../msg/decodeMsg';\nimport { InlineResolveOptions } from '../types/options';\nimport { MFunctionType } from '../types/functions';\nimport { decodeOptions } from '../msg/decodeOptions';\nimport { isEncodedTranslationOptions } from '../utils/isEncodedTranslationOptions';\nimport { interpolateIcuMessage } from '../utils/interpolation/interpolateIcuMessage';\n\n/**\n * A fallback function for the m() function that decodes and interpolates.\n * @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.\n * @param {InlineTranslationOptions} options - The options to interpolate.\n * @returns - The decoded and interpolated message.\n *\n * @note This function is useful as a placeholder when for incrementally migrating to the m() function.\n * @example\n * // A backwards compatible translation function\n * function getMessage(m: MFunctionType = mFallback) {\n * return m(msg('Hello, world!'));\n * }\n *\n * // Here i18n has been implemented\n * function WithTranslation() {\n * const m = useMessages();\n * return <>{getMessage(m)}</>;\n * }\n *\n *\n * // i18n has not yet been implemented yet\n * function WithoutTranslations() {\n * return <>{getMessage()}</>;\n * }\n */\nexport const mFallback: MFunctionType = <T extends string | null | undefined>(\n encodedMsg: T,\n options: InlineResolveOptions = {}\n): T extends string ? string : T => {\n // Return if the encoded message is null or undefined\n if (!encodedMsg) return encodedMsg as T extends string ? string : T;\n\n // Get any encoded options\n const decodedOptions = decodeOptions(encodedMsg) ?? {};\n\n // Return early if string already interpolated eg: mFallback(msg('Hello, {name}!', { name: 'Brian' }))\n if (isEncodedTranslationOptions(decodedOptions)) {\n // This is an encoded string, msg already interpolated, just return decoded string\n return decodeMsg(encodedMsg) as T extends string ? string : T;\n }\n\n // Not using decoded options to match behavior in @gt/react-core\n return interpolateIcuMessage(encodedMsg, options);\n};\n"],"mappings":";;AAYA,SAAgB,UACd,YACY;AACZ,KAAI,OAAO,eAAe,YAAY,WAAW,YAAY,IAAI,KAAK,GACpE,QAAO,WAAW,MAAM,GAAG,WAAW,YAAY,IAAI,CAAC;AAEzD,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACWT,MAAa,cACX,SACA,UAAoC,EAAE,KACJ;AAClC,QAAO,sBAAsB,SAAS,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACDhD,MAAa,aACX,YACA,UAAgC,EAAE,KACA;AAElC,KAAI,CAAC,WAAY,QAAO;AAMxB,KAAI,4BAHmB,cAAc,WAAW,IAAI,EAAE,CAGP,CAE7C,QAAO,UAAU,WAAW;AAI9B,QAAO,sBAAsB,YAAY,QAAQ"}
@@ -1,4 +1,4 @@
1
- const require_isEncodedTranslationOptions = require("./isEncodedTranslationOptions-eqrZWcmP.cjs");
1
+ const require_isEncodedTranslationOptions = require("./isEncodedTranslationOptions-B7rb2W7h.cjs");
2
2
  //#region src/translation-functions/msg/decodeMsg.ts
3
3
  function decodeMsg(encodedMsg) {
4
4
  if (typeof encodedMsg === "string" && encodedMsg.lastIndexOf(":") !== -1) return encodedMsg.slice(0, encodedMsg.lastIndexOf(":"));
@@ -86,4 +86,4 @@ Object.defineProperty(exports, "mFallback", {
86
86
  }
87
87
  });
88
88
 
89
- //# sourceMappingURL=mFallback-DSBMUg3c.cjs.map
89
+ //# sourceMappingURL=mFallback-DUDKkPGj.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mFallback-DSBMUg3c.cjs","names":["interpolateIcuMessage","isEncodedTranslationOptions","decodeOptions","interpolateIcuMessage"],"sources":["../src/translation-functions/msg/decodeMsg.ts","../src/translation-functions/fallbacks/gtFallback.ts","../src/translation-functions/fallbacks/mFallback.ts"],"sourcesContent":["/**\n * Extracts the original interpolated message string.\n * If the message cannot be decoded (i.e., it does not contain a colon separator),\n * the input is returned as-is.\n * @param encodedMsg The message to decode.\n * @returns The decoded message, or the input if it cannot be decoded.\n */\nexport function decodeMsg(encodedMsg: string): string;\nexport function decodeMsg<T extends null | undefined>(encodedMsg: T): T;\nexport function decodeMsg<T extends string | null | undefined>(\n encodedMsg: T\n): T extends string ? string : T;\nexport function decodeMsg<T extends string | null | undefined>(\n encodedMsg: T\n): string | T {\n if (typeof encodedMsg === 'string' && encodedMsg.lastIndexOf(':') !== -1) {\n return encodedMsg.slice(0, encodedMsg.lastIndexOf(':'));\n }\n return encodedMsg;\n}\n","import { InlineTranslationOptions } from '../types/options';\nimport { GTFunctionType } from '../types/functions';\nimport { interpolateIcuMessage } from '../utils/interpolation/interpolateIcuMessage';\n\n/**\n * A fallback function for the gt() function that decodes and interpolates.\n * @param {string | null | undefined} message - The ICU formatted message to interpolate.\n * @param {InlineTranslationOptions} options - The options to interpolate.\n * @returns - The decoded and interpolated message.\n *\n * @note This function is useful as a placeholder when for incrementally migrating to the m() function.\n * @example\n * // A backwards compatible translation function\n * function getMessage(gt: GTFunctionType = gtFallback) {\n * return gt('Hello, world!');\n * }\n *\n * // Here i18n has been implemented\n * function WithTranslation() {\n * const gt = useGT();\n * return <>{getMessage(gt)}</>;\n * }\n *\n *\n * // i18n has not yet been implemented yet\n * function WithoutTranslations() {\n * return <>{getMessage()}</>;\n * }\n */\nexport const gtFallback: GTFunctionType = <T extends string | null | undefined>(\n message: T,\n options: InlineTranslationOptions = {}\n): T extends string ? string : T => {\n return interpolateIcuMessage(message, options);\n};\n","import { decodeMsg } from '../msg/decodeMsg';\nimport { InlineResolveOptions } from '../types/options';\nimport { MFunctionType } from '../types/functions';\nimport { decodeOptions } from '../msg/decodeOptions';\nimport { isEncodedTranslationOptions } from '../utils/isEncodedTranslationOptions';\nimport { interpolateIcuMessage } from '../utils/interpolation/interpolateIcuMessage';\n\n/**\n * A fallback function for the m() function that decodes and interpolates.\n * @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.\n * @param {InlineTranslationOptions} options - The options to interpolate.\n * @returns - The decoded and interpolated message.\n *\n * @note This function is useful as a placeholder when for incrementally migrating to the m() function.\n * @example\n * // A backwards compatible translation function\n * function getMessage(m: MFunctionType = mFallback) {\n * return m(msg('Hello, world!'));\n * }\n *\n * // Here i18n has been implemented\n * function WithTranslation() {\n * const m = useMessages();\n * return <>{getMessage(m)}</>;\n * }\n *\n *\n * // i18n has not yet been implemented yet\n * function WithoutTranslations() {\n * return <>{getMessage()}</>;\n * }\n */\nexport const mFallback: MFunctionType = <T extends string | null | undefined>(\n encodedMsg: T,\n options: InlineResolveOptions = {}\n): T extends string ? string : T => {\n // Return if the encoded message is null or undefined\n if (!encodedMsg) return encodedMsg as T extends string ? string : T;\n\n // Get any encoded options\n const decodedOptions = decodeOptions(encodedMsg) ?? {};\n\n // Return early if string already interpolated eg: mFallback(msg('Hello, {name}!', { name: 'Brian' }))\n if (isEncodedTranslationOptions(decodedOptions)) {\n // This is an encoded string, msg already interpolated, just return decoded string\n return decodeMsg(encodedMsg) as T extends string ? string : T;\n }\n\n // Not using decoded options to match behavior in @gt/react-core\n return interpolateIcuMessage(encodedMsg, options);\n};\n"],"mappings":";;AAYA,SAAgB,UACd,YACY;AACZ,KAAI,OAAO,eAAe,YAAY,WAAW,YAAY,IAAI,KAAK,GACpE,QAAO,WAAW,MAAM,GAAG,WAAW,YAAY,IAAI,CAAC;AAEzD,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACWT,MAAa,cACX,SACA,UAAoC,EAAE,KACJ;AAClC,QAAOA,oCAAAA,sBAAsB,SAAS,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACDhD,MAAa,aACX,YACA,UAAgC,EAAE,KACA;AAElC,KAAI,CAAC,WAAY,QAAO;AAMxB,KAAIC,oCAAAA,4BAHmBC,oCAAAA,cAAc,WAAW,IAAI,EAAE,CAGP,CAE7C,QAAO,UAAU,WAAW;AAI9B,QAAOC,oCAAAA,sBAAsB,YAAY,QAAQ"}
1
+ {"version":3,"file":"mFallback-DUDKkPGj.cjs","names":["interpolateIcuMessage","isEncodedTranslationOptions","decodeOptions","interpolateIcuMessage"],"sources":["../src/translation-functions/msg/decodeMsg.ts","../src/translation-functions/fallbacks/gtFallback.ts","../src/translation-functions/fallbacks/mFallback.ts"],"sourcesContent":["/**\n * Extracts the original interpolated message string.\n * If the message cannot be decoded (i.e., it does not contain a colon separator),\n * the input is returned as-is.\n * @param encodedMsg The message to decode.\n * @returns The decoded message, or the input if it cannot be decoded.\n */\nexport function decodeMsg(encodedMsg: string): string;\nexport function decodeMsg<T extends null | undefined>(encodedMsg: T): T;\nexport function decodeMsg<T extends string | null | undefined>(\n encodedMsg: T\n): T extends string ? string : T;\nexport function decodeMsg<T extends string | null | undefined>(\n encodedMsg: T\n): string | T {\n if (typeof encodedMsg === 'string' && encodedMsg.lastIndexOf(':') !== -1) {\n return encodedMsg.slice(0, encodedMsg.lastIndexOf(':'));\n }\n return encodedMsg;\n}\n","import { InlineTranslationOptions } from '../types/options';\nimport { GTFunctionType } from '../types/functions';\nimport { interpolateIcuMessage } from '../utils/interpolation/interpolateIcuMessage';\n\n/**\n * A fallback function for the gt() function that decodes and interpolates.\n * @param {string | null | undefined} message - The ICU formatted message to interpolate.\n * @param {InlineTranslationOptions} options - The options to interpolate.\n * @returns - The decoded and interpolated message.\n *\n * @note This function is useful as a placeholder when for incrementally migrating to the m() function.\n * @example\n * // A backwards compatible translation function\n * function getMessage(gt: GTFunctionType = gtFallback) {\n * return gt('Hello, world!');\n * }\n *\n * // Here i18n has been implemented\n * function WithTranslation() {\n * const gt = useGT();\n * return <>{getMessage(gt)}</>;\n * }\n *\n *\n * // i18n has not yet been implemented yet\n * function WithoutTranslations() {\n * return <>{getMessage()}</>;\n * }\n */\nexport const gtFallback: GTFunctionType = <T extends string | null | undefined>(\n message: T,\n options: InlineTranslationOptions = {}\n): T extends string ? string : T => {\n return interpolateIcuMessage(message, options);\n};\n","import { decodeMsg } from '../msg/decodeMsg';\nimport { InlineResolveOptions } from '../types/options';\nimport { MFunctionType } from '../types/functions';\nimport { decodeOptions } from '../msg/decodeOptions';\nimport { isEncodedTranslationOptions } from '../utils/isEncodedTranslationOptions';\nimport { interpolateIcuMessage } from '../utils/interpolation/interpolateIcuMessage';\n\n/**\n * A fallback function for the m() function that decodes and interpolates.\n * @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.\n * @param {InlineTranslationOptions} options - The options to interpolate.\n * @returns - The decoded and interpolated message.\n *\n * @note This function is useful as a placeholder when for incrementally migrating to the m() function.\n * @example\n * // A backwards compatible translation function\n * function getMessage(m: MFunctionType = mFallback) {\n * return m(msg('Hello, world!'));\n * }\n *\n * // Here i18n has been implemented\n * function WithTranslation() {\n * const m = useMessages();\n * return <>{getMessage(m)}</>;\n * }\n *\n *\n * // i18n has not yet been implemented yet\n * function WithoutTranslations() {\n * return <>{getMessage()}</>;\n * }\n */\nexport const mFallback: MFunctionType = <T extends string | null | undefined>(\n encodedMsg: T,\n options: InlineResolveOptions = {}\n): T extends string ? string : T => {\n // Return if the encoded message is null or undefined\n if (!encodedMsg) return encodedMsg as T extends string ? string : T;\n\n // Get any encoded options\n const decodedOptions = decodeOptions(encodedMsg) ?? {};\n\n // Return early if string already interpolated eg: mFallback(msg('Hello, {name}!', { name: 'Brian' }))\n if (isEncodedTranslationOptions(decodedOptions)) {\n // This is an encoded string, msg already interpolated, just return decoded string\n return decodeMsg(encodedMsg) as T extends string ? string : T;\n }\n\n // Not using decoded options to match behavior in @gt/react-core\n return interpolateIcuMessage(encodedMsg, options);\n};\n"],"mappings":";;AAYA,SAAgB,UACd,YACY;AACZ,KAAI,OAAO,eAAe,YAAY,WAAW,YAAY,IAAI,KAAK,GACpE,QAAO,WAAW,MAAM,GAAG,WAAW,YAAY,IAAI,CAAC;AAEzD,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACWT,MAAa,cACX,SACA,UAAoC,EAAE,KACJ;AAClC,QAAOA,oCAAAA,sBAAsB,SAAS,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACDhD,MAAa,aACX,YACA,UAAgC,EAAE,KACA;AAElC,KAAI,CAAC,WAAY,QAAO;AAMxB,KAAIC,oCAAAA,4BAHmBC,oCAAAA,cAAc,WAAW,IAAI,EAAE,CAGP,CAE7C,QAAO,UAAU,WAAW;AAI9B,QAAOC,oCAAAA,sBAAsB,YAAY,QAAQ"}
@@ -23,7 +23,8 @@ type InlineTranslationOptions = BaseTranslationOptions & {
23
23
  */
24
24
  $_locales?: string | string[];
25
25
  $_hash?: string;
26
- $maxChars?: number; /** @deprecated use {@link EncodedTranslationOptions} instead */
26
+ $maxChars?: number; /** Whether the translated message requires approval before use. Must be a boolean literal. */
27
+ $requiresReview?: boolean; /** @deprecated use {@link EncodedTranslationOptions} instead */
27
28
  $_source?: string;
28
29
  };
29
30
  /**
@@ -39,6 +40,7 @@ type EncodedTranslationOptions = BaseTranslationOptions & {
39
40
  $context?: string;
40
41
  $id?: string;
41
42
  $maxChars?: number;
43
+ $requiresReview?: boolean;
42
44
  $_hash: string;
43
45
  $_source: string;
44
46
  };
@@ -59,6 +61,8 @@ type JsxTranslationOptions = {
59
61
  $context?: string;
60
62
  $id?: string;
61
63
  $_hash?: string;
64
+ $maxChars?: number; /** Whether the translated content requires approval before use */
65
+ $requiresReview?: boolean;
62
66
  };
63
67
  /**
64
68
  * Resolution options - options needed to perform a resolution for a given content
@@ -92,4 +96,4 @@ type NormalizedLookupOptions<T extends DataFormat> = Omit<ResolutionOptions<T>,
92
96
  };
93
97
  //#endregion
94
98
  export { EncodedTranslationOptions as a, JsxTranslationOptions as c, ResolutionOptions as d, RuntimeTranslationOptions as f, DictionaryTranslationOptions as i, LookupOptions as l, DictionaryLookupOptions as n, InlineResolveOptions as o, DictionaryOptions as r, InlineTranslationOptions as s, BaseTranslationOptions as t, NormalizedLookupOptions as u };
95
- //# sourceMappingURL=options-CczghSzj.d.mts.map
99
+ //# sourceMappingURL=options-DltHK8u3.d.cts.map
@@ -23,7 +23,8 @@ type InlineTranslationOptions = BaseTranslationOptions & {
23
23
  */
24
24
  $_locales?: string | string[];
25
25
  $_hash?: string;
26
- $maxChars?: number; /** @deprecated use {@link EncodedTranslationOptions} instead */
26
+ $maxChars?: number; /** Whether the translated message requires approval before use. Must be a boolean literal. */
27
+ $requiresReview?: boolean; /** @deprecated use {@link EncodedTranslationOptions} instead */
27
28
  $_source?: string;
28
29
  };
29
30
  /**
@@ -39,6 +40,7 @@ type EncodedTranslationOptions = BaseTranslationOptions & {
39
40
  $context?: string;
40
41
  $id?: string;
41
42
  $maxChars?: number;
43
+ $requiresReview?: boolean;
42
44
  $_hash: string;
43
45
  $_source: string;
44
46
  };
@@ -59,6 +61,8 @@ type JsxTranslationOptions = {
59
61
  $context?: string;
60
62
  $id?: string;
61
63
  $_hash?: string;
64
+ $maxChars?: number; /** Whether the translated content requires approval before use */
65
+ $requiresReview?: boolean;
62
66
  };
63
67
  /**
64
68
  * Resolution options - options needed to perform a resolution for a given content
@@ -92,4 +96,4 @@ type NormalizedLookupOptions<T extends DataFormat> = Omit<ResolutionOptions<T>,
92
96
  };
93
97
  //#endregion
94
98
  export { EncodedTranslationOptions as a, JsxTranslationOptions as c, ResolutionOptions as d, RuntimeTranslationOptions as f, DictionaryTranslationOptions as i, LookupOptions as l, DictionaryLookupOptions as n, InlineResolveOptions as o, DictionaryOptions as r, InlineTranslationOptions as s, BaseTranslationOptions as t, NormalizedLookupOptions as u };
95
- //# sourceMappingURL=options-D0Lnxv2X.d.cts.map
99
+ //# sourceMappingURL=options-Gk6vb5Hx.d.mts.map
@@ -1,4 +1,4 @@
1
- import { r as DictionaryOptions } from "./options-CczghSzj.mjs";
1
+ import { r as DictionaryOptions } from "./options-Gk6vb5Hx.mjs";
2
2
  import { RuntimeTranslateManyOptions } from "generaltranslation/internal";
3
3
  import { Content } from "@generaltranslation/format/types";
4
4
  //#region src/i18n-manager/translations-manager/utils/types/translation-data.d.ts
@@ -105,4 +105,4 @@ type Hash = string;
105
105
  type TranslationsLoader = (locale: string) => Promise<unknown>;
106
106
  //#endregion
107
107
  export { Locale as a, DictionaryEntry as c, DictionaryObject as d, DictionaryPath as f, LifecycleCallbacks as i, DictionaryKey as l, Translation as m, Hash as n, DictionaryLoader as o, DictionaryValue as p, TranslationBatchConfig as r, Dictionary as s, TranslationsLoader as t, DictionaryLeaf as u };
108
- //# sourceMappingURL=types-PZn6hXxt.d.mts.map
108
+ //# sourceMappingURL=types-DWixkDmD.d.mts.map
@@ -1,4 +1,4 @@
1
- import { r as DictionaryOptions } from "./options-D0Lnxv2X.cjs";
1
+ import { r as DictionaryOptions } from "./options-DltHK8u3.cjs";
2
2
  import { Content } from "@generaltranslation/format/types";
3
3
  import { RuntimeTranslateManyOptions } from "generaltranslation/internal";
4
4
  //#region src/i18n-manager/translations-manager/utils/types/translation-data.d.ts
@@ -105,4 +105,4 @@ type Hash = string;
105
105
  type TranslationsLoader = (locale: string) => Promise<unknown>;
106
106
  //#endregion
107
107
  export { Locale as a, DictionaryEntry as c, DictionaryObject as d, DictionaryPath as f, LifecycleCallbacks as i, DictionaryKey as l, Translation as m, Hash as n, DictionaryLoader as o, DictionaryValue as p, TranslationBatchConfig as r, Dictionary as s, TranslationsLoader as t, DictionaryLeaf as u };
108
- //# sourceMappingURL=types-BtGFavAy.d.cts.map
108
+ //# sourceMappingURL=types-W8aRF-m4.d.cts.map
package/dist/types.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as EncodedTranslationOptions, c as JsxTranslationOptions, d as ResolutionOptions, f as RuntimeTranslationOptions, i as DictionaryTranslationOptions, l as LookupOptions, n as DictionaryLookupOptions, o as InlineResolveOptions, r as DictionaryOptions, s as InlineTranslationOptions, t as BaseTranslationOptions, u as NormalizedLookupOptions } from "./options-D0Lnxv2X.cjs";
2
- import { a as SyncResolutionFunction, i as ResolveJsxTranslationFunction, n as GTFunctionType, o as SyncResolutionFunctionWithFallback, r as MFunctionType, s as TFunctionType, t as DictionaryObjectTranslation } from "./functions-DI1QpQoC.cjs";
1
+ import { a as EncodedTranslationOptions, c as JsxTranslationOptions, d as ResolutionOptions, f as RuntimeTranslationOptions, i as DictionaryTranslationOptions, l as LookupOptions, n as DictionaryLookupOptions, o as InlineResolveOptions, r as DictionaryOptions, s as InlineTranslationOptions, t as BaseTranslationOptions, u as NormalizedLookupOptions } from "./options-DltHK8u3.cjs";
2
+ import { a as SyncResolutionFunction, i as ResolveJsxTranslationFunction, n as GTFunctionType, o as SyncResolutionFunctionWithFallback, r as MFunctionType, s as TFunctionType, t as DictionaryObjectTranslation } from "./functions-BPxoOb-T.cjs";
3
3
  import { t as RegisterableMessages } from "./message-C62MTLwE.cjs";
4
- import { c as DictionaryEntry, d as DictionaryObject, f as DictionaryPath, l as DictionaryKey, m as Translation, p as DictionaryValue, s as Dictionary, u as DictionaryLeaf } from "./types-BtGFavAy.cjs";
4
+ import { c as DictionaryEntry, d as DictionaryObject, f as DictionaryPath, l as DictionaryKey, m as Translation, p as DictionaryValue, s as Dictionary, u as DictionaryLeaf } from "./types-W8aRF-m4.cjs";
5
5
  export { BaseTranslationOptions, type Dictionary, type DictionaryEntry, type DictionaryKey, type DictionaryLeaf, DictionaryLookupOptions, type DictionaryObject, DictionaryObjectTranslation, type DictionaryOptions, type DictionaryPath, DictionaryTranslationOptions, type DictionaryValue, EncodedTranslationOptions, GTFunctionType, InlineResolveOptions, InlineTranslationOptions, JsxTranslationOptions, LookupOptions, MFunctionType, NormalizedLookupOptions, RegisterableMessages, ResolutionOptions, ResolveJsxTranslationFunction, RuntimeTranslationOptions, SyncResolutionFunction, SyncResolutionFunctionWithFallback, TFunctionType, type Translation };
package/dist/types.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as EncodedTranslationOptions, c as JsxTranslationOptions, d as ResolutionOptions, f as RuntimeTranslationOptions, i as DictionaryTranslationOptions, l as LookupOptions, n as DictionaryLookupOptions, o as InlineResolveOptions, r as DictionaryOptions, s as InlineTranslationOptions, t as BaseTranslationOptions, u as NormalizedLookupOptions } from "./options-CczghSzj.mjs";
2
- import { a as SyncResolutionFunction, i as ResolveJsxTranslationFunction, n as GTFunctionType, o as SyncResolutionFunctionWithFallback, r as MFunctionType, s as TFunctionType, t as DictionaryObjectTranslation } from "./functions-Dojd5CfY.mjs";
1
+ import { a as EncodedTranslationOptions, c as JsxTranslationOptions, d as ResolutionOptions, f as RuntimeTranslationOptions, i as DictionaryTranslationOptions, l as LookupOptions, n as DictionaryLookupOptions, o as InlineResolveOptions, r as DictionaryOptions, s as InlineTranslationOptions, t as BaseTranslationOptions, u as NormalizedLookupOptions } from "./options-Gk6vb5Hx.mjs";
2
+ import { a as SyncResolutionFunction, i as ResolveJsxTranslationFunction, n as GTFunctionType, o as SyncResolutionFunctionWithFallback, r as MFunctionType, s as TFunctionType, t as DictionaryObjectTranslation } from "./functions-QaonTfxv.mjs";
3
3
  import { t as RegisterableMessages } from "./message-BN4DirTg.mjs";
4
- import { c as DictionaryEntry, d as DictionaryObject, f as DictionaryPath, l as DictionaryKey, m as Translation, p as DictionaryValue, s as Dictionary, u as DictionaryLeaf } from "./types-PZn6hXxt.mjs";
4
+ import { c as DictionaryEntry, d as DictionaryObject, f as DictionaryPath, l as DictionaryKey, m as Translation, p as DictionaryValue, s as Dictionary, u as DictionaryLeaf } from "./types-DWixkDmD.mjs";
5
5
  export { BaseTranslationOptions, type Dictionary, type DictionaryEntry, type DictionaryKey, type DictionaryLeaf, DictionaryLookupOptions, type DictionaryObject, DictionaryObjectTranslation, type DictionaryOptions, type DictionaryPath, DictionaryTranslationOptions, type DictionaryValue, EncodedTranslationOptions, GTFunctionType, InlineResolveOptions, InlineTranslationOptions, JsxTranslationOptions, LookupOptions, MFunctionType, NormalizedLookupOptions, RegisterableMessages, ResolutionOptions, ResolveJsxTranslationFunction, RuntimeTranslationOptions, SyncResolutionFunction, SyncResolutionFunctionWithFallback, TFunctionType, type Translation };
@@ -1,4 +1,4 @@
1
- import { o as logger_default, r as interpolateIcuMessage } from "./isEncodedTranslationOptions-BOwWa_-J.mjs";
1
+ import { o as logger_default, r as interpolateIcuMessage } from "./isEncodedTranslationOptions-69ZmAUR2.mjs";
2
2
  import { createDiagnosticMessage, defaultCacheUrl, defaultRuntimeApiUrl, indexVars, libraryDefaultLocale } from "generaltranslation/internal";
3
3
  import { LocaleConfig, formatCutoff, isValidLocale, resolveCanonicalLocale, standardizeLocale } from "@generaltranslation/format";
4
4
  import { GT } from "generaltranslation";
@@ -580,6 +580,7 @@ function hashMessage(message, options) {
580
580
  ...metadataOptions.$context && { context: metadataOptions.$context },
581
581
  ...metadataOptions.$id && { id: metadataOptions.$id },
582
582
  ...metadataOptions.$maxChars != null && { maxChars: Math.abs(metadataOptions.$maxChars) },
583
+ ...metadataOptions.$requiresReview === true && { requiresReview: true },
583
584
  dataFormat: options.$format
584
585
  });
585
586
  }
@@ -718,6 +719,7 @@ var TranslationsCache = class {
718
719
  ...metadataOptions.$context && { context: metadataOptions.$context },
719
720
  ...metadataOptions.$id && { id: metadataOptions.$id },
720
721
  ...metadataOptions.$maxChars != null && { maxChars: Math.abs(metadataOptions.$maxChars) },
722
+ ...metadataOptions.$requiresReview === true && { requiresReview: true },
721
723
  dataFormat: options.$format
722
724
  },
723
725
  resolve: (value) => resolve(value),
@@ -1728,4 +1730,4 @@ function getVersionId() {
1728
1730
  //#endregion
1729
1731
  export { hashMessage as C, resolveDictionaryLookupOptions as E, TRANSLATIONS_CACHE_MISS_EVENT_NAME as S, isDictionaryObject as T, setI18nManager as _, getLocales as a, LOCALES_CACHE_MISS_EVENT_NAME as b, resolveJsxWithFallback as c, resolveStringContentWithFallback as d, resolveStringContentWithRuntimeFallback as f, setConditionStore as g, getI18nManager as h, getLocaleProperties as i, resolveJsxWithRuntimeFallback as l, getCurrentLocale as m, getDefaultLocale as n, createLookupOptions as o, interpolateMessage as p, getLocale as r, resolveJsx as s, getVersionId as t, resolveStringContent as u, I18nManager as v, getDictionaryEntry as w, LOCALES_DICTIONARY_CACHE_MISS_EVENT_NAME as x, DICTIONARY_CACHE_MISS_EVENT_NAME as y };
1730
1732
 
1731
- //# sourceMappingURL=versionId-BTjLA0FZ.mjs.map
1733
+ //# sourceMappingURL=versionId-C6FQLPr1.mjs.map