Skip to main content

Config Options

Below is a list of the config options and their usages:


Applications that don't allow the user to change the language in runtime (i.e., from a dropdown), should leave it false. It can save on memory by rendering the view once and unsubscribing from the language changes event (defaults to false):

translocoConfig({  reRenderOnLangChange: boolean})


Sets the default language: (defaults to en)

translocoConfig({  defaultLang: 'en'})


Sets the default language/s to use as a fallback. See the TranslocoFallbackStrategy section if you need to customize it:

translocoConfig({  fallbackLang: 'en',  fallbackLang: ['en', 'ru']})


How many time should Transloco retry to load translation files, in case of a load failure (defaults to 2):

translocoConfig({  failedRetries: 1})


Whether the application runs in production mode: (defaults to false)
When enabled, Transloco will disable all console warnings.

import { environment } from '../environments/environment';
translocoConfig({  prodMode: environment.production})


The available languages in your application:

translocoConfig({  availableLangs: ['en', 'es']})


Whether to allow empty values: (defaults to false)

translocoConfig({  missingHandler: {    allowEmpty: true  }})


Whether to use the fallback language for missing keys or values: (defaults to false)

translocoConfig({  fallbackLang: 'en',  missingHandler: {    // It will use the first language set in the `fallbackLang` property    useFallbackTranslation: true  }})


Whether to console.warn a missing key: (defaults to true)

translocoConfig({  missingHandler: {    logMissingKey: false  }})


Check the optimization plugin:

import { environment } from '../environments/environment';
translocoConfig({  flatten: {    aot: environment.production  }})


The start and end markings for parameters: (defaults to ['{{', '}}'])

translocoConfig({  // This will enable you to specify parameters as such: `"Hello <<<value>>>"`   interpolation: ['<<<', '>>>']})