Skip to content

Throw during i18n extraction if two different contents have the same @@id #18272

Closed

Description

@ocombe

I'm submitting a...

[x] Feature request

Current behavior

If you use custom ids for i18n translations and you have multiple elements with that custom id that have different contents, you will only get one translation extracted.
e.g.: <div i18n="@id">Hello world</div> and <div i18n="@id">Bye world</div>
Only the first one will be extracted, and they will both be replaced by the same content when you use translations, but will be different in the source language.

Expected behavior

We should throw an error, or at least print a warning when we extract if we have the same id for different contents.

What is the motivation / use case for changing the behavior?

Avoid errors.

Activity

  1. added
    area: i18nIssues related to localization and internationalization
    featureLabel used to distinguish feature request from other issues
    on Jul 21, 2017
  2. db6edr commented on Aug 8, 2017

    @db6edr

    Please highlight the same id for different contents thing. With the application I'm working on, we do have several elements with the same contents. For those, it must be possible to the use the same custom id without any warning.

  3. ocombe commented on Sep 19, 2017

    @ocombe
    ContributorAuthor

    Of course, this would only warn if the content is different

  4. added this to the Backlog milestone on Jan 23, 2018
  5. 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.

  6. 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.

  7. petebacondarwin commented on Jun 24, 2021

    @petebacondarwin
    Contributor

    Closing as we actually do now register warnings or errors for duplicate messages with different contents.

  8. angular-automatic-lock-bot commented on Jul 25, 2021

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  9. locked and limited conversation to collaborators on Jul 25, 2021
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

    area: i18nIssues related to localization and internationalizationfeatureLabel used to distinguish feature request from other issues

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions