add i18n-id & keep i18n attributs on development mode
See original GitHub issueI’m submitting a…
[ x ] Feature request
Current
i18n
attributs are always removed from templates and we have path in xmb file to retrace where i18n attribut is used but we have not id in DOM when visiting app
Expected
Keep i18n
attributs when app is not on production
mode + add i18n-id="897897789678"
.
What is the motivation / use case for changing the behavior?
I think on developement mode we can kepp i18n on our html template because:
- we can select i18n attribut with CSS to let traductors know what is translatable/missing
- If we have an more attribut added like
i18n-id="897897789678"
we could listen onclick on each these attributs and open modal to translate text directly/instantly while visiting webapp. We already have meaning&description but that’s not enough (we have problems to translate our app french-german) this will avoid us maintain our “xmb->excel file” tool and avoid share xls file to traductor while he can just visit webapp and translate in place, and with id it is easy to find traduction in compiler output file messages.xmb - Angular create so many insignifiants attributs on production so why not theses for useful usecase only on developement mode. 😀
Environment
all
Others
see https://github.com/angular/angular/issues/11042 see https://github.com/angular/angular/issues/20055
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Angular internationalization serve in development mode
I have found a solution, there was a problem with build and serve section in angular.json configuration: here is the diff
Read more >Angular internationalization (i18n) tutorial - Localizely
To be able to localize content, we first need to add some. So, let's update the app component files. Adding the i18n attributes...
Read more >Internationalization - DEITY
FormFields can use its name attribute to build translation key for its label or placeholder based on translation context set via i18nId property...
Read more >Configure i18n with Angular 12 - Medium
Keep in mind that each language needs a different configuration, ... we will insert i18n attributes to mark text for translation.
Read more >The Ultimate Guide to Angular Localization | Phrase
We'll add a special i18n attribute to the <h1> element, ... serve or npm start our app will run in development mode with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Any developments on this one? I have almost exact use case, and am wondering if I will have to fork the compiler to make something like this work for us.
Your feature request seems reasonable… although it would not be enough IMO since this would require the translator to step through every part of the app in order to see all the potential translations. Be aware also that after v9 developers will also be able to create messages in code too using
$localize
tags. So these will not be available to the translated via browsing the pages of the app.