question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add i18n-id & keep i18n attributs on development mode

See original GitHub issue

I’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". image

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

I think on developement mode we can kepp i18n on our html template because:

  1. we can select i18n attribut with CSS to let traductors know what is translatable/missing
  2. 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
  3. 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:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
kasperstorgaardcommented, Jun 18, 2018

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.

1reaction
petebacondarwincommented, Oct 30, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found