14 lines
411 B
TypeScript
14 lines
411 B
TypeScript
import type { Localization } from '@/lib/localization';
|
|
import { en } from '@/locales/en';
|
|
import type { TranslationKey } from '@/types/localization';
|
|
|
|
export function notificationLabel(
|
|
t: Localization['t'],
|
|
group: string,
|
|
value: string,
|
|
fallback: string,
|
|
): string {
|
|
const key = `notifications.${group}.${value}`;
|
|
return Object.hasOwn(en, key) ? t(key as TranslationKey) : fallback;
|
|
}
|