You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[i18n] how to best support a library author providing translations for their library #36757
P4A relatively minor issue that is not relevant to core functionsarea: docsRelated to the documentationarea: i18nIssues related to localization and internationalizationfeatureLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationfreq1: low
We should discuss how to best support a library author providing translations for their library.
Reacted by Pete Bacon Darwin, Jim Barrett, Ben Sorohan, Samuel Fernández, pKrupaJunior, Prabhdeep Singh Batth, Yannick Beauchamp-H, francesco, Yuri Beliakov, Kirill Marchenko and 2 more
I am working on a PR that would support merging multiple translation files when translating an application. So if a library author provided a set of translation files it would be possible to combine them with the application translations.
This would then need to be integrated into the Angular CLI.
Further, we should look into how best to make this seamless. For instance agreeing on a file naming convention (or perhaps a property in package.json) that told the CLI where to look for such files.
Reacted by ZHAO Jin-Xiang, Jim Barrett and Ben Sorohan
I also have a PR in the works for doing $localize based i18n message extraction from distributable files. We need to ensure that we can avoid extracting messages that came from libraries and were bundled into the main.js for example.
We intend to use $localize within our libraries. One of the limitations we've run into at the moment is that there is no polyfills.ts for a library to add the import '@angular/localize/init';, so there is no global declaration of $localize, and building the library fails with:
Cannot find name '$localize'
We can work around this problem by redeclaring the global in the library and I've made a request here to have that in DT instead, to be able to add the following to the library's tsconfig:
"types": [
"@angular/localize"
],
But what is the intended way to inform typescript about the presence this global when there is no polyfills.ts?
Reacted by ZHAO Jin-Xiang, Igor Popov and Alan Asmis
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
P4A relatively minor issue that is not relevant to core functionsarea: docsRelated to the documentationarea: i18nIssues related to localization and internationalizationfeatureLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationfreq1: low
Activity
petebacondarwin commentedon Apr 22, 2020
I am working on a PR that would support merging multiple translation files when translating an application. So if a library author provided a set of translation files it would be possible to combine them with the application translations.
This would then need to be integrated into the Angular CLI.
Further, we should look into how best to make this seamless. For instance agreeing on a file naming convention (or perhaps a property in
package.json) that told the CLI where to look for such files.petebacondarwin commentedon Apr 22, 2020
I also have a PR in the works for doing
$localizebased i18n message extraction from distributable files. We need to ensure that we can avoid extracting messages that came from libraries and were bundled into themain.jsfor example.xiaoxiangmoe commentedon Apr 23, 2020
Can we use merging multiple translation files in angular 10?
I am currently using loadTranslations to solve the problem of multiple translation files.
By the way, is the dynamic switching of languages not supported by ivy?
sorohan commentedon Jul 17, 2020
We intend to use
$localizewithin our libraries. One of the limitations we've run into at the moment is that there is nopolyfills.tsfor a library to add theimport '@angular/localize/init';, so there is no global declaration of$localize, and building the library fails with:We can work around this problem by redeclaring the global in the library and I've made a request here to have that in DT instead, to be able to add the following to the library's tsconfig:
But what is the intended way to inform typescript about the presence this global when there is no
polyfills.ts?7 remaining items
angular-robot commentedon Jun 4, 2021
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation.
angular-robot commentedon Jun 24, 2021
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
Angular 19 update (#2786)