locales.ts 703 B

123456789101112131415161718192021
  1. export type LocaleEntry = {
  2. code: string;
  3. /** Native name shown in dropdown, e.g. '简体中文' */
  4. label: string;
  5. /** Short label shown on the toggle button, e.g. 'CN' */
  6. shortLabel: string;
  7. };
  8. /**
  9. * Supported locales registry.
  10. *
  11. * To add a new language:
  12. * 1. Create `lib/i18n/locales/<code>.json` (copy an existing file as template)
  13. * 2. Add an entry here
  14. */
  15. export const supportedLocales = [
  16. { code: 'zh-CN', label: '简体中文', shortLabel: 'CN' },
  17. { code: 'en-US', label: 'English', shortLabel: 'EN' },
  18. { code: 'ja-JP', label: '日本語', shortLabel: 'JA' },
  19. { code: 'ru-RU', label: 'Русский', shortLabel: 'RU' },
  20. ] as const satisfies readonly LocaleEntry[];