feature request: Allow custom id generation for i18n tags

This issue has been created 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-10-04
Star Count 84139
Watcher Count 3064
Fork Count 22243
Issue Count 1206

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
请问这个能够进行一个或者多个定时任务吗? 2 2022-03-17 2022-09-22
大佬,学习写NODEJS脚本该从哪里入手呢 1 2022-01-12 2022-09-22
这个是自动打开的吗 为什么我搭建了服务端 你必须点一下他才打开 而且每次都要填写位置信息 或者二维码信息 1 2022-04-01 2022-09-22
账户密码登陆后显示身份过期,请手动填写用户名密码。每次都这样 4 2022-04-06 2022-09-22
is the pytorch backend differentiable? 2 2022-04-17 2022-09-14
Switch from the current stowing system to a deb system. 2 2022-01-17 2022-08-04
Updates to forc-documenter for mdbook 0 2022-06-06 2022-09-17
When you have a long set name, it overlaps with the checkbox 0 2022-09-23 2022-09-26
[120-rc1]: Renaming token groups causes them to collapse 0 2022-09-12 2022-09-26
[Security] Workflow stale.yml is using vulnerable action actions/stale 3 2021-12-20 2022-08-01
Option to add prefix to devices when listed in HK 1 2021-12-13 2022-09-02
Void RGB Elite Wireless wrong battery level 0 2021-05-13 2022-09-27
Unable to generate SSL certificate with open port 443 0 2022-09-11 2022-09-20
Android: crash on API 21 in ListView 0 2022-02-08 2022-06-29
Android: "userinterfacestyle" event not working correctly 0 2022-02-09 2022-06-29
Android: Overriding user interface style does not work properly 5 2022-02-10 2022-09-29
Mac OS 不支持? 1 2020-05-28 2022-01-16
Websocket depthcache 100ms 1 2022-05-01 2022-09-27
Open, Save, and Save All buttons seem ambiguous (up is open, down is save) 3 2021-12-02 2022-09-22
[Bug][Jupyter Widget] - Unable to Render the Map (Without Data Too) : Jupyter Notebook 13 2021-08-28 2022-08-23
List of possible authorized client applications only lists AAD ID for Teams 4 2022-08-31 2022-08-30
Dropdown: fix accessibility fail 1 2021-11-30 2022-09-02
Total Upload/Download stat reset at every rtorrent restart 4 2021-05-21 2022-09-18
Make bionic GA stemcell the default stemcell 0 2021-05-06 2022-09-25
Porting Jakarta EE Tutotial from release 9.1 to release 10. 0 2022-01-21 2022-09-06
RUSTSEC-2020-0146: arr! macro erases lifetimes 0 2021-03-02 2022-09-15
class 'java.util.ArrayList' to class 'org.gradle.api.NamedDomainObjectContainer' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: 3 2020-06-29 2022-09-08
Add `UpgradeTimeout` to `04-channel` protobuf definitions 1 2022-06-29 2022-09-24
mouse/keyboard emulation not working with Raspbian OS buster/bullseye 2 2022-01-18 2022-09-13
get each word timestamp 1 2019-02-01 2022-09-22
BMI270 drivers support for omnibusf4sd 4 2022-06-08 2022-09-01
Ability to open a DatePicker programmatically 7 2021-09-20 2022-09-14
README: project description unclear (Docker CE and Docker EE) 0 2021-08-31 2022-09-24
Document HWB support in sass:color 0 2020-09-18 2022-09-13
freq error: freq must be Day, BDay or CustomBusinessDay 1 2020-07-29 2022-09-02
Problem with pyramid.arima 1 2019-08-14 2022-09-17
Corrupted result of hardware accelerated encoding (VCE) 2 2022-08-12 2022-09-16
Add Codec: AOMedia's AV1 Video (av01) 3 2022-08-11 2022-09-16
Limit viewfinder image size by the preview window capabilities 2 2021-08-18 2022-08-08
Improve support for nested exceptions with stacktraces 2 2022-02-16 2022-09-23
`await for (final _ in stream)` for `Stream<void>` results in build error 2 2022-02-08 2022-09-23
About LSTM 2 2020-09-09 2022-01-08
Bug with const ptr struct members 3 2018-05-21 2022-09-16
Keep window on top 1 2018-08-15 2022-01-01
Support ARM platform 73 2019-10-09 2022-10-02
Cannot export png of GANTT with an issue containing in single quote 2 2020-06-05 2022-09-25
Active Mailer / Active Jobs 14 2018-05-18 2022-09-15
feat: As a User, I want to one consumer has multi ak&sk 0 2022-03-07 2022-08-04
fixed error getting connection from pool 0 2014-11-20 2022-08-14
Missing "Apply the migration to the existing database" 0 2022-08-10 2022-08-19