index.ts 377 B

12345678910111213
  1. import i18n from './config';
  2. export { type Locale, defaultLocale } from './types';
  3. export { type LocaleEntry, supportedLocales } from './locales';
  4. export type TranslationKey = string;
  5. export function translate(locale: string, key: string): string {
  6. return i18n.t(key, { lng: locale });
  7. }
  8. export function getClientTranslation(key: string): string {
  9. return i18n.t(key);
  10. }