gt-i18n 0.8.4 → 0.8.5

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 (129) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/fallbacks.cjs +4 -0
  3. package/dist/fallbacks.d.cts +2 -0
  4. package/dist/fallbacks.d.mts +2 -0
  5. package/dist/fallbacks.mjs +2 -0
  6. package/dist/{translation-functions/types/functions.d.ts → functions-8ooUv8Yo.d.cts} +13 -8
  7. package/dist/functions-CPODsB3C.d.mts +61 -0
  8. package/dist/helpers-BwyIrxJa.mjs +1183 -0
  9. package/dist/helpers-BwyIrxJa.mjs.map +1 -0
  10. package/dist/helpers-Dei0EV8K.cjs +1260 -0
  11. package/dist/helpers-Dei0EV8K.cjs.map +1 -0
  12. package/dist/index-Bdz9PAYJ.d.cts +60 -0
  13. package/dist/index-DdPo_-bU.d.mts +60 -0
  14. package/dist/index.cjs +157 -0
  15. package/dist/index.cjs.map +1 -0
  16. package/dist/index.d.cts +128 -0
  17. package/dist/index.d.mts +128 -0
  18. package/dist/index.mjs +122 -0
  19. package/dist/index.mjs.map +1 -0
  20. package/dist/internal-types.cjs +0 -0
  21. package/dist/internal-types.d.cts +3 -0
  22. package/dist/internal-types.d.mts +3 -0
  23. package/dist/internal-types.mjs +1 -0
  24. package/dist/internal.cjs +206 -0
  25. package/dist/internal.cjs.map +1 -0
  26. package/dist/internal.d.cts +308 -0
  27. package/dist/internal.d.mts +308 -0
  28. package/dist/internal.mjs +187 -0
  29. package/dist/internal.mjs.map +1 -0
  30. package/dist/isEncodedTranslationOptions-B33AZBqH.cjs +144 -0
  31. package/dist/isEncodedTranslationOptions-B33AZBqH.cjs.map +1 -0
  32. package/dist/isEncodedTranslationOptions-CIuvDwly.mjs +109 -0
  33. package/dist/isEncodedTranslationOptions-CIuvDwly.mjs.map +1 -0
  34. package/dist/mFallback-4Qb8OeCB.cjs +89 -0
  35. package/dist/mFallback-4Qb8OeCB.cjs.map +1 -0
  36. package/dist/mFallback-CHAfezd9.mjs +72 -0
  37. package/dist/mFallback-CHAfezd9.mjs.map +1 -0
  38. package/dist/message-BN4DirTg.d.mts +10 -0
  39. package/dist/message-C62MTLwE.d.cts +10 -0
  40. package/dist/options-B-yFI8LM.d.mts +80 -0
  41. package/dist/options-BFACoMQ2.d.cts +80 -0
  42. package/dist/translation-data-ClcN-5hC.d.cts +11 -0
  43. package/dist/translation-data-DoJjvbYg.d.mts +11 -0
  44. package/dist/types-B5rkJ1Al.d.cts +163 -0
  45. package/dist/types-CJ6WtbOR.d.mts +163 -0
  46. package/dist/types.cjs +0 -0
  47. package/dist/types.d.cts +5 -0
  48. package/dist/types.d.mts +5 -0
  49. package/dist/types.mjs +1 -0
  50. package/package.json +54 -30
  51. package/dist/config/types.d.ts +0 -54
  52. package/dist/fallbacks.cjs.min.cjs +0 -2
  53. package/dist/fallbacks.cjs.min.cjs.map +0 -1
  54. package/dist/fallbacks.d.ts +0 -108
  55. package/dist/fallbacks.esm.min.mjs +0 -2
  56. package/dist/fallbacks.esm.min.mjs.map +0 -1
  57. package/dist/helpers/index.d.ts +0 -2
  58. package/dist/helpers/locale.d.ts +0 -61
  59. package/dist/helpers/versionId.d.ts +0 -9
  60. package/dist/i18n-manager/I18nManager.d.ts +0 -158
  61. package/dist/i18n-manager/index.d.ts +0 -4
  62. package/dist/i18n-manager/lifecycle-hooks/createLifecycleCallbacks.d.ts +0 -8
  63. package/dist/i18n-manager/lifecycle-hooks/types.d.ts +0 -68
  64. package/dist/i18n-manager/singleton-operations.d.ts +0 -17
  65. package/dist/i18n-manager/storage-adapter/FallbackStorageAdapter.d.ts +0 -14
  66. package/dist/i18n-manager/storage-adapter/StorageAdapter.d.ts +0 -25
  67. package/dist/i18n-manager/storage-adapter/types.d.ts +0 -4
  68. package/dist/i18n-manager/translations-manager/Cache.d.ts +0 -62
  69. package/dist/i18n-manager/translations-manager/LocalesCache.d.ts +0 -94
  70. package/dist/i18n-manager/translations-manager/TranslationsCache.d.ts +0 -115
  71. package/dist/i18n-manager/translations-manager/translations-loaders/createFallbackTranslationLoader.d.ts +0 -6
  72. package/dist/i18n-manager/translations-manager/translations-loaders/createRemoteTranslationLoader.d.ts +0 -24
  73. package/dist/i18n-manager/translations-manager/translations-loaders/routeCreateTranslationLoader.d.ts +0 -22
  74. package/dist/i18n-manager/translations-manager/translations-loaders/types.d.ts +0 -11
  75. package/dist/i18n-manager/translations-manager/utils/constants.d.ts +0 -4
  76. package/dist/i18n-manager/translations-manager/utils/createTranslateMany.d.ts +0 -13
  77. package/dist/i18n-manager/translations-manager/utils/types/translation-data.d.ts +0 -6
  78. package/dist/i18n-manager/translations-manager/utils/types/translations-manager.d.ts +0 -21
  79. package/dist/i18n-manager/types.d.ts +0 -32
  80. package/dist/i18n-manager/utils/getGTServicesEnabled.d.ts +0 -12
  81. package/dist/i18n-manager/utils/getLoadTranslationsType.d.ts +0 -24
  82. package/dist/i18n-manager/utils/getTranslationApiType.d.ts +0 -22
  83. package/dist/i18n-manager/validation/config-validation/validateLoadTranslations.d.ts +0 -25
  84. package/dist/i18n-manager/validation/config-validation/validateLocales.d.ts +0 -19
  85. package/dist/i18n-manager/validation/config-validation/validateTranslationApi.d.ts +0 -27
  86. package/dist/i18n-manager/validation/publishValidationResults.d.ts +0 -11
  87. package/dist/i18n-manager/validation/types.d.ts +0 -7
  88. package/dist/i18n-manager/validation/validateConfig.d.ts +0 -8
  89. package/dist/index.cjs.min.cjs +0 -2
  90. package/dist/index.cjs.min.cjs.map +0 -1
  91. package/dist/index.d.ts +0 -251
  92. package/dist/index.esm.min.mjs +0 -2
  93. package/dist/index.esm.min.mjs.map +0 -1
  94. package/dist/internal-types.d.ts +0 -237
  95. package/dist/internal.cjs.min.cjs +0 -2
  96. package/dist/internal.cjs.min.cjs.map +0 -1
  97. package/dist/internal.d.ts +0 -557
  98. package/dist/internal.esm.min.mjs +0 -2
  99. package/dist/internal.esm.min.mjs.map +0 -1
  100. package/dist/logs/logger.d.ts +0 -7
  101. package/dist/translation-functions/derive/index.d.ts +0 -1
  102. package/dist/translation-functions/fallbacks/gtFallback.d.ts +0 -27
  103. package/dist/translation-functions/fallbacks/index.d.ts +0 -2
  104. package/dist/translation-functions/fallbacks/mFallback.d.ts +0 -27
  105. package/dist/translation-functions/internal/getGT.d.ts +0 -11
  106. package/dist/translation-functions/internal/getMessages.d.ts +0 -15
  107. package/dist/translation-functions/internal/getTranslations.d.ts +0 -13
  108. package/dist/translation-functions/internal/helpers.d.ts +0 -31
  109. package/dist/translation-functions/internal/index.d.ts +0 -7
  110. package/dist/translation-functions/internal/jsx-resolution.d.ts +0 -6
  111. package/dist/translation-functions/internal/sync-translation-resolution.d.ts +0 -17
  112. package/dist/translation-functions/internal/tx.d.ts +0 -19
  113. package/dist/translation-functions/msg/decodeMsg.d.ts +0 -10
  114. package/dist/translation-functions/msg/decodeOptions.d.ts +0 -7
  115. package/dist/translation-functions/msg/index.d.ts +0 -3
  116. package/dist/translation-functions/msg/msg.d.ts +0 -38
  117. package/dist/translation-functions/t.d.ts +0 -8
  118. package/dist/translation-functions/types/index.d.ts +0 -3
  119. package/dist/translation-functions/types/message.d.ts +0 -6
  120. package/dist/translation-functions/types/options.d.ts +0 -78
  121. package/dist/translation-functions/utils/formatMessage.d.ts +0 -9
  122. package/dist/translation-functions/utils/interpolation/interpolateIcuMessage.d.ts +0 -8
  123. package/dist/translation-functions/utils/interpolation/interpolateMessage.d.ts +0 -8
  124. package/dist/translation-functions/utils/interpolation/interpolateStringMessage.d.ts +0 -5
  125. package/dist/translation-functions/utils/isEncodedTranslationOptions.d.ts +0 -6
  126. package/dist/translation-functions/utils/messages.d.ts +0 -1
  127. package/dist/types.d.ts +0 -149
  128. package/dist/utils/extractVariables.d.ts +0 -8
  129. package/dist/utils/hashMessage.d.ts +0 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # gt-i18n
2
2
 
3
+ ## 0.8.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1252](https://github.com/generaltranslation/gt/pull/1252) [`47ad56b`](https://github.com/generaltranslation/gt/commit/47ad56bb23a70382ba98a900d968e9a48beee2b8) Thanks [@moss-bryophyta](https://github.com/moss-bryophyta)! - fix: pass `maxChars` (not `$maxChars`) to `hashSource` so it factors into the hash
8
+
9
+ - [#1251](https://github.com/generaltranslation/gt/pull/1251) [`fc3c699`](https://github.com/generaltranslation/gt/commit/fc3c699d2c952710cc975e26629ac309063dcbc7) Thanks [@bgub](https://github.com/bgub)! - Declare `sideEffects` in each package's `package.json` to enable tree-shaking in consumer bundlers (webpack, esbuild, Rollup). Packages with no module-scope side effects are marked `"sideEffects": false`. Packages with intentional side-effect entry points (`gt-react/browser`, `gt-react/macros`, `gt-next` server entries, `gt-react-native` TurboModule spec) list those files explicitly so they are preserved.
10
+
11
+ - [#1249](https://github.com/generaltranslation/gt/pull/1249) [`50d7628`](https://github.com/generaltranslation/gt/commit/50d7628e23b056e91abf8fa05f6577b74cb91569) Thanks [@bgub](https://github.com/bgub)! - chore: migrate build from Rollup to tsdown
12
+
13
+ - Updated dependencies [[`e3a8008`](https://github.com/generaltranslation/gt/commit/e3a8008ed0a3ab82d053f549265f9de7829e94c5), [`fc3c699`](https://github.com/generaltranslation/gt/commit/fc3c699d2c952710cc975e26629ac309063dcbc7), [`50d7628`](https://github.com/generaltranslation/gt/commit/50d7628e23b056e91abf8fa05f6577b74cb91569)]:
14
+ - generaltranslation@8.2.7
15
+ - @generaltranslation/supported-locales@2.0.65
16
+
3
17
  ## 0.8.4
4
18
 
5
19
  ### Patch Changes
@@ -0,0 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_mFallback = require("./mFallback-4Qb8OeCB.cjs");
3
+ exports.gtFallback = require_mFallback.gtFallback;
4
+ exports.mFallback = require_mFallback.mFallback;
@@ -0,0 +1,2 @@
1
+ import { n as gtFallback, t as mFallback } from "./index-Bdz9PAYJ.cjs";
2
+ export { gtFallback, mFallback };
@@ -0,0 +1,2 @@
1
+ import { n as gtFallback, t as mFallback } from "./index-DdPo_-bU.mjs";
2
+ export { gtFallback, mFallback };
@@ -0,0 +1,2 @@
1
+ import { n as gtFallback, t as mFallback } from "./mFallback-CHAfezd9.mjs";
2
+ export { gtFallback, mFallback };
@@ -1,5 +1,7 @@
1
- import { JsxChildren } from 'generaltranslation/types';
2
- import { DictionaryTranslationOptions, InlineTranslationOptions, JsxTranslationOptions } from './options';
1
+ import { a as InlineTranslationOptions, n as DictionaryTranslationOptions, o as JsxTranslationOptions } from "./options-BFACoMQ2.cjs";
2
+ import { JsxChildren } from "generaltranslation/types";
3
+
4
+ //#region src/translation-functions/types/functions.d.ts
3
5
  /**
4
6
  * Synchronous resolution function type
5
7
  * @param {string} message - The message to translate.
@@ -10,7 +12,7 @@ import { DictionaryTranslationOptions, InlineTranslationOptions, JsxTranslationO
10
12
  *
11
13
  * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
12
14
  */
13
- export type SyncResolutionFunction = (message: string, options?: InlineTranslationOptions) => string | undefined;
15
+ type SyncResolutionFunction = (message: string, options?: InlineTranslationOptions) => string | undefined;
14
16
  /**
15
17
  * Synchronous resolution function type
16
18
  * @param {string} message - The message to translate.
@@ -21,7 +23,7 @@ export type SyncResolutionFunction = (message: string, options?: InlineTranslati
21
23
  *
22
24
  * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
23
25
  */
24
- export type SyncResolutionFunctionWithFallback = (message: string, options?: InlineTranslationOptions) => string;
26
+ type SyncResolutionFunctionWithFallback = (message: string, options?: InlineTranslationOptions) => string;
25
27
  /**
26
28
  * Type for the gt() function
27
29
  * @param {string} message - The message to translate
@@ -29,7 +31,7 @@ export type SyncResolutionFunctionWithFallback = (message: string, options?: Inl
29
31
  * @returns {string} The translated message
30
32
  * TODO: next major version, remove the "...type" suffix, it's redundant
31
33
  */
32
- export type GTFunctionType = SyncResolutionFunctionWithFallback;
34
+ type GTFunctionType = SyncResolutionFunctionWithFallback;
33
35
  /**
34
36
  * Type for the m() function
35
37
  * @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.
@@ -38,7 +40,7 @@ export type GTFunctionType = SyncResolutionFunctionWithFallback;
38
40
  * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
39
41
  * TODO: next major version, remove the "...type" suffix, it's redundant
40
42
  */
41
- export type MFunctionType = <T extends string | null | undefined>(encodedMsg: T, options?: Record<string, any>) => T extends string ? string : T;
43
+ type MFunctionType = <T extends string | null | undefined>(encodedMsg: T, options?: Record<string, any>) => T extends string ? string : T;
42
44
  /**
43
45
  * Type for the t() function
44
46
  * @param {string} id - The id of the translation to translate.
@@ -46,11 +48,14 @@ export type MFunctionType = <T extends string | null | undefined>(encodedMsg: T,
46
48
  * @returns {string} The translated message.
47
49
  * TODO: next major version, remove the "...type" suffix, it's redundant
48
50
  */
49
- export type TFunctionType = (id: string, options?: DictionaryTranslationOptions) => string;
51
+ type TFunctionType = (id: string, options?: DictionaryTranslationOptions) => string;
50
52
  /**
51
53
  * Type for the resolveJsxTranslation() function
52
54
  * @param {JsxChildren} children - The children to resolve the translation for.
53
55
  * @param {JsxTranslationOptions} options - The options for the translation.
54
56
  * @returns {JsxChildren} The resolved translation.
55
57
  */
56
- export type ResolveJsxTranslationFunction = (children: JsxChildren, options?: JsxTranslationOptions) => JsxChildren | undefined;
58
+ type ResolveJsxTranslationFunction = (children: JsxChildren, options?: JsxTranslationOptions) => JsxChildren | undefined;
59
+ //#endregion
60
+ export { SyncResolutionFunctionWithFallback as a, SyncResolutionFunction as i, MFunctionType as n, TFunctionType as o, ResolveJsxTranslationFunction as r, GTFunctionType as t };
61
+ //# sourceMappingURL=functions-8ooUv8Yo.d.cts.map
@@ -0,0 +1,61 @@
1
+ import { a as InlineTranslationOptions, n as DictionaryTranslationOptions, o as JsxTranslationOptions } from "./options-B-yFI8LM.mjs";
2
+ import { JsxChildren } from "generaltranslation/types";
3
+
4
+ //#region src/translation-functions/types/functions.d.ts
5
+ /**
6
+ * Synchronous resolution function type
7
+ * @param {string} message - The message to translate.
8
+ * @param {InlineTranslationOptions} options - The options for the translation.
9
+ * @returns {string | undefined} The translated message or undefined if the message is not found.
10
+ *
11
+ * @important This is base type for user API
12
+ *
13
+ * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
14
+ */
15
+ type SyncResolutionFunction = (message: string, options?: InlineTranslationOptions) => string | undefined;
16
+ /**
17
+ * Synchronous resolution function type
18
+ * @param {string} message - The message to translate.
19
+ * @param {InlineTranslationOptions} options - The options for the translation.
20
+ * @returns {string} The translated message.
21
+ *
22
+ * @important This is base type for user API
23
+ *
24
+ * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
25
+ */
26
+ type SyncResolutionFunctionWithFallback = (message: string, options?: InlineTranslationOptions) => string;
27
+ /**
28
+ * Type for the gt() function
29
+ * @param {string} message - The message to translate
30
+ * @param {InlineTranslationOptions} options - The options for the translation
31
+ * @returns {string} The translated message
32
+ * TODO: next major version, remove the "...type" suffix, it's redundant
33
+ */
34
+ type GTFunctionType = SyncResolutionFunctionWithFallback;
35
+ /**
36
+ * Type for the m() function
37
+ * @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.
38
+ * @param {InlineTranslationOptions} options - The options to interpolate.
39
+ * @returns {string | null | undefined} The decoded and interpolated message.
40
+ * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
41
+ * TODO: next major version, remove the "...type" suffix, it's redundant
42
+ */
43
+ type MFunctionType = <T extends string | null | undefined>(encodedMsg: T, options?: Record<string, any>) => T extends string ? string : T;
44
+ /**
45
+ * Type for the t() function
46
+ * @param {string} id - The id of the translation to translate.
47
+ * @param {DictionaryTranslationOptions} options - The options for the translation.
48
+ * @returns {string} The translated message.
49
+ * TODO: next major version, remove the "...type" suffix, it's redundant
50
+ */
51
+ type TFunctionType = (id: string, options?: DictionaryTranslationOptions) => string;
52
+ /**
53
+ * Type for the resolveJsxTranslation() function
54
+ * @param {JsxChildren} children - The children to resolve the translation for.
55
+ * @param {JsxTranslationOptions} options - The options for the translation.
56
+ * @returns {JsxChildren} The resolved translation.
57
+ */
58
+ type ResolveJsxTranslationFunction = (children: JsxChildren, options?: JsxTranslationOptions) => JsxChildren | undefined;
59
+ //#endregion
60
+ export { SyncResolutionFunctionWithFallback as a, SyncResolutionFunction as i, MFunctionType as n, TFunctionType as o, ResolveJsxTranslationFunction as r, GTFunctionType as t };
61
+ //# sourceMappingURL=functions-CPODsB3C.d.mts.map