New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
target-language was not needed in VE but seems to be required on Ivy i18n #33323
Comments
We discussed this in the tooling sync and concluded that if the xliff spec doesn't require the language to be specified inline, we should not require it as otherwise we'd be making existing translation files without the property incompatible. Instead, we should allow for the locale id / language id to be set via a command line flag. And error only if it was not provided inline or on the command line. The CLI already passes the locale info into the localize code, so no special work is needed on the CLI side. |
I will deal with this in the next few days but not in time for RC. |
Previously the target locale of a translation file had to be extracted from the contents of the translation file. Now an array of locales can be provided via the `translationFileLocales` option that overrides any target locale extracted from the file. This allows us to support translation files that do not have a target locale specified in their contents. // FW-1644 Fixes angular#33323
Previously the target locale of a translation file had to be extracted from the contents of the translation file. Therefore it was an error if the translation file did not provide a target locale. Now an array of locales can be provided via the `translationFileLocales` option that overrides any target locale extracted from the file. This allows us to support translation files that do not have a target locale specified in their contents. NOTE to early adopters: if you were using `TranslationParser`s directly then the return type for the `parse()` method has changed. The properties of the returned object changed from: ``` interface TranslationBundle { locale: string; translations: Record<ɵMessageId, ɵParsedTranslation>; } ``` to ``` interface ParsedTranslationBundle { parsedLocale: string|undefined; parsedTranslations: Record<ɵMessageId, ɵParsedTranslation>; } ``` // FW-1644 Fixes angular#33323
Previously the target locale of a translation file had to be extracted from the contents of the translation file. Therefore it was an error if the translation file did not provide a target locale. Now an array of locales can be provided via the `translationFileLocales` option that overrides any target locale extracted from the file. This allows us to support translation files that do not have a target locale specified in their contents. NOTE to early adopters: if you were using `TranslationParser`s directly then the return type for the `parse()` method has changed. The properties of the returned object changed from: ``` interface TranslationBundle { locale: string; translations: Record<ɵMessageId, ɵParsedTranslation>; } ``` to ``` interface ParsedTranslationBundle { parsedLocale: string|undefined; parsedTranslations: Record<ɵMessageId, ɵParsedTranslation>; } ``` // FW-1644 Fixes angular#33323
Previously the target locale of a translation file had to be extracted from the contents of the translation file. Therefore it was an error if the translation file did not provide a target locale. Now an array of locales can be provided via the `translationFileLocales` option that overrides any target locale extracted from the file. This allows us to support translation files that do not have a target locale specified in their contents. // FW-1644 Fixes angular#33323
Previously the target locale of a translation file had to be extracted from the contents of the translation file. Therefore it was an error if the translation file did not provide a target locale. Now an array of locales can be provided via the `translationFileLocales` option that overrides any target locale extracted from the file. This allows us to support translation files that do not have a target locale specified in their contents. // FW-1644 Fixes angular#33323
Previously the target locale of a translation file had to be extracted from the contents of the translation file. Therefore it was an error if the translation file did not provide a target locale. Now an array of locales can be provided via the `translationFileLocales` option that overrides any target locale extracted from the file. This allows us to support translation files that do not have a target locale specified in their contents. // FW-1644 Fixes angular#33323
Previously the target locale of a translation file had to be extracted from the contents of the translation file. Therefore it was an error if the translation file did not provide a target locale. Now an array of locales can be provided via the `translationFileLocales` option that overrides any target locale extracted from the file. This allows us to support translation files that do not have a target locale specified in their contents. // FW-1644 Fixes angular#33323
Previously the target locale of a translation file had to be extracted from the contents of the translation file. Therefore it was an error if the translation file did not provide a target locale. Now an array of locales can be provided via the `translationFileLocales` option that overrides any target locale extracted from the file. This allows us to support translation files that do not have a target locale specified in their contents. // FW-1644 Fixes angular#33323
…ngular#33381) Previously the target locale of a translation file had to be extracted from the contents of the translation file. Therefore it was an error if the translation file did not provide a target locale. Now an array of locales can be provided via the `translationFileLocales` option that overrides any target locale extracted from the file. This allows us to support translation files that do not have a target locale specified in their contents. // FW-1644 Fixes angular#33323 PR Close angular#33381
…ngular#33381) Previously the target locale of a translation file had to be extracted from the contents of the translation file. Therefore it was an error if the translation file did not provide a target locale. Now an array of locales can be provided via the `translationFileLocales` option that overrides any target locale extracted from the file. This allows us to support translation files that do not have a target locale specified in their contents. // FW-1644 Fixes angular#33323 PR Close angular#33381
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 bug report
Affected Package
The issue is caused by package @angular/localizeIs this a regression?
NoDescription
target-language
was not needed in VE but seems to be required on Ivy.@clydin looked into this and it seems like the xliff 1.2 parser lists it as optional in http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html.
But
@angular/localize
will throw if it's not there:angular/packages/localize/src/tools/src/translate/translation_files/translation_parsers/xliff1/xliff1_translation_parser.ts
Line 56 in ec482da
@petebacondarwin can you shed some light on this? Is this intended, and if so, is there documentation telling users they must do it?
🔬 Minimal Reproduction
The e2e test in angular/angular-cli#15913
🔥 Exception or Error
🌍 Your Environment
Angular Version:
Anything else relevant?
The text was updated successfully, but these errors were encountered: