Skip to content

Latest commit

 

History

History
45 lines (30 loc) · 3.37 KB

File metadata and controls

45 lines (30 loc) · 3.37 KB

MIGRATION GUIDE

Migration guide to angular-l10n v9 for Angular v9

angular-l10n v9 is basically a new library built on top of new Angular Ivy's view engine. The best way to upgrade from a previous version is to follow the new README step by step.

  • Update Configuration: except for boolean cache, fallback and defaultRouting, all other attributes are required.

  • Customize services: the services offer only the basic functionalities, and according to the needs you have to customize them by implementing the class-interface and passing the token during the configuration. If you are using json files or a Web API, you have to implement L10nTranslationLoader class-interface.

  • Update Pure pipes:

    • translate pipe: no changes
    • l10nDate now it uses Intl.DateTimeFormatOptions
    • l10nDecimal, l10nPercent and l10nCurrency are now l10nNumber pipe, that uses Intl.NumberFormatOptions

    Language, DefaultLocale, Currency and Timezone decorators are no longer available, and you must replace them with the injection token L10N_LOCALE.

    Also extended classes such as Translation and Localization are no longer available, but you can easily implement your own superclass by providing the L10nlocale.

  • Update Directives:

    • l10nTranslate directive: no changes
    • l10nDate now it uses Intl.DateTimeFormatOptions
    • l10nDecimal, l10nPercent and l10nCurrency are now l10nNumber directive, that uses Intl.NumberFormatOptions
  • Update APIs: all the translation APIs are now provided by L10nTranslationService. The APIs for localizing dates and numbers are provided by the new class L10nIntlService.

  • Update Validation: the new validation is only a skeleton that needs to be customized. You can find an example in the sample app. The old LocaleValidation class is still available here

Lazy loading

forChild method is no longer supported. Use a resolver as explained here

SEO

Except for routing, translation of title and meta tags, as well as JSON-LD, are no longer available. However, these classes and components are still available in the old branch:

Locale interceptor

This is no longer available. You can find the old class here

Resources