Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

204
Views
How to use anguluar i18n in html template with variables?

Is it possible to use variables in an angular template i18n string?

In TypeScript I can use template string, eg:

public welcomeMessage = $localize`:@@test.welcome: Hello ${this.name}:user_name:! How's your day?`;

Can I use something similar in html templates? eg

<p i18n="@@test.welcome">Hello {{name}}:user_name:! How's your day?</p>

Hope you get my point.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I've ran into the same issue and the Angular i18n documentation is somewhat unclear about interpolation and naming the interpolated placeholder. For simple text interpolation you can just use:

<p i18n>Hello {{name}}! How's your day?</p>

But AFAIK there is currently no way of naming the interpolated placeholder, it will just end up being the interpolated text:

<source>Hello <x id="INTERPOLATION" equiv-text="{{name}}"/>! How&apos;s your day?</source>

However, you could always change the placeholder (equiv-text) manually in the extracted XLIFF file.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!