Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

AEM internationalization with sightly using wildcards

Avatar

Level 1

I'm currently trying to use wildcards for a i18n string but what is particular to this string is that this has an anchor in it. I used the following line in sightly to accomplish this

${'This is a text with a <a href="{0}" target="_blank">link</a> inside of it'@i18n,format=['http://www.google.com'],context='html'}

So in this case according to the functionality of this this should look for the key in the dictionary and replace this with the string of the current locale.

The problem is that this is throwing a Parse exception, I'm guessing because the wildcard {0} is being used inside the tag and i need this to be this way since its a multilingual site. And the string can vary for each country. Also i need that if the string is not found in the dictionary the link should appear in that format as well.

Is there a workaround or am I missing something to make this work?

Thanks in advance.

0 Replies