Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

how to directly add i18n key in my htl code

Avatar

Level 5

Hi,

 

I need to use i18n key in my htl for a text. How can I add it?

I added "${authorprofile.followme.default @i18n,context='html'}" b/w div class its not working. How should I add it?

 

Thank you

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @keerthana_hn 

 

Please try as below.

It will work in div also.

 

<div data-sly-test.default="${'authorprofile.followme.default' @ i18n}" />

 

Let me know if still any issue.

 

Hope that helps!!

Thanks

 

 

 

View solution in original post

3 Replies

Avatar

Community Advisor

Hi,

please find the example below :

 

<sly data-sly-test.emptyTitle="${'myproject.component.empty' @ i18n}" />

Arun Patidar

AEM LinksLinkedIn

Avatar

Community Advisor

Hi @keerthana_hn 

 sharing one example : ${'KEY_NAME' @i18n}

 

Thanks

Dipti

Avatar

Correct answer by
Employee Advisor

Hi @keerthana_hn 

 

Please try as below.

It will work in div also.

 

<div data-sly-test.default="${'authorprofile.followme.default' @ i18n}" />

 

Let me know if still any issue.

 

Hope that helps!!

Thanks