@o3r/localization
v14.5.1
Published
This module provides a runtime dynamic language/translation support and debug tools.
Readme
This package is an Otter Framework Module.
[!WARNING] ngx-translate will no longer be supported in Otter v16. Please migrate to
@o3r/transloco, which is based on JSVerse Transloco.
Description
The localization module is built on top of an open source ngx-translate library. It provides the following features:
- Multiple locales support, switchable at runtime.
- RTL (right-to-left) text direction support
- Translations loader using a specific endpoint or defaulting to local translation bundles
- Fallback language and intelligent fallback support
- Translation of resource keys from templates (
*.html) and from typescript (*.ts) - Support for resource keys with parameters
- Custom
LocalizationConfiguration - Ability to toggle translations on and off for debugging (and additional debug tools)
How to install
ng add @o3r/localization[!WARNING] This module requires @o3r/core to be installed.
Generators
Otter framework provides a set of code generators based on Angular schematics.
| Schematics | Description | How to use |
|-------------------------------|-------------------------------------------------------------|--------------------------------------|
| add | Include Otter localization module in a library/application. | ng add @o3r/localization |
| localization-to-component | Add localization architecture to an Otter component | ng g localization-to-component |
| localization-key-to-component | Add a localization key to an Otter component | ng g localization-key-to-component |
More details
Find more information in the documentation.
