Translate pages

This commit is contained in:
Andras Schmelczer 2026-04-04 09:47:18 +01:00
parent a7aaf5effa
commit 96402228e3
49 changed files with 1458 additions and 926 deletions

View file

@ -0,0 +1,15 @@
import i18n from 'i18next';
/**
* Translate a server-derived value (feature name, enum value, group name, etc.).
* Looks up `server.${value}` in the current locale. Falls back to the original
* English string if no translation exists, so unknown values are safe.
*/
export function ts(value: string): string {
const key = `server.${value}`;
const result = i18n.t(key, { defaultValue: value });
return typeof result === 'string' ? result : value;
}
// Re-export tsDesc from descriptions.ts for convenience
export { tsDesc } from './descriptions';