feat(ivy): i18n - render legacy message ids in $localize
if requested (#32937)
The `$localize` library uses a new message digest function for computing message ids. This means that translations in legacy translation files will no longer match the message ids in the code and so will not be translated. This commit adds the ability to specify the format of your legacy translation files, so that the appropriate message id can be rendered in the `$localize` tagged strings. This results in larger code size and requires that all translations are in the legacy format. Going forward the developer should migrate their translation files to use the new message id format. PR Close #32937
This commit is contained in:

committed by
atscott

parent
fc28b266cd
commit
bcbf3e4123
@ -161,6 +161,19 @@ export interface CompilerOptions extends ts.CompilerOptions {
|
||||
// (used by Closure Compiler's output of `goog.getMsg` for transition period)
|
||||
i18nUseExternalIds?: boolean;
|
||||
|
||||
/**
|
||||
* Render `$localize` message ids with the specified legacy format (xlf, xlf2 or xmb).
|
||||
*
|
||||
* Use this option when use are using the `$localize` based localization messages but
|
||||
* have not migrated the translation files to use the new `$localize` message id format.
|
||||
*
|
||||
* @deprecated
|
||||
* `i18nLegacyMessageIdFormat` should only be used while migrating from legacy message id
|
||||
* formatted translation files and will be removed at the same time as ViewEngine support is
|
||||
* removed.
|
||||
*/
|
||||
i18nLegacyMessageIdFormat?: string;
|
||||
|
||||
// Whether to remove blank text nodes from compiled templates. It is `false` by default starting
|
||||
// from Angular 6.
|
||||
preserveWhitespaces?: boolean;
|
||||
|
Reference in New Issue
Block a user