I'm migrating an Angular project from 8.2.14 to the 9.0.0-rc.14. Using i18n for localization.
I followed the guide here https://update.angular.io/#8.2:9.0 and it feels it went fine. After the upgrade, I'm trying to run the project, but
ng serve
leads to the following error:
An unhandled exception occurred: An i18n locale ('en-US') cannot both be a source locale and provide a translation.
See "...my local logs path...\angular-errors.log" for further details.
In the angular-errors.log
the error is more detailed:
[error] Error: An i18n locale ('en-US') cannot both be a source locale and provide a translation.
at createI18nOptions (...my project path...\node_modules\@angular-devkit\build-angular\src\utils\i18n-options.js:69:23)
at Object.configureI18nBuild (...my project path...\node_modules\@angular-devkit\build-angular\src\utils\i18n-options.js:100:18)
at process._tickCallback (internal/process/next_tick.js:68:7)
I have got more details about the error: opening the @angular-devkit\build-angular\src\utils\i18n-options.js:69:23
and I see the following logic:
if (locale === i18n.sourceLocale) {
throw new Error(`An i18n locale ('${locale}') cannot both be a source locale and provide a translation.`);
}
I have en-US
locale and I want to continue using it as both translation and source. So how to fix this breaking error?