Translate pages
This commit is contained in:
parent
a7aaf5effa
commit
96402228e3
49 changed files with 1458 additions and 926 deletions
15
frontend/src/i18n/server.ts
Normal file
15
frontend/src/i18n/server.ts
Normal 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';
|
||||
Loading…
Add table
Add a link
Reference in a new issue