feature request: Allow custom id generation for i18n tags

This issue has been tracked since 2022-09-14.

Which @angular/* package(s) are relevant/related to the feature request?

localize

Description

Currently, when adding i18n tags to our code, the resuting extrated messages have unique, but random IDs.
With this, it is difficult to look back our source code and understand the context of the text to be translated.
We currently override this by adding ID ourselves, whcih usually include the file name, allowing us to find the context faster.

Ideally we would like to, either define a generator function for IDs, which would take some arguments for context (filename, linenumber, element type,...), or allow a way to include the file name in the generated ID, as a default.

Proposed solution

We currently override this by adding ID ourselves, whcih usually include the file name, allowing us to find the context faster.

Ideally we would like to, either define a generator function for IDs, which would take some arguments for context (filename, linenumber, element type,...).

Alternatives considered

Allow a way to include the file name in the generated ID, as a default.

AndrewKushnir wrote this answer on 2022-09-21

@kertof thanks for creating a feature request. We've discussed this question with the team and the current state is that we do not plan to provide a config option to change a built-in message ID generator with a custom one. We believe that having file/folder names in the message ID might make it unstable and brittle.

More Details About Repo
Owner Name angular
Repo Name angular
Full Name angular/angular
Language TypeScript
Created Date 2014-09-18
Updated Date 2022-09-30
Star Count 84091
Watcher Count 3064
Fork Count 22233
Issue Count 1203

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date