Files
srbhr--resume-matcher/apps/frontend/lib/i18n/server.ts
T
wehub-resource-sync 5bdf4cc89a
Publish Docker Image / publish (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:39:36 +08:00

14 lines
467 B
TypeScript

import type { Locale } from '@/i18n/config';
import { getMessages as getMessagesForLocale } from './messages';
import { applyParams, getNestedValue } from './utils';
export function translate(
locale: Locale,
key: string,
params?: Record<string, string | number>
): string {
const messages = getMessagesForLocale(locale);
const translation = getNestedValue(messages as unknown as Record<string, unknown>, key);
return applyParams(translation, params);
}