Skip to content

[i18n] how to best support a library author providing translations for their library #36757

Open

Description

@xiaoxiangmoe

We should discuss how to best support a library author providing translations for their library.

Activity

  1. added
    area: i18n
    on Apr 22, 2020
  2. added this to the needsTriage milestone on Apr 22, 2020
  3. petebacondarwin commented on Apr 22, 2020

    @petebacondarwin
    Contributor

    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.

  4. petebacondarwin commented on Apr 22, 2020

    @petebacondarwin
    Contributor

    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.

  5. xiaoxiangmoe commented on Apr 23, 2020

    @xiaoxiangmoe
    Author

    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?

  6. added
    feature
    on May 20, 2020
  7. modified the milestones: needsTriage, Backlog on May 20, 2020
  8. sorohan commented on Jul 17, 2020

    @sorohan

    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?

  9. 7 remaining items

  10. added
    P4
    and removed on Oct 1, 2020
  11. angular-robot commented on Jun 4, 2021

    @angular-robot
    Contributor

    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.

  12. angular-robot commented on Jun 24, 2021

    @angular-robot
    Contributor

    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.

  13. added
    feature: under consideration
    and removed on Jul 30, 2021
  14. added
    area: docs
    and removed on Nov 24, 2024
  15. added a commit that references this issue on Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4area: docsarea: i18nfeaturefeature: under considerationfreq1: low

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions