@nice2dev/i18n 1.0.5 → 1.0.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/dist/index.d.ts CHANGED
@@ -13,6 +13,28 @@
13
13
  */
14
14
 
15
15
  import { default as default_2 } from 'react';
16
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
17
+ import { ReactNode } from 'react';
18
+
19
+ /**
20
+ * Apply accented characters to text.
21
+ */
22
+ export declare function addAccents(text: string, extended?: boolean): string;
23
+
24
+ /**
25
+ * Add bidi markers for RTL testing.
26
+ */
27
+ export declare function addBidiMarkers(text: string, rtl?: boolean): string;
28
+
29
+ /**
30
+ * Add brackets around text to identify translatable strings.
31
+ */
32
+ export declare function addBrackets(text: string, prefix?: string, suffix?: string): string;
33
+
34
+ /**
35
+ * Analyze a translation dictionary for potential i18n issues.
36
+ */
37
+ export declare function analyzeDictionary(sourceDictionary: Record<string, string>, targetDictionary?: Record<string, string>): I18nAnalysisResult;
16
38
 
17
39
  /**
18
40
  * Check common RTL issues in styles.
@@ -20,6 +42,104 @@ import { default as default_2 } from 'react';
20
42
  */
21
43
  export declare function analyzeStylesForRTL(styles: Record<string, string | number>): string[];
22
44
 
45
+ export declare interface CacheEntry {
46
+ data: TranslationDictionary;
47
+ loadedAt: number;
48
+ expiresAt: number;
49
+ }
50
+
51
+ export declare const CALENDAR_INFO: Record<CalendarSystem, CalendarInfo>;
52
+
53
+ export declare interface CalendarDate {
54
+ /** Calendar system used */
55
+ calendar: CalendarSystem;
56
+ /** Year (era-relative for some calendars) */
57
+ year: number;
58
+ /** Month (1-12 for most, varies for lunar) */
59
+ month: number;
60
+ /** Day of month */
61
+ day: number;
62
+ /** Era name (if applicable) */
63
+ era?: string;
64
+ /** Original Gregorian date */
65
+ gregorianDate: Date;
66
+ }
67
+
68
+ export declare interface CalendarFormatter {
69
+ /** Format a date in the selected calendar */
70
+ format: (date: Date) => string;
71
+ /** Format date with era */
72
+ formatWithEra: (date: Date) => string;
73
+ /** Get month name */
74
+ getMonthName: (date: Date) => string;
75
+ /** Get all month names for the calendar */
76
+ getMonthNames: () => string[];
77
+ /** Get weekday name */
78
+ getWeekdayName: (date: Date) => string;
79
+ /** Get all weekday names */
80
+ getWeekdayNames: () => string[];
81
+ /** Parse calendar date into components */
82
+ parseParts: (date: Date) => CalendarDate;
83
+ /** Get era name (if applicable) */
84
+ getEraName: (date: Date) => string | undefined;
85
+ }
86
+
87
+ export declare interface CalendarFormatterOptions {
88
+ /** Date format style */
89
+ dateStyle?: 'short' | 'medium' | 'long' | 'full';
90
+ /** Include era in output */
91
+ showEra?: boolean;
92
+ /** Include weekday in output */
93
+ showWeekday?: boolean;
94
+ }
95
+
96
+ export declare interface CalendarInfo {
97
+ /** Calendar system identifier */
98
+ id: CalendarSystem;
99
+ /** Display name in the specified language */
100
+ displayName: string;
101
+ /** Number of months in a year (average for lunar calendars) */
102
+ monthsInYear: number;
103
+ /** Whether the calendar uses eras */
104
+ hasEra: boolean;
105
+ /** Whether it's a lunar calendar */
106
+ isLunar: boolean;
107
+ /** Associated languages/regions */
108
+ associatedLanguages: NiceSupportedLang[];
109
+ }
110
+
111
+ /**
112
+ * Supported calendar systems.
113
+ * Uses Intl.DateTimeFormat calendar types.
114
+ */
115
+ export declare type CalendarSystem = 'gregory' | 'islamic' | 'islamic-umalqura' | 'islamic-tbla' | 'islamic-civil' | 'hebrew' | 'buddhist' | 'japanese' | 'persian' | 'chinese' | 'coptic' | 'ethiopic' | 'indian' | 'roc';
116
+
117
+ /**
118
+ * Chinese celestial stems (天干).
119
+ */
120
+ export declare const CELESTIAL_STEMS: string[];
121
+
122
+ /**
123
+ * Chinese zodiac animals.
124
+ */
125
+ export declare const CHINESE_ZODIAC: string[];
126
+
127
+ /**
128
+ * Check if a string contains non-ASCII characters.
129
+ * Useful for detecting if text has been properly internationalized.
130
+ */
131
+ export declare function containsNonAscii(text: string): boolean;
132
+
133
+ /**
134
+ * Convert a date from one timezone to another.
135
+ */
136
+ export declare function convertTimezone(date: Date, fromTimezone: string, toTimezone: string): Date;
137
+
138
+ /**
139
+ * Create a calendar formatter for a specific calendar system.
140
+ */
141
+ export declare function createCalendarFormatter(lang: NiceSupportedLang, calendar?: CalendarSystem, options?: CalendarFormatterOptions): CalendarFormatter;
142
+
23
143
  /**
24
144
  * Create a locale-aware currency formatter.
25
145
  */
