db/translator
Documentation
- source: db/translator.ts
Overview
Classes
Translator
translateList()
Translates properties for a list of entities by querying the corresponding language table.
tsstatic translateList(list: any, language: string, basetTable: string): void;
Parameter Type Description listanyThe array of entities to be translated. languagestringThe target language code (e.g., 'en', 'de'). If undefined, no translation occurs. basetTablestringThe name of the base entity table (used to derive the language table name). Returns
- Type:
void- Description: The translated array of entities.
translateEntity()
Translates properties for a single entity by querying the corresponding language table.
tsstatic translateEntity(entity: any, id: any, language: string, basetTable: string): any;
Parameter Type Description entityanyThe entity object to be translated. idanyThe ID of the entity. languagestringThe target language code (e.g., 'en', 'de'). If undefined, no translation occurs. basetTablestringThe name of the base entity table. Returns
- Type:
any- Description: The translated entity object.
