File size: 1,756 Bytes
98fbc6d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import ar from '../ar/externalNotifications';
import br from '../br/externalNotifications';
import cs from '../cs/externalNotifications';
import de from '../de/externalNotifications';
import en from '../en/externalNotifications';
import es from '../es/externalNotifications';
import fr from '../fr/externalNotifications';
import gr from '../gr/externalNotifications';
import hu from '../hu/externalNotifications';
import id from '../id/externalNotifications';
import it from '../it/externalNotifications';
import ja from '../ja/externalNotifications';
import ko from '../ko/externalNotifications';
import nl from '../nl/externalNotifications';
import pl from '../pl/externalNotifications';
import ru from '../ru/externalNotifications';
import tr from '../tr/externalNotifications';
import uk from '../uk/externalNotifications';
import zhTW from '../zh-TW/externalNotifications';
import zh from '../zh/externalNotifications';
import type {
  NotificationLocale,
  EmailStrings,
  EventTextFn,
  PasswordResetStrings,
  NotificationEventKey,
} from './types';

export * from './types';

const LOCALES = {
  en,
  de,
  fr,
  es,
  hu,
  nl,
  br,
  cs,
  pl,
  ru,
  zh,
  'zh-TW': zhTW,
  it,
  tr,
  ar,
  id,
  ja,
  ko,
  uk,
  gr,
} satisfies Record<string, NotificationLocale>;

export const EMAIL_I18N: Record<string, EmailStrings> = Object.fromEntries(
  Object.entries(LOCALES).map(([k, v]) => [k, v.email]),
);

export const EVENT_TEXTS: Record<
  string,
  Record<NotificationEventKey, EventTextFn>
> = Object.fromEntries(Object.entries(LOCALES).map(([k, v]) => [k, v.events]));

export const PASSWORD_RESET_I18N: Record<string, PasswordResetStrings> =
  Object.fromEntries(
    Object.entries(LOCALES).map(([k, v]) => [k, v.passwordReset]),
  );