@@ -30,11 +150,26 @@ export declare function createCurrencyFormatter(lang: NiceSupportedLang, currenc
30
150
  */
31
151
  export declare function createDateFormatter(lang: NiceSupportedLang, style?: DateFormatStyle): NiceDateFormatter;
32
152
 
153
+ export declare function createDynamicLoader(config: LoaderConfig): DynamicLoader;
154
+
155
+ /**
156
+ * Create a loader that fetches from URL.
157
+ */
158
+ export declare function createFetchLoader(baseUrl: string, options?: Partial<LoaderConfig>): DynamicLoader;
159
+
33
160
  /**
34
161
  * Create a translator function that supports ICU MessageFormat.
35
162
  */
36
163
  export declare function createICUTranslator(dict: Record<string, string>, lang?: NiceSupportedLang): (key: string, defaultValue: string, values?: Record<string, string | number | Date>) => string;
37
164
 
165
+ /**
166
+ * Create a loader that uses dynamic imports.
167
+ * Assumes translations are in same package.
168
+ */
169
+ export declare function createImportLoader(importFn: (lang: NiceSupportedLang, namespace?: string) => Promise<{
170
+ default: TranslationDictionary;
171
+ }>, options?: Partial<LoaderConfig>): DynamicLoader;
172
+
38
173
  /**
39
174
  * Create a locale-aware number formatter.
40
175
  */
@@ -45,14 +180,95 @@ export declare function createNumberFormatter(lang: NiceSupportedLang): NiceNumb
45
180
  */
46
181
  export declare function createTimeFormatter(lang: NiceSupportedLang, style?: DateFormatStyle): NiceTimeFormatter;
47
182
 
183
+ /**
184
+ * Create a timezone-aware formatter.
185
+ */
186
+ export declare function createTimezoneFormatter(lang: NiceSupportedLang, timezone: string, options?: TimezoneFormatterOptions): TimezoneFormatter;
187
+
48
188
  /** Get a translation function without React context (for non-component code). */
49
189
  export declare function createTranslator(lang?: NiceSupportedLang, overrides?: Record<string, string>): NiceTranslateFn;
50
190
 
51
191
  export declare type DateFormatStyle = 'short' | 'medium' | 'long' | 'full';
52
192
 
193
+ export declare const DEFAULT_CALENDAR: Record<NiceSupportedLang, CalendarSystem>;
194
+
195
+ /**
196
+ * Detect browser language and auto-load.
197
+ */
198
+ export declare function detectAndLoad(loader: DynamicLoader, options?: {
199
+ fallback?: NiceSupportedLang;
200
+ preferredLanguages?: NiceSupportedLang[];
201
+ }): Promise<NiceSupportedLang>;
202
+
53
203
  /** Get user's preferred language from browser. */
54
204
  export declare function detectBrowserLanguage(): NiceSupportedLang;
55
205
 
206
+ /**
207
+ * Check if a string contains hard-coded text (potential i18n issue).
208
+ * Returns true if the string has printable ASCII but no translation markers.
209
+ */
210
+ export declare function detectHardcodedText(text: string): boolean;
211
+
212
+ /**
213
+ * Detect the user's timezone from browser/system settings.
214
+ */
215
+ export declare function detectTimezone(): string;
216
+
217
+ export declare interface DynamicI18nContextValue {
218
+ loader: DynamicLoader;
219
+ translations: TranslationDictionary;
220
+ isLoading: boolean;
221
+ error: Error | null;
222
+ setLanguage: (lang: NiceSupportedLang) => Promise<void>;
223
+ currentLanguage: NiceSupportedLang;
224
+ loadedLanguages: NiceSupportedLang[];
225
+ }
226
+
227
+ /**
228
+ * Provider for dynamic i18n loading in React apps.
229
+ */
230
+ export declare function DynamicI18nProvider({ children, loader, initialLanguage, namespace, }: DynamicI18nProviderProps): JSX_2.Element;
231
+
232
+ export declare interface DynamicI18nProviderProps {
233
+ children: ReactNode;
234
+ loader: DynamicLoader;
235
+ initialLanguage?: NiceSupportedLang;
236
+ namespace?: string;
237
+ }
238
+
239
+ export declare interface DynamicLoader {
240
+ /** Load translations for a language */
241
+ loadLanguage: (lang: NiceSupportedLang, namespace?: string) => Promise<TranslationDictionary | null>;
242
+ /** Load translations for multiple languages */
243
+ loadLanguages: (langs: NiceSupportedLang[]) => Promise<void>;
244
+ /** Preload languages based on config */
245
+ preloadLanguages: () => Promise<void>;
246
+ /** Get loaded translations */
247
+ getTranslations: (lang: NiceSupportedLang, namespace?: string) => TranslationDictionary | null;
248
+ /** Check if language is loaded */
249
+ isLoaded: (lang: NiceSupportedLang, namespace?: string) => boolean;
250
+ /** Check if language is loading */
251
+ isLoading: (lang: NiceSupportedLang) => boolean;
252
+ /** Get all loaded languages */
253
+ getLoadedLanguages: () => NiceSupportedLang[];
254
+ /** Clear cache for a language or all */
255
+ clearCache: (lang?: NiceSupportedLang) => void;
256
+ /** Get loader state */
257
+ getState: () => LoaderState;
258
+ /** Set current language (auto-loads if needed) */
259
+ setLanguage: (lang: NiceSupportedLang) => Promise<void>;
260
+ /** Get current language */
261
+ getCurrentLanguage: () => NiceSupportedLang;
262
+ /** Subscribe to state changes */
263
+ subscribe: (callback: (state: LoaderState) => void) => () => void;
264
+ }
265
+
266
+ /**
267
+ * Expand text to simulate longer translations.
268
+ * Languages like German, Finnish can be 30-50% longer than English.
269
+ */
270
+ export declare function expandText(text: string, factor?: number, useVowelDoubling?: boolean): string;
271
+
56
272
  /**
57
273
  * Find fuzzy matches in existing translations for reuse.
58
274
  * Compares the English value to find similar existing translations.
@@ -106,6 +322,11 @@ export declare function formatICU(template: string, values?: Record<string, stri
106
322
  */
107
323
  export declare function formatMessage(template: string, values?: Record<string, string | number>): string;
108
324
 
325
+ /**
326
+ * Convert a UTC date to local timezone.
327
+ */
328
+ export declare function fromUTC(date: Date, toTimezone?: string): Date;
329
+
109
330
  /**
110
331
  * Generate a coverage report in markdown format.
111
332
  */
@@ -116,11 +337,41 @@ export declare function generateCoverageReport(): string;
116
337
  */
117
338
  export declare function generateTranslationCode(lang: NiceSupportedLang, translations: TranslationResult[]): string;
118
339
 
340
+ /**
341
+ * Get all available timezones with their info.
342
+ */
343
+ export declare function getAllTimezones(lang?: NiceSupportedLang, referenceDate?: Date): TimezoneInfo[];
344
+
119
345
  /**
120
346
  * Get translation statistics for all languages.
121
347
  */
122
348
  export declare function getAllTranslationStats(): TranslationStats[];
123
349
 
350
+ /**
351
+ * Get all available calendar systems.
352
+ */
353
+ export declare function getAvailableCalendars(): CalendarSystem[];
354
+
355
+ /**
356
+ * Get calendar info with localized display name.
357
+ */
358
+ export declare function getCalendarInfo(calendar: CalendarSystem, lang?: NiceSupportedLang): CalendarInfo;
359
+
360
+ /**
361
+ * Get Chinese celestial stem for a year.
362
+ */
363
+ export declare function getCelestialStem(year: number): string;
364
+
365
+ /**
366
+ * Get Chinese zodiac animal for a year.
367
+ */
368
+ export declare function getChineseZodiac(year: number): string;
369
+
370
+ /**
371
+ * Get current date in a specific calendar system.
372
+ */
373
+ export declare function getCurrentCalendarDate(calendar: CalendarSystem, lang?: NiceSupportedLang): CalendarDate;
374
+
124
375
  /**
125
376
  * Get the current document direction.
126
377
  */
@@ -134,6 +385,21 @@ export declare function getGlossaryForLanguage(lang: NiceSupportedLang): Array<{
134
385
  translation: string;
135
386
  }>;
136
387
 
388
+ /**
389
+ * Get number of days in a Hijri month.
390
+ */
391
+ export declare function getHijriMonthDays(year: number, month: number): number;
392
+
393
+ /**
394
+ * Get the Japanese era for a given date.
395
+ */
396
+ export declare function getJapaneseEra(date: Date): JapaneseEra | null;
397
+
398
+ /**
399
+ * Get the Japanese year (era-relative) for a given date.
400
+ */
401
+ export declare function getJapaneseYear(date: Date): number | null;
402
+
137
403
  /**
138
404
  * Get the BCP 47 locale tag for a NiceSupportedLang code.
139
405
  */
@@ -150,6 +416,11 @@ export declare function getLogicalProperty(physical: string): string;
150
416
  */
151
417
  export declare function getMissingTranslations(lang: NiceSupportedLang): MissingTranslation[];
152
418
 
419
+ /**
420
+ * Get the next DST transition date for a timezone.
421
+ */
422
+ export declare function getNextDSTTransition(timezone: string, fromDate?: Date): Date | null;
423
+
153
424
  /**
154
425
  * Get ordinal category for a number in a given language.
155
426
  * e.g., English: 1st, 2nd, 3rd, 4th...
@@ -162,6 +433,16 @@ export declare function getOrdinalCategory(n: number, lang: NiceSupportedLang):
162
433
  */
163
434
  export declare function getPluralCategory(n: number, lang: NiceSupportedLang): PluralCategory;
164
435
 
436
+ /**
437
+ * Get preset options for common pseudo-localization modes.
438
+ */
439
+ export declare function getPseudoLocalizationPreset(mode: PseudoLocalizationMode): PseudoLocalizationOptions;
440
+
441
+ /**
442
+ * Get recommended calendars for a language.
443
+ */
444
+ export declare function getRecommendedCalendars(lang: NiceSupportedLang): CalendarSystem[];
445
+
165
446
  /**
166
447
  * Generate CSS custom property values for RTL support.
167
448
  */
@@ -177,6 +458,16 @@ export declare function getSourceKeys(): string[];
177
458
  */
178
459
  export declare function getTextDirection(lang: string): 'ltr' | 'rtl';
179
460
 
461
+ /**
462
+ * Get detailed information about a timezone.
463
+ */
464
+ export declare function getTimezoneInfo(timezone: string, lang?: NiceSupportedLang, referenceDate?: Date): TimezoneInfo;
465
+
466
+ /**
467
+ * Get timezones grouped by region.
468
+ */
469
+ export declare function getTimezonesGrouped(lang?: NiceSupportedLang, referenceDate?: Date): Record<string, TimezoneInfo[]>;
470
+
180
471
  /**
181
472
  * Get translation statistics for a language.
182
473
  */
@@ -188,11 +479,72 @@ export declare interface GlossaryEntry {
188
479
  context?: string;
189
480
  }
190
481
 
482
+ /**
483
+ * Hebrew month names.
484
+ */
485
+ export declare const HEBREW_MONTHS: string[];
486
+
487
+ /**
488
+ * Hebrew month names in leap year (includes Adar I and Adar II).
489
+ */
490
+ export declare const HEBREW_MONTHS_LEAP: string[];
491
+
492
+ export declare interface HebrewDate {
493
+ year: number;
494
+ month: number;
495
+ day: number;
496
+ }
497
+
498
+ /**
499
+ * Islamic month names (Arabic).
500
+ */
501
+ export declare const HIJRI_MONTHS: string[];
502
+
503
+ export declare interface HijriDate {
504
+ year: number;
505
+ month: number;
506
+ day: number;
507
+ }
508
+
509
+ /**
510
+ * Analyze a dictionary for i18n issues.
511
+ */
512
+ export declare interface I18nAnalysisResult {
513
+ totalKeys: number;
514
+ hardcodedStrings: string[];
515
+ emptyValues: string[];
516
+ placeholderMismatches: Array<{
517
+ key: string;
518
+ placeholders: string[];
519
+ }>;
520
+ potentialIssues: number;
521
+ }
522
+
191
523
  export declare interface ICUFormatOptions {
192
524
  lang?: NiceSupportedLang;
193
525
  locale?: string;
194
526
  }
195
527
 
528
+ /**
529
+ * Check if DST is active for a timezone at a given date.
530
+ */
531
+ export declare function isDSTActive(timezone: string, date?: Date): boolean;
532
+
533
+ /**
534
+ * Check if a Hebrew year is a leap year.
535
+ */
536
+ export declare function isHebrewLeapYear(year: number): boolean;
537
+
538
+ /**
539
+ * Check if a Hijri year is a leap year.
540
+ */
541
+ export declare function isHijriLeapYear(year: number): boolean;
542
+
543
+ /**
544
+ * Check if a Persian year is a leap year.
545
+ */
546
+ export declare function isPersianLeapYear(year: number): boolean;
547
+
196
548
  /**
197
549
  * Check if a language uses RTL text direction.
198
550
  */
@@ -201,6 +553,54 @@ export declare function isRTLLanguage(lang: string): boolean;
201
553
  /** Check if a language is supported. */
202
554
  export declare function isSupported(lang: string): lang is NiceSupportedLang;
203
555
 
556
+ /**
557
+ * Check if a timezone identifier is valid.
558
+ */
559
+ export declare function isValidTimezone(timezone: string): boolean;
560
+
561
+ /**
562
+ * Modern Japanese eras.
563
+ */
564
+ export declare const JAPANESE_ERAS: JapaneseEra[];
565
+
566
+ export declare interface JapaneseEra {
567
+ name: string;
568
+ kanji: string;
569
+ startDate: Date;
570
+ }
571
+
572
+ export declare interface LoaderConfig {
573
+ /** Function to load translation file for a language */
574
+ loadFn: (lang: NiceSupportedLang, namespace?: string) => Promise<TranslationDictionary>;
575
+ /** Fallback language if requested language fails */
576
+ fallbackLang?: NiceSupportedLang;
577
+ /** Cache TTL in milliseconds (0 = no expiry) */
578
+ cacheTtl?: number;
579
+ /** Languages to preload on init */
580
+ preloadLanguages?: NiceSupportedLang[];
581
+ /** Namespaces to split translations into */
582
+ namespaces?: string[];
583
+ /** Default namespace */
584
+ defaultNamespace?: string;
585
+ /** Callback when loading starts */
586
+ onLoadStart?: (lang: NiceSupportedLang, namespace?: string) => void;
587
+ /** Callback when loading completes */
588
+ onLoadComplete?: (lang: NiceSupportedLang, namespace?: string) => void;
589
+ /** Callback when loading fails */
590
+ onLoadError?: (lang: NiceSupportedLang, error: Error, namespace?: string) => void;
591
+ }
592
+
593
+ export declare interface LoaderState {
594
+ /** Currently loaded languages */
595
+ loadedLanguages: Set<NiceSupportedLang>;
596
+ /** Languages currently being loaded */
597
+ loadingLanguages: Set<NiceSupportedLang>;
598
+ /** Failed languages with error info */
599
+ failedLanguages: Map<NiceSupportedLang, Error>;
600
+ /** Current active language */
601
+ currentLanguage: NiceSupportedLang;
602
+ }
603
+
204
604
  /**
205
605
  * Look up a term in the glossary for a given language.
206
606
  * Returns the approved translation or undefined.
@@ -293,6 +693,11 @@ export declare function ordinal(n: number, forms: Partial<Record<OrdinalCategory
293
693
 
294
694
  export declare type OrdinalCategory = 'one' | 'two' | 'few' | 'other';
295
695
 
696
+ /**
697
+ * Persian month names.
698
+ */
699
+ export declare const PERSIAN_MONTHS: string[];
700
+
296
701
  /**
297
702
  * Type-safe plural helper.
298
703
  * Returns the appropriate form based on count.
@@ -303,6 +708,117 @@ export declare function plural(count: number, forms: Partial<Record<PluralCatego
303
708
 
304
709
  export declare type PluralCategory = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other';
305
710
 
711
+ export declare type PreloadStrategy = 'immediate' | 'idle' | 'visible' | 'interaction';
712
+
713
+ /**
714
+ * Preload languages based on strategy.
715
+ */
716
+ export declare function preloadWithStrategy(loader: DynamicLoader, languages: NiceSupportedLang[], strategy: PreloadStrategy): void;
717
+
718
+ export declare const PSEUDO_PRESETS: {
719
+ /** Minimal: brackets only */
720
+ readonly MINIMAL: {
721
+ readonly addBrackets: true;
722
+ readonly addAccents: false;
723
+ readonly expansionFactor: 0;
724
+ };
725
+ /** Accented: brackets + accents */
726
+ readonly ACCENTED: PseudoLocalizationOptions;
727
+ /** Expanded: brackets + 30% expansion */
728
+ readonly EXPANDED: PseudoLocalizationOptions;
729
+ /** Bidi: brackets + RTL markers */
730
+ readonly BIDI: PseudoLocalizationOptions;
731
+ /** Full: brackets + accents + expansion */
732
+ readonly FULL: PseudoLocalizationOptions;
733
+ /** Finnish: 40% expansion (Finnish is very long) */
734
+ readonly FINNISH: {
735
+ readonly addBrackets: true;
736
+ readonly addAccents: true;
737
+ readonly expansionFactor: 0.4;
738
+ };
739
+ /** German: 35% expansion */
740
+ readonly GERMAN: {
741
+ readonly addBrackets: true;
742
+ readonly addAccents: true;
743
+ readonly expansionFactor: 0.35;
744
+ };
745
+ /** CJK: Short expansion, no accents (CJK often shorter) */
746
+ readonly CJK: {
747
+ readonly addBrackets: true;
748
+ readonly addAccents: false;
749
+ readonly expansionFactor: -0.1;
750
+ };
751
+ };
752
+
753
+ export declare interface PseudoLocalizationContextValue {
754
+ enabled: boolean;
755
+ mode: PseudoLocalizationMode;
756
+ options: PseudoLocalizationOptions;
757
+ toggle: () => void;
758
+ setMode: (mode: PseudoLocalizationMode) => void;
759
+ transform: (text: string) => string;
760
+ }
761
+
762
+ export declare type PseudoLocalizationMode = 'accented' | 'bidi' | 'expansion' | 'full';
763
+
764
+ export declare interface PseudoLocalizationOptions {
765
+ /** Wrap text in brackets to identify translatable strings */
766
+ addBrackets?: boolean;
767
+ /** Add padding to simulate longer translations (common: 30-50%) */
768
+ expansionFactor?: number;
769
+ /** Replace characters with accented versions */
770
+ addAccents?: boolean;
771
+ /** Add RTL/LTR markers for bidi testing */
772
+ addBidiMarkers?: boolean;
773
+ /** Use vowel-doubling for expansion instead of padding */
774
+ useVowelDoubling?: boolean;
775
+ /** Preserve ICU placeholders like {name} */
776
+ preservePlaceholders?: boolean;
777
+ /** Preserve HTML tags */
778
+ preserveHtml?: boolean;
779
+ /** Custom prefix (instead of '[') */
780
+ prefix?: string;
781
+ /** Custom suffix (instead of ']') */
782
+ suffix?: string;
783
+ }
784
+
785
+ /**
786
+ * Provider for pseudo-localization in React apps.
787
+ * Useful for development/testing.
788
+ */
789
+ export declare function PseudoLocalizationProvider({ children, initialEnabled, initialMode, }: PseudoLocalizationProviderProps): JSX_2.Element;
790
+
791
+ export declare interface PseudoLocalizationProviderProps {
792
+ children: ReactNode;
793
+ initialEnabled?: boolean;
794
+ initialMode?: PseudoLocalizationMode;
795
+ }
796
+
797
+ /**
798
+ * Apply pseudo-localization transformations to text.
799
+ *
800
+ * @example
801
+ * // Basic usage
802
+ * pseudoLocalize('Hello World');
803
+ * // Returns: '[Ĥëľľő Ŵőřľð~~~]'
804
+ *
805
+ * @example
806
+ * // With ICU placeholders preserved
807
+ * pseudoLocalize('Hello {name}', { preservePlaceholders: true });
808
+ * // Returns: '[Ĥëľľő {name}~~~]'
809
+ *
810
+ * @example
811
+ * // Expansion only (no accents)
812
+ * pseudoLocalize('Hello', { addAccents: false, expansionFactor: 0.5 });
813
+ * // Returns: '[Hello~~]'
814
+ */
815
+ export declare function pseudoLocalize(text: string, options?: PseudoLocalizationOptions): string;
816
+
817
+ /**
818
+ * Pseudo-localize an entire translation dictionary.
819
+ */
820
+ export declare function pseudoLocalizeDictionary(dictionary: Record<string, string>, options?: PseudoLocalizationOptions): Record<string, string>;
821
+
306
822
  /**
307
823
  * CSS custom properties for RTL-aware components.
308
824
  * Use these as fallbacks in CSS-in-JS or CSS modules.
@@ -377,6 +893,68 @@ export declare function select<T extends string>(value: T, forms: Partial<Record
377
893
  */
378
894
  export declare function setDocumentDirection(lang: string): void;
379
895
 
896
+ export declare const TIMEZONE_GROUPS: {
897
+ readonly UTC: readonly ["UTC", "Etc/UTC", "Etc/GMT"];
898
+ readonly NorthAmerica: readonly ["America/New_York", "America/Chicago", "America/Denver", "America/Los_Angeles", "America/Toronto", "America/Vancouver", "America/Mexico_City"];
899
+ readonly SouthAmerica: readonly ["America/Sao_Paulo", "America/Buenos_Aires", "America/Lima", "America/Bogota", "America/Santiago"];
900
+ readonly Europe: readonly ["Europe/London", "Europe/Paris", "Europe/Berlin", "Europe/Rome", "Europe/Madrid", "Europe/Amsterdam", "Europe/Warsaw", "Europe/Moscow", "Europe/Kiev", "Europe/Stockholm", "Europe/Prague", "Europe/Budapest", "Europe/Bucharest"];
901
+ readonly Asia: readonly ["Asia/Tokyo", "Asia/Shanghai", "Asia/Hong_Kong", "Asia/Singapore", "Asia/Seoul", "Asia/Kolkata", "Asia/Dubai", "Asia/Riyadh", "Asia/Tehran", "Asia/Bangkok", "Asia/Jakarta"];
902
+ readonly Africa: readonly ["Africa/Cairo", "Africa/Lagos", "Africa/Johannesburg", "Africa/Nairobi", "Africa/Casablanca"];
903
+ readonly Oceania: readonly ["Australia/Sydney", "Australia/Melbourne", "Australia/Perth", "Pacific/Auckland", "Pacific/Fiji"];
904
+ };
905
+
906
+ export declare interface TimezoneFormatter {
907
+ /** Format date with timezone */
908
+ format: (date: Date) => string;
909
+ /** Format date with explicit timezone name */
910
+ formatWithZone: (date: Date) => string;
911
+ /** Get timezone offset for a date */
912
+ getOffset: (date: Date) => string;
913
+ /** Get timezone abbreviation for a date */
914
+ getAbbreviation: (date: Date) => string;
915
+ }
916
+
917
+ export declare interface TimezoneFormatterOptions {
918
+ /** Include timezone name in output */
919
+ includeName?: boolean;
920
+ /** Use short or long timezone name */
921
+ nameStyle?: 'short' | 'long';
922
+ /** Date format style */
923
+ dateStyle?: 'short' | 'medium' | 'long' | 'full';
924
+ /** Time format style */
925
+ timeStyle?: 'short' | 'medium' | 'long' | 'full';
926
+ }
927
+
928
+ export declare interface TimezoneInfo {
929
+ /** IANA timezone identifier (e.g., 'America/New_York') */
930
+ id: string;
931
+ /** Display name in the specified language */
932
+ displayName: string;
933
+ /** Short display name (e.g., 'EST', 'CET') */
934
+ shortName: string;
935
+ /** UTC offset in minutes */
936
+ offsetMinutes: number;
937
+ /** UTC offset as string (e.g., '+05:30') */
938
+ offsetString: string;
939
+ /** Whether DST is currently active */
940
+ isDST: boolean;
941
+ }
942
+
943
+ /**
944
+ * Convert a Gregorian date to a specific calendar system.
945
+ * Returns the date components in the target calendar.
946
+ */
947
+ export declare function toCalendar(date: Date, calendar: CalendarSystem, lang?: NiceSupportedLang): CalendarDate;
948
+
949
+ /**
950
+ * Convert a date to UTC.
951
+ */
952
+ export declare function toUTC(date: Date, fromTimezone?: string): Date;
953
+
954
+ export declare type TranslationDictionary = Record<string, string>;
955
+
956
+ export declare type TranslationNamespace = Record<string, TranslationDictionary>;
957
+
380
958
  export declare interface TranslationResult {
381
959
  key: string;
382
960
  original: string;
@@ -391,6 +969,38 @@ export declare interface TranslationStats {
391
969
  coverage: number;
392
970
  }
393
971
 
972
+ /**
973
+ * React hook for calendar formatting.
974
+ */
975
+ export declare function useCalendar(lang: NiceSupportedLang, calendar?: CalendarSystem, options?: CalendarFormatterOptions): {
976
+ calendar: CalendarSystem;
977
+ info: CalendarInfo;
978
+ current: CalendarDate;
979
+ format: (date: Date) => string;
980
+ formatWithEra: (date: Date) => string;
981
+ getMonthName: (date: Date) => string;
982
+ getMonthNames: () => string[];
983
+ getWeekdayName: (date: Date) => string;
984
+ getWeekdayNames: () => string[];
985
+ parseParts: (date: Date) => CalendarDate;
986
+ getEraName: (date: Date) => string | undefined;
987
+ toCalendar: (date: Date) => CalendarDate;
988
+ };
989
+
990
+ /**
991
+ * Hook to use dynamic i18n.
992
+ */
993
+ export declare function useDynamicI18n(): DynamicI18nContextValue;
994
+
995
+ /**
996
+ * Hook to get a translation function with dynamic loading.
997
+ */
998
+ export declare function useDynamicTranslation(namespace?: string): {
999
+ t: (key: string, params?: Record<string, string | number>) => string;
1000
+ isLoading: boolean;
1001
+ currentLanguage: "en" | "pl" | "de" | "fr" | "es" | "it" | "pt" | "nl" | "sv" | "no" | "da" | "fi" | "cs" | "sk" | "hu" | "ro" | "bg" | "uk" | "ja" | "ko" | "zh" | "ar";
1002
+ };
1003
+
394
1004
  /**
395
1005
  * Hook that returns true if current layout is RTL.
396
1006
  */
@@ -421,11 +1031,30 @@ export declare function useNiceTranslation(): {
421
1031
  t: NiceTranslateFn;
422
1032
  };
423
1033
 
1034
+ /**
1035
+ * Hook to use pseudo-localization.
1036
+ */
1037
+ export declare function usePseudoLocalization(): PseudoLocalizationContextValue;
1038
+
424
1039
  /**
425
1040
  * Hook to access RTL context and helpers.
426
1041
  */
427
1042
  export declare function useRTL(): RTLContextValue;
428
1043
 
1044
+ /**
1045
+ * React hook for timezone-aware formatting.
1046
+ */
1047
+ export declare function useTimezone(lang: NiceSupportedLang, timezone?: string, options?: TimezoneFormatterOptions): {
1048
+ timezone: string;
1049
+ info: TimezoneInfo;
1050
+ format: (date: Date) => string;
1051
+ formatWithZone: (date: Date) => string;
1052
+ getOffset: (date: Date) => string;
1053
+ getAbbreviation: (date: Date) => string;
1054
+ toUTC: (date: Date) => Date;
1055
+ fromUTC: (date: Date) => Date;
1056
+ };
1057
+
429
1058
  /**
430
1059
  * Validate translations against the glossary.
431
1060
  * Returns entries where the translation doesn't match the glossary.