generaltranslation 8.2.13 → 8.2.15
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 +22 -1
- package/dist/{ApiError-IYfaOR30.mjs → ApiError-0DxxIHLp.mjs} +1 -1
- package/dist/{ApiError-CZ45tkW6.cjs.map → ApiError-0DxxIHLp.mjs.map} +1 -1
- package/dist/{ApiError-CZ45tkW6.cjs → ApiError-D-IBuHj6.cjs} +1 -1
- package/dist/{ApiError-IYfaOR30.mjs.map → ApiError-D-IBuHj6.cjs.map} +1 -1
- package/dist/LocaleConfig.d.ts +1 -59
- package/dist/LocaleConfig.js +1 -225
- package/dist/{base64-2fu94Klt.cjs → base64-YBGAXkqy.cjs} +74 -1
- package/dist/base64-YBGAXkqy.cjs.map +1 -0
- package/dist/{base64-DH0STixb.mjs → base64-r7YWJYWt.mjs} +51 -2
- package/dist/base64-r7YWJYWt.mjs.map +1 -0
- package/dist/core.cjs +9 -8
- package/dist/core.d.cts +1 -2
- package/dist/core.d.mts +1 -2
- package/dist/core.d.ts +1 -128
- package/dist/core.js +1 -137
- package/dist/core.mjs +2 -2
- package/dist/derive/indexVars.d.ts +1 -1
- package/dist/errors.cjs +1 -1
- package/dist/errors.mjs +1 -1
- package/dist/id/types.d.ts +1 -1
- package/dist/{id-CyiXsQrY.cjs → id-C2orn1MA.cjs} +2 -2
- package/dist/{id-CyiXsQrY.cjs.map → id-C2orn1MA.cjs.map} +1 -1
- package/dist/{id-DbD7K-HL.mjs → id-DEaFhGqX.mjs} +2 -2
- package/dist/{id-DbD7K-HL.mjs.map → id-DEaFhGqX.mjs.map} +1 -1
- package/dist/id.cjs +1 -1
- package/dist/id.d.cts +1 -1
- package/dist/id.d.mts +1 -1
- package/dist/id.mjs +1 -1
- package/dist/index.cjs +431 -396
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -242
- package/dist/index.d.mts +4 -242
- package/dist/index.d.ts +5 -238
- package/dist/index.js +3 -322
- package/dist/index.mjs +278 -363
- package/dist/index.mjs.map +1 -1
- package/dist/internal.cjs +8 -6
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +37 -6
- package/dist/internal.d.mts +37 -6
- package/dist/internal.d.ts +2 -0
- package/dist/internal.js +1 -0
- package/dist/internal.mjs +5 -5
- package/dist/internal.mjs.map +1 -1
- package/dist/{isVariable-B08mggBy.cjs → isVariable-Ba1gLXdB.cjs} +1 -1
- package/dist/{isVariable-B08mggBy.cjs.map → isVariable-Ba1gLXdB.cjs.map} +1 -1
- package/dist/{isVariable-CYsKFHvR.mjs → isVariable-fAKEB7gF.mjs} +1 -1
- package/dist/{isVariable-CYsKFHvR.mjs.map → isVariable-fAKEB7gF.mjs.map} +1 -1
- package/dist/locales/getPluralForm.js +2 -2
- package/dist/logging/diagnostics.d.ts +18 -0
- package/dist/logging/diagnostics.js +64 -0
- package/dist/logging/errors.d.ts +1 -1
- package/dist/logging/errors.js +64 -11
- package/dist/logging/logger.d.ts +0 -3
- package/dist/logging/logger.js +0 -3
- package/dist/{types-AHtYZIP-.d.mts → types-CdRgQtET.d.cts} +6 -106
- package/dist/{types-Bf8_Apq_.d.cts → types-Db2Dn3oN.d.mts} +6 -106
- package/dist/types-dir/api/enqueueEntries.d.ts +1 -1
- package/dist/types-dir/api/enqueueFiles.d.ts +1 -1
- package/dist/types-dir/api/fetchTranslations.d.ts +1 -1
- package/dist/types-dir/api/file.d.ts +1 -1
- package/dist/types-dir/api/translate.d.ts +1 -1
- package/dist/types-dir/api/uploadFiles.d.ts +1 -1
- package/dist/types.cjs +7 -16
- package/dist/types.d.cts +2 -2
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +10 -13
- package/dist/types.js +1 -2
- package/dist/types.mjs +1 -15
- package/package.json +3 -2
- package/dist/IntlCache-CAW8tKhd.cjs +0 -212
- package/dist/IntlCache-CAW8tKhd.cjs.map +0 -1
- package/dist/IntlCache-WZk0rKvj.mjs +0 -195
- package/dist/IntlCache-WZk0rKvj.mjs.map +0 -1
- package/dist/base64-2fu94Klt.cjs.map +0 -1
- package/dist/base64-DH0STixb.mjs.map +0 -1
- package/dist/cache/IntlCache.d.ts +0 -26
- package/dist/cache/IntlCache.js +0 -84
- package/dist/cache/types.d.ts +0 -32
- package/dist/cache/types.js +0 -1
- package/dist/core-7RP541eY.cjs +0 -1677
- package/dist/core-7RP541eY.cjs.map +0 -1
- package/dist/core-I9pWGafA.d.mts +0 -209
- package/dist/core-TLJoDpJP.d.cts +0 -209
- package/dist/core-isLphYAZ.mjs +0 -1498
- package/dist/core-isLphYAZ.mjs.map +0 -1
- package/dist/errors/formattingErrors.d.ts +0 -1
- package/dist/errors/formattingErrors.js +0 -3
- package/dist/formatting/custom-formats/CutoffFormat/CutoffFormat.d.ts +0 -59
- package/dist/formatting/custom-formats/CutoffFormat/CutoffFormat.js +0 -147
- package/dist/formatting/custom-formats/CutoffFormat/constants.d.ts +0 -4
- package/dist/formatting/custom-formats/CutoffFormat/constants.js +0 -30
- package/dist/formatting/custom-formats/CutoffFormat/types.d.ts +0 -48
- package/dist/formatting/custom-formats/CutoffFormat/types.js +0 -2
- package/dist/formatting/format.d.ts +0 -1
- package/dist/formatting/format.js +0 -257
- package/dist/locales/customLocaleMapping.d.ts +0 -11
- package/dist/locales/customLocaleMapping.js +0 -23
- package/dist/locales/determineLocale.d.ts +0 -1
- package/dist/locales/determineLocale.js +0 -72
- package/dist/locales/getLocaleDirection.d.ts +0 -1
- package/dist/locales/getLocaleDirection.js +0 -89
- package/dist/locales/getLocaleEmoji.d.ts +0 -2
- package/dist/locales/getLocaleEmoji.js +0 -319
- package/dist/locales/getLocaleName.d.ts +0 -1
- package/dist/locales/getLocaleName.js +0 -45
- package/dist/locales/getLocaleProperties.d.ts +0 -32
- package/dist/locales/getLocaleProperties.js +0 -220
- package/dist/locales/getRegionProperties.d.ts +0 -7
- package/dist/locales/getRegionProperties.js +0 -61
- package/dist/locales/isSameDialect.d.ts +0 -1
- package/dist/locales/isSameDialect.js +0 -41
- package/dist/locales/isSameLanguage.d.ts +0 -1
- package/dist/locales/isSameLanguage.js +0 -20
- package/dist/locales/isSupersetLocale.d.ts +0 -1
- package/dist/locales/isSupersetLocale.js +0 -22
- package/dist/locales/isValidLocale.d.ts +0 -1
- package/dist/locales/isValidLocale.js +0 -75
- package/dist/locales/requiresTranslation.d.ts +0 -1
- package/dist/locales/requiresTranslation.js +0 -32
- package/dist/locales/resolveAliasLocale.d.ts +0 -8
- package/dist/locales/resolveAliasLocale.js +0 -21
- package/dist/locales/resolveCanonicalLocale.d.ts +0 -8
- package/dist/locales/resolveCanonicalLocale.js +0 -13
- package/dist/logging/warnings.d.ts +0 -2
- package/dist/logging/warnings.js +0 -2
- package/dist/types-dir/jsx/content.d.ts +0 -61
- package/dist/types-dir/jsx/content.js +0 -11
- package/dist/types-dir/jsx/variables.d.ts +0 -9
- package/dist/types-dir/jsx/variables.js +0 -1
- package/dist/types.cjs.map +0 -1
- package/dist/types.mjs.map +0 -1
package/dist/cache/IntlCache.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
-
if (ar || !(i in from)) {
|
|
4
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
-
ar[i] = from[i];
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
-
};
|
|
10
|
-
import { libraryDefaultLocale } from '../settings/settings';
|
|
11
|
-
import { CutoffFormatConstructor } from '../formatting/custom-formats/CutoffFormat/CutoffFormat';
|
|
12
|
-
/**
|
|
13
|
-
* Object mapping constructor names to their respective constructor functions
|
|
14
|
-
* Includes all native Intl constructors plus custom ones like CutoffFormat
|
|
15
|
-
*/
|
|
16
|
-
var CustomIntl = {
|
|
17
|
-
Collator: Intl.Collator,
|
|
18
|
-
DateTimeFormat: Intl.DateTimeFormat,
|
|
19
|
-
DisplayNames: Intl.DisplayNames,
|
|
20
|
-
ListFormat: Intl.ListFormat,
|
|
21
|
-
Locale: Intl.Locale,
|
|
22
|
-
NumberFormat: Intl.NumberFormat,
|
|
23
|
-
PluralRules: Intl.PluralRules,
|
|
24
|
-
RelativeTimeFormat: Intl.RelativeTimeFormat,
|
|
25
|
-
Segmenter: Intl.Segmenter,
|
|
26
|
-
CutoffFormat: CutoffFormatConstructor,
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Cache for Intl and custom format instances to avoid repeated instantiation
|
|
30
|
-
* Uses a two-level structure: constructor name -> cache key -> instance.
|
|
31
|
-
*/
|
|
32
|
-
var IntlCache = /** @class */ (function () {
|
|
33
|
-
function IntlCache() {
|
|
34
|
-
this.cache = {};
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Generates a consistent cache key from locales and options.
|
|
38
|
-
* Handles all LocalesArgument types (string, Locale, array, undefined).
|
|
39
|
-
*/
|
|
40
|
-
IntlCache.prototype._generateKey = function (locales, options) {
|
|
41
|
-
if (options === void 0) { options = {}; }
|
|
42
|
-
// Normalize locales to string representation
|
|
43
|
-
var localeKey = !locales
|
|
44
|
-
? 'undefined'
|
|
45
|
-
: Array.isArray(locales)
|
|
46
|
-
? locales.map(function (l) { return String(l); }).join(',')
|
|
47
|
-
: String(locales);
|
|
48
|
-
// Sort option keys to ensure consistent key generation regardless of property order
|
|
49
|
-
var sortedOptions = options
|
|
50
|
-
? JSON.stringify(options, Object.keys(options).sort())
|
|
51
|
-
: '{}';
|
|
52
|
-
return "".concat(localeKey, ":").concat(sortedOptions);
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Gets a cached Intl instance or creates a new one if not found
|
|
56
|
-
* @param constructor The name of the Intl constructor to use.
|
|
57
|
-
* @param args Constructor arguments (locales, options).
|
|
58
|
-
* @returns Cached or newly created Intl instance.
|
|
59
|
-
*/
|
|
60
|
-
IntlCache.prototype.get = function (constructor) {
|
|
61
|
-
var _a;
|
|
62
|
-
var _b;
|
|
63
|
-
var args = [];
|
|
64
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
65
|
-
args[_i - 1] = arguments[_i];
|
|
66
|
-
}
|
|
67
|
-
var _c = args[0], locales = _c === void 0 ? libraryDefaultLocale : _c, _d = args[1], options = _d === void 0 ? {} : _d;
|
|
68
|
-
var key = this._generateKey(locales, options);
|
|
69
|
-
var intlObject = (_b = this.cache[constructor]) === null || _b === void 0 ? void 0 : _b[key];
|
|
70
|
-
if (intlObject === undefined) {
|
|
71
|
-
// Create new instance and cache it
|
|
72
|
-
intlObject = new ((_a = CustomIntl[constructor]).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
73
|
-
if (!this.cache[constructor])
|
|
74
|
-
this.cache[constructor] = {};
|
|
75
|
-
this.cache[constructor][key] = intlObject;
|
|
76
|
-
}
|
|
77
|
-
return intlObject;
|
|
78
|
-
};
|
|
79
|
-
return IntlCache;
|
|
80
|
-
}());
|
|
81
|
-
/**
|
|
82
|
-
* Global instance of the Intl cache for use throughout the application
|
|
83
|
-
*/
|
|
84
|
-
export var intlCache = new IntlCache();
|
package/dist/cache/types.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { CutoffFormatConstructor } from '../formatting/custom-formats/CutoffFormat/CutoffFormat';
|
|
2
|
-
/**
|
|
3
|
-
* Extracts only the constructor functions from the Intl namespace,
|
|
4
|
-
* filtering out static methods like getCanonicalLocales and supportedValuesOf
|
|
5
|
-
*/
|
|
6
|
-
type IntlConstructors = {
|
|
7
|
-
[K in keyof typeof Intl as (typeof Intl)[K] extends new (...args: any[]) => any ? K : never]: (typeof Intl)[K];
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Extended interface that includes all native Intl constructors plus custom ones
|
|
11
|
-
*/
|
|
12
|
-
export interface CustomIntlConstructors extends IntlConstructors {
|
|
13
|
-
CutoffFormat: typeof CutoffFormatConstructor;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Helper type to represent a constructor function for a given Intl constructor key
|
|
17
|
-
*/
|
|
18
|
-
export type ConstructorType<K extends keyof CustomIntlConstructors> = new (...args: ConstructorParameters<CustomIntlConstructors[K]>) => InstanceType<CustomIntlConstructors[K]>;
|
|
19
|
-
/**
|
|
20
|
-
* Type for the cache object structure - each constructor gets its own Record
|
|
21
|
-
* mapping cache keys to instances of that specific constructor type
|
|
22
|
-
*/
|
|
23
|
-
export type IntlCacheObject = {
|
|
24
|
-
[K in keyof CustomIntlConstructors]?: Record<string, InstanceType<ConstructorType<K>>>;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Type for the CustomIntl object that maps constructor names to constructor functions
|
|
28
|
-
*/
|
|
29
|
-
export type CustomIntlType = {
|
|
30
|
-
[K in keyof CustomIntlConstructors]: ConstructorType<K>;
|
|
31
|
-
};
|
|
32
|
-
export {};
|
package/dist/cache/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|