-
Notifications
You must be signed in to change notification settings - Fork 1
Translations
Translation will use resx files. That is the recommended way since it uses Xrm.Utility.getResourceString under the hood. When running the extractTranslations command a src/translation/locales/locales.resx file will be generated if not there. Please duplicate and rename for each required language to filenames like locales.1033.resx. When running the extractTranslations command again, all resx file keys will be updated.
When a project is created it contains resources for translations:
- src/translation/Translation.ts
- Command/script for extraction
CLI Command 'extractTranslations' extracts all translation from project TypeScript files. The TypeScript files using translations, needs to specify all translation files as dependencies. The Deploy command will do this job for you.
Running the extractTranslations command
hso-d365 extractTranslations
will extract translations from all Translation.translate invocations and puts them in src/translation/locales folder.
import {Translation} from '../translation/Translation';
export class EntityForm {
static async onLoad(executionContext: Xrm.Events.EventContext): Promise<void> {
console.log(Translation.translate('this will be translated');
}
}