Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

HTL Formatting with HTML tags inside is not working

Avatar

Avatar
Validate 1
Level 2
jorgefdez205
Level 2

Likes

8 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
jorgefdez205
Level 2

Likes

8 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
jorgefdez205
Level 2

06-12-2016

Hi

 

I have a problem with the formatiing in HTL strings..... In my case this works:

<p>${"For more details see <b>Sale Conditions</b> and <b>Cats Terms and Conditions</b>" @ i18n, context='html'}</p>

and this works

${"For more details see {0} and {1}" @ i18n, context='html', format = ['Sale Conditions','Cats Terms and Conditions']}

but this one:

${"For more details see {0} and {1}" @ i18n, context='html',format = ['<b>Sale Conditions</b>','<b>Cats Terms and Conditions</b>']}

doesn't works!!!!! I getting this error :

<h1>Error during include of component '/apps/dog/components/cat'</h1><h3>Error Message:</h3>
<pre>org.apache.sling.api.scripting.ScriptEvaluationException: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.scripting.ScriptEvaluationException: org.apache.sling.scripting.sightly.SightlyException: Parsing error in template /apps/dog/components/cat.html at line 27: token recognition error at: '&quot;' for expression ${&quot;For more details see {0} and {1} . &quot; @ i18n, context='html', format = [&quot;</pre><h3>Processing Info:</h3>
<table style='font-family: monospace'>
<tr><td>Page</td><td>=</td><td>/content/trp/en/<td></tr><tr><td>Resource Path</td><td>=</td><td>/content/en/jcr:content/responsivegrid/<td></tr><tr><td>Cell</td><td>=</td><td>checkout-traveller-list-review<td></tr><tr><td>Cell Search Path</td><td>=</td><td>contentpage|page/responsivegrid/<td></tr><tr><td>Component Path</td><td>=</td><td>/apps/td></tr></table>
<h3>Sling Request Progress:</h3>
<pre>


Somebody help me!!!!

 

Thanks

Replies

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

06-12-2016

Avatar

Avatar
Validate 1
Level 2
jorgefdez205
Level 2

Likes

8 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
jorgefdez205
Level 2

Likes

8 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
jorgefdez205
Level 2

06-12-2016

Thanks smacdonald2008

I already spent a full day reading the specifications....

And no luck .....

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

06-12-2016

Why not use:

<p>${"For more details see <b>Sale Conditions</b> and <b>Cats Terms and Conditions</b>" @ i18n, context='html'}</p>

Avatar

Avatar
Validate 1
Level 2
jorgefdez205
Level 2

Likes

8 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
jorgefdez205
Level 2

Likes

8 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
jorgefdez205
Level 2

06-12-2016

Hi

Because the translation is not working with HTML tags inside (it's just show me the same English content never the Spanish one) .... and it will be hard for final users (content and translators) to edit HTML tags in theirs phrases ..... 

Thanks once again!!!!

Avatar

Avatar
Give Back
Level 1
Tekno
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Give Back
View profile

Avatar
Give Back
Level 1
Tekno
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Give Back
View profile
Tekno
Level 1

03-03-2020

Hi smacdonald2008,

                     

I am using the below code for translate the English to other language through i18n

1 > ${"{0}" @i18n, format=[properties.questionAnswer],context='html'}

2 > ${properties.questionAnswer @ i18n, context='html'}

But this is not working for me.

 

When i am using the below code it is working fine for me
${"Hello World" @ i18n, context='html'}

So is there any way to use the i18n for RTE (Rich Text ).