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.
Files changed (133) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/dist/{ApiError-IYfaOR30.mjs → ApiError-0DxxIHLp.mjs} +1 -1
  3. package/dist/{ApiError-CZ45tkW6.cjs.map → ApiError-0DxxIHLp.mjs.map} +1 -1
  4. package/dist/{ApiError-CZ45tkW6.cjs → ApiError-D-IBuHj6.cjs} +1 -1
  5. package/dist/{ApiError-IYfaOR30.mjs.map → ApiError-D-IBuHj6.cjs.map} +1 -1
  6. package/dist/LocaleConfig.d.ts +1 -59
  7. package/dist/LocaleConfig.js +1 -225
  8. package/dist/{base64-2fu94Klt.cjs → base64-YBGAXkqy.cjs} +74 -1
  9. package/dist/base64-YBGAXkqy.cjs.map +1 -0
  10. package/dist/{base64-DH0STixb.mjs → base64-r7YWJYWt.mjs} +51 -2
  11. package/dist/base64-r7YWJYWt.mjs.map +1 -0
  12. package/dist/core.cjs +9 -8
  13. package/dist/core.d.cts +1 -2
  14. package/dist/core.d.mts +1 -2
  15. package/dist/core.d.ts +1 -128
  16. package/dist/core.js +1 -137
  17. package/dist/core.mjs +2 -2
  18. package/dist/derive/indexVars.d.ts +1 -1
  19. package/dist/errors.cjs +1 -1
  20. package/dist/errors.mjs +1 -1
  21. package/dist/id/types.d.ts +1 -1
  22. package/dist/{id-CyiXsQrY.cjs → id-C2orn1MA.cjs} +2 -2
  23. package/dist/{id-CyiXsQrY.cjs.map → id-C2orn1MA.cjs.map} +1 -1
  24. package/dist/{id-DbD7K-HL.mjs → id-DEaFhGqX.mjs} +2 -2
  25. package/dist/{id-DbD7K-HL.mjs.map → id-DEaFhGqX.mjs.map} +1 -1
  26. package/dist/id.cjs +1 -1
  27. package/dist/id.d.cts +1 -1
  28. package/dist/id.d.mts +1 -1
  29. package/dist/id.mjs +1 -1
  30. package/dist/index.cjs +431 -396
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.d.cts +4 -242
  33. package/dist/index.d.mts +4 -242
  34. package/dist/index.d.ts +5 -238
  35. package/dist/index.js +3 -322
  36. package/dist/index.mjs +278 -363
  37. package/dist/index.mjs.map +1 -1
  38. package/dist/internal.cjs +8 -6
  39. package/dist/internal.cjs.map +1 -1
  40. package/dist/internal.d.cts +37 -6
  41. package/dist/internal.d.mts +37 -6
  42. package/dist/internal.d.ts +2 -0
  43. package/dist/internal.js +1 -0
  44. package/dist/internal.mjs +5 -5
  45. package/dist/internal.mjs.map +1 -1
  46. package/dist/{isVariable-B08mggBy.cjs → isVariable-Ba1gLXdB.cjs} +1 -1
  47. package/dist/{isVariable-B08mggBy.cjs.map → isVariable-Ba1gLXdB.cjs.map} +1 -1
  48. package/dist/{isVariable-CYsKFHvR.mjs → isVariable-fAKEB7gF.mjs} +1 -1
  49. package/dist/{isVariable-CYsKFHvR.mjs.map → isVariable-fAKEB7gF.mjs.map} +1 -1
  50. package/dist/locales/getPluralForm.js +2 -2
  51. package/dist/logging/diagnostics.d.ts +18 -0
  52. package/dist/logging/diagnostics.js +64 -0
  53. package/dist/logging/errors.d.ts +1 -1
  54. package/dist/logging/errors.js +64 -11
  55. package/dist/logging/logger.d.ts +0 -3
  56. package/dist/logging/logger.js +0 -3
  57. package/dist/{types-AHtYZIP-.d.mts → types-CdRgQtET.d.cts} +6 -106
  58. package/dist/{types-Bf8_Apq_.d.cts → types-Db2Dn3oN.d.mts} +6 -106
  59. package/dist/types-dir/api/enqueueEntries.d.ts +1 -1
  60. package/dist/types-dir/api/enqueueFiles.d.ts +1 -1
  61. package/dist/types-dir/api/fetchTranslations.d.ts +1 -1
  62. package/dist/types-dir/api/file.d.ts +1 -1
  63. package/dist/types-dir/api/translate.d.ts +1 -1
  64. package/dist/types-dir/api/uploadFiles.d.ts +1 -1
  65. package/dist/types.cjs +7 -16
  66. package/dist/types.d.cts +2 -2
  67. package/dist/types.d.mts +2 -2
  68. package/dist/types.d.ts +10 -13
  69. package/dist/types.js +1 -2
  70. package/dist/types.mjs +1 -15
  71. package/package.json +3 -2
  72. package/dist/IntlCache-CAW8tKhd.cjs +0 -212
  73. package/dist/IntlCache-CAW8tKhd.cjs.map +0 -1
  74. package/dist/IntlCache-WZk0rKvj.mjs +0 -195
  75. package/dist/IntlCache-WZk0rKvj.mjs.map +0 -1
  76. package/dist/base64-2fu94Klt.cjs.map +0 -1
  77. package/dist/base64-DH0STixb.mjs.map +0 -1
  78. package/dist/cache/IntlCache.d.ts +0 -26
  79. package/dist/cache/IntlCache.js +0 -84
  80. package/dist/cache/types.d.ts +0 -32
  81. package/dist/cache/types.js +0 -1
  82. package/dist/core-7RP541eY.cjs +0 -1677
  83. package/dist/core-7RP541eY.cjs.map +0 -1
  84. package/dist/core-I9pWGafA.d.mts +0 -209
  85. package/dist/core-TLJoDpJP.d.cts +0 -209
  86. package/dist/core-isLphYAZ.mjs +0 -1498
  87. package/dist/core-isLphYAZ.mjs.map +0 -1
  88. package/dist/errors/formattingErrors.d.ts +0 -1
  89. package/dist/errors/formattingErrors.js +0 -3
  90. package/dist/formatting/custom-formats/CutoffFormat/CutoffFormat.d.ts +0 -59
  91. package/dist/formatting/custom-formats/CutoffFormat/CutoffFormat.js +0 -147
  92. package/dist/formatting/custom-formats/CutoffFormat/constants.d.ts +0 -4
  93. package/dist/formatting/custom-formats/CutoffFormat/constants.js +0 -30
  94. package/dist/formatting/custom-formats/CutoffFormat/types.d.ts +0 -48
  95. package/dist/formatting/custom-formats/CutoffFormat/types.js +0 -2
  96. package/dist/formatting/format.d.ts +0 -1
  97. package/dist/formatting/format.js +0 -257
  98. package/dist/locales/customLocaleMapping.d.ts +0 -11
  99. package/dist/locales/customLocaleMapping.js +0 -23
  100. package/dist/locales/determineLocale.d.ts +0 -1
  101. package/dist/locales/determineLocale.js +0 -72
  102. package/dist/locales/getLocaleDirection.d.ts +0 -1
  103. package/dist/locales/getLocaleDirection.js +0 -89
  104. package/dist/locales/getLocaleEmoji.d.ts +0 -2
  105. package/dist/locales/getLocaleEmoji.js +0 -319
  106. package/dist/locales/getLocaleName.d.ts +0 -1
  107. package/dist/locales/getLocaleName.js +0 -45
  108. package/dist/locales/getLocaleProperties.d.ts +0 -32
  109. package/dist/locales/getLocaleProperties.js +0 -220
  110. package/dist/locales/getRegionProperties.d.ts +0 -7
  111. package/dist/locales/getRegionProperties.js +0 -61
  112. package/dist/locales/isSameDialect.d.ts +0 -1
  113. package/dist/locales/isSameDialect.js +0 -41
  114. package/dist/locales/isSameLanguage.d.ts +0 -1
  115. package/dist/locales/isSameLanguage.js +0 -20
  116. package/dist/locales/isSupersetLocale.d.ts +0 -1
  117. package/dist/locales/isSupersetLocale.js +0 -22
  118. package/dist/locales/isValidLocale.d.ts +0 -1
  119. package/dist/locales/isValidLocale.js +0 -75
  120. package/dist/locales/requiresTranslation.d.ts +0 -1
  121. package/dist/locales/requiresTranslation.js +0 -32
  122. package/dist/locales/resolveAliasLocale.d.ts +0 -8
  123. package/dist/locales/resolveAliasLocale.js +0 -21
  124. package/dist/locales/resolveCanonicalLocale.d.ts +0 -8
  125. package/dist/locales/resolveCanonicalLocale.js +0 -13
  126. package/dist/logging/warnings.d.ts +0 -2
  127. package/dist/logging/warnings.js +0 -2
  128. package/dist/types-dir/jsx/content.d.ts +0 -61
  129. package/dist/types-dir/jsx/content.js +0 -11
  130. package/dist/types-dir/jsx/variables.d.ts +0 -9
  131. package/dist/types-dir/jsx/variables.js +0 -1
  132. package/dist/types.cjs.map +0 -1
  133. package/dist/types.mjs.map +0 -1
@@ -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();
@@ -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 {};
@@ -1 +0,0 @@
1
- export {};