Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Adobe Exam AD0-E720 Topic 8 Question 38 Discussion

Actual exam question for Adobe's AD0-E720 exam
Question #: 38
Topic #: 8
[All AD0-E720 Questions]

An Adobe Commerce developer is working on a custom knockout Ul component and they need to add the text Happy Birthday. to be translated inside an .html template.

How would the developer add the text?

Show Suggested Answer Hide Answer
Suggested Answer: B

To add the text Happy Birthday. to be translated inside an .html template, the developer should use the i18n binding. This binding allows the developer to specify the text as a string literal and translate it using the Magento translation mechanism. For example:

<span data-bind=''i18n: 'Happy Birthday.'''></span>

This will render the text as it is, or translate it if a translation file is available for the current locale. The i18n binding can also accept variables or expressions as arguments. For example:

<span data-bind=''i18n: name + ' Happy Birthday.'''></span>

This will render the text with the value of name variable, or translate it if a translation file is available for the current locale. The Mil8n and il8n bindings are not valid and will not work, as they are misspelled and do not match the knockout binding syntax. Reference: [Knockout bindings], [i18n binding]


Contribute your Thoughts:

Dong
14 hours ago
I'm not sure, but I think option C might also work for adding the text.
upvoted 0 times
...
Carrol
3 days ago
I agree with Laurene, option A is the correct way to add the text.
upvoted 0 times
...
Eric
5 days ago
Option B looks good too, but I'm not sure if the data-bind syntax is correct for translating a simple string like that.
upvoted 0 times
...
Ty
8 days ago
I think the correct answer is option C. Using the syntax to wrap the translated text seems like the most straightforward way to do it.
upvoted 0 times
...
Laurene
25 days ago
I think the developer should choose option A.
upvoted 0 times
...

Save Cancel