gt-i18n 0.8.4 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/fallbacks.cjs +4 -0
- package/dist/fallbacks.d.cts +2 -0
- package/dist/fallbacks.d.mts +2 -0
- package/dist/fallbacks.mjs +2 -0
- package/dist/{translation-functions/types/functions.d.ts → functions-8ooUv8Yo.d.cts} +13 -8
- package/dist/functions-CPODsB3C.d.mts +61 -0
- package/dist/helpers-DUaQNdel.cjs +1347 -0
- package/dist/helpers-DUaQNdel.cjs.map +1 -0
- package/dist/helpers-ld2LqFID.mjs +1270 -0
- package/dist/helpers-ld2LqFID.mjs.map +1 -0
- package/dist/index-Bdz9PAYJ.d.cts +60 -0
- package/dist/index-DdPo_-bU.d.mts +60 -0
- package/dist/index.cjs +157 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +128 -0
- package/dist/index.d.mts +128 -0
- package/dist/index.mjs +122 -0
- package/dist/index.mjs.map +1 -0
- package/dist/internal-types.cjs +0 -0
- package/dist/internal-types.d.cts +3 -0
- package/dist/internal-types.d.mts +3 -0
- package/dist/internal-types.mjs +1 -0
- package/dist/internal.cjs +206 -0
- package/dist/internal.cjs.map +1 -0
- package/dist/internal.d.cts +374 -0
- package/dist/internal.d.mts +374 -0
- package/dist/internal.mjs +187 -0
- package/dist/internal.mjs.map +1 -0
- package/dist/isEncodedTranslationOptions-B33AZBqH.cjs +144 -0
- package/dist/isEncodedTranslationOptions-B33AZBqH.cjs.map +1 -0
- package/dist/isEncodedTranslationOptions-CIuvDwly.mjs +109 -0
- package/dist/isEncodedTranslationOptions-CIuvDwly.mjs.map +1 -0
- package/dist/mFallback-4Qb8OeCB.cjs +89 -0
- package/dist/mFallback-4Qb8OeCB.cjs.map +1 -0
- package/dist/mFallback-CHAfezd9.mjs +72 -0
- package/dist/mFallback-CHAfezd9.mjs.map +1 -0
- package/dist/message-BN4DirTg.d.mts +10 -0
- package/dist/message-C62MTLwE.d.cts +10 -0
- package/dist/options-B-yFI8LM.d.mts +80 -0
- package/dist/options-BFACoMQ2.d.cts +80 -0
- package/dist/translation-data-ClcN-5hC.d.cts +11 -0
- package/dist/translation-data-DoJjvbYg.d.mts +11 -0
- package/dist/types-CI5axgXi.d.cts +169 -0
- package/dist/types-KGn4sCHt.d.mts +169 -0
- package/dist/types.cjs +0 -0
- package/dist/types.d.cts +5 -0
- package/dist/types.d.mts +5 -0
- package/dist/types.mjs +1 -0
- package/package.json +54 -30
- package/dist/config/types.d.ts +0 -54
- package/dist/fallbacks.cjs.min.cjs +0 -2
- package/dist/fallbacks.cjs.min.cjs.map +0 -1
- package/dist/fallbacks.d.ts +0 -108
- package/dist/fallbacks.esm.min.mjs +0 -2
- package/dist/fallbacks.esm.min.mjs.map +0 -1
- package/dist/helpers/index.d.ts +0 -2
- package/dist/helpers/locale.d.ts +0 -61
- package/dist/helpers/versionId.d.ts +0 -9
- package/dist/i18n-manager/I18nManager.d.ts +0 -158
- package/dist/i18n-manager/index.d.ts +0 -4
- package/dist/i18n-manager/lifecycle-hooks/createLifecycleCallbacks.d.ts +0 -8
- package/dist/i18n-manager/lifecycle-hooks/types.d.ts +0 -68
- package/dist/i18n-manager/singleton-operations.d.ts +0 -17
- package/dist/i18n-manager/storage-adapter/FallbackStorageAdapter.d.ts +0 -14
- package/dist/i18n-manager/storage-adapter/StorageAdapter.d.ts +0 -25
- package/dist/i18n-manager/storage-adapter/types.d.ts +0 -4
- package/dist/i18n-manager/translations-manager/Cache.d.ts +0 -62
- package/dist/i18n-manager/translations-manager/LocalesCache.d.ts +0 -94
- package/dist/i18n-manager/translations-manager/TranslationsCache.d.ts +0 -115
- package/dist/i18n-manager/translations-manager/translations-loaders/createFallbackTranslationLoader.d.ts +0 -6
- package/dist/i18n-manager/translations-manager/translations-loaders/createRemoteTranslationLoader.d.ts +0 -24
- package/dist/i18n-manager/translations-manager/translations-loaders/routeCreateTranslationLoader.d.ts +0 -22
- package/dist/i18n-manager/translations-manager/translations-loaders/types.d.ts +0 -11
- package/dist/i18n-manager/translations-manager/utils/constants.d.ts +0 -4
- package/dist/i18n-manager/translations-manager/utils/createTranslateMany.d.ts +0 -13
- package/dist/i18n-manager/translations-manager/utils/types/translation-data.d.ts +0 -6
- package/dist/i18n-manager/translations-manager/utils/types/translations-manager.d.ts +0 -21
- package/dist/i18n-manager/types.d.ts +0 -32
- package/dist/i18n-manager/utils/getGTServicesEnabled.d.ts +0 -12
- package/dist/i18n-manager/utils/getLoadTranslationsType.d.ts +0 -24
- package/dist/i18n-manager/utils/getTranslationApiType.d.ts +0 -22
- package/dist/i18n-manager/validation/config-validation/validateLoadTranslations.d.ts +0 -25
- package/dist/i18n-manager/validation/config-validation/validateLocales.d.ts +0 -19
- package/dist/i18n-manager/validation/config-validation/validateTranslationApi.d.ts +0 -27
- package/dist/i18n-manager/validation/publishValidationResults.d.ts +0 -11
- package/dist/i18n-manager/validation/types.d.ts +0 -7
- package/dist/i18n-manager/validation/validateConfig.d.ts +0 -8
- package/dist/index.cjs.min.cjs +0 -2
- package/dist/index.cjs.min.cjs.map +0 -1
- package/dist/index.d.ts +0 -251
- package/dist/index.esm.min.mjs +0 -2
- package/dist/index.esm.min.mjs.map +0 -1
- package/dist/internal-types.d.ts +0 -237
- package/dist/internal.cjs.min.cjs +0 -2
- package/dist/internal.cjs.min.cjs.map +0 -1
- package/dist/internal.d.ts +0 -557
- package/dist/internal.esm.min.mjs +0 -2
- package/dist/internal.esm.min.mjs.map +0 -1
- package/dist/logs/logger.d.ts +0 -7
- package/dist/translation-functions/derive/index.d.ts +0 -1
- package/dist/translation-functions/fallbacks/gtFallback.d.ts +0 -27
- package/dist/translation-functions/fallbacks/index.d.ts +0 -2
- package/dist/translation-functions/fallbacks/mFallback.d.ts +0 -27
- package/dist/translation-functions/internal/getGT.d.ts +0 -11
- package/dist/translation-functions/internal/getMessages.d.ts +0 -15
- package/dist/translation-functions/internal/getTranslations.d.ts +0 -13
- package/dist/translation-functions/internal/helpers.d.ts +0 -31
- package/dist/translation-functions/internal/index.d.ts +0 -7
- package/dist/translation-functions/internal/jsx-resolution.d.ts +0 -6
- package/dist/translation-functions/internal/sync-translation-resolution.d.ts +0 -17
- package/dist/translation-functions/internal/tx.d.ts +0 -19
- package/dist/translation-functions/msg/decodeMsg.d.ts +0 -10
- package/dist/translation-functions/msg/decodeOptions.d.ts +0 -7
- package/dist/translation-functions/msg/index.d.ts +0 -3
- package/dist/translation-functions/msg/msg.d.ts +0 -38
- package/dist/translation-functions/t.d.ts +0 -8
- package/dist/translation-functions/types/index.d.ts +0 -3
- package/dist/translation-functions/types/message.d.ts +0 -6
- package/dist/translation-functions/types/options.d.ts +0 -78
- package/dist/translation-functions/utils/formatMessage.d.ts +0 -9
- package/dist/translation-functions/utils/interpolation/interpolateIcuMessage.d.ts +0 -8
- package/dist/translation-functions/utils/interpolation/interpolateMessage.d.ts +0 -8
- package/dist/translation-functions/utils/interpolation/interpolateStringMessage.d.ts +0 -5
- package/dist/translation-functions/utils/isEncodedTranslationOptions.d.ts +0 -6
- package/dist/translation-functions/utils/messages.d.ts +0 -1
- package/dist/types.d.ts +0 -149
- package/dist/utils/extractVariables.d.ts +0 -8
- package/dist/utils/hashMessage.d.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# gt-i18n
|
|
2
2
|
|
|
3
|
+
## 0.8.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1262](https://github.com/generaltranslation/gt/pull/1262) [`5af18c1`](https://github.com/generaltranslation/gt/commit/5af18c13c2c2ad341ec67c2b4f6f6ef29320123b) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - refactor(gt-i18n): move over to subscription system
|
|
8
|
+
|
|
9
|
+
## 0.8.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#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
|
|
14
|
+
|
|
15
|
+
- [#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.
|
|
16
|
+
|
|
17
|
+
- [#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
|
|
18
|
+
|
|
19
|
+
- 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)]:
|
|
20
|
+
- generaltranslation@8.2.7
|
|
21
|
+
- @generaltranslation/supported-locales@2.0.65
|
|
22
|
+
|
|
3
23
|
## 0.8.4
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|