This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

MissingTranslationStrategy

Use this enum at bootstrap as an option of bootstrapModule to define the strategy that the compiler should use in case of missing translations:

  • Error: throw if you have missing translations.
  • Warning (default): show a warning in the console and/or shell.
  • Ignore: do nothing.

See more...

      
      enum MissingTranslationStrategy {
  Error: 0
  Warning: 1
  Ignore: 2
}
    

Description

See the i18n guide for more information.

Members

Member Description
Error: 0
Warning: 1
Ignore: 2

Usage notes

Example

import { MissingTranslationStrategy } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; platformBrowserDynamic().bootstrapModule(AppModule, { missingTranslation: MissingTranslationStrategy.Error });
      
      import { MissingTranslationStrategy } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';

platformBrowserDynamic().bootstrapModule(AppModule, {
  missingTranslation: MissingTranslationStrategy.Error
});