Extending the Platform Web Client

The Platform provides a mechanism for implementing translation of the web client using the ngx-translate library, the default language file is web/src/assets/i18n/en.json It is possible to customize strings or create a localized version for another language by duplicating this file structure, naming it accordingly and using it in AppComponent constructor like this:

export class AppComponent {
    constructor(translate: TranslateService, settingsService: GeneSettingsService) {
        // add the new language
        translate.addLangs(['fr','en']);
        // this language will be used as a fallback when a translation isn't found in the current language
        translate.setDefaultLang('en');
        
        // translations will be taken from web/src/assets/i18n/fr.json
        translate.use('fr');
        
        // Platform Settings
        settingsService.registerDefaultApplicationSettings( DEFAULT_APP_SETTINGS );
    }
}

The missing translation values from the file will fall back to the one provided by default by the Platform, and a warning will be emitted in the browser console with the missing keys.