ExamGecko
Question list
Search
Search

Question 14 - AD0-E711 discussion

Report
Export

Which two actions will the developer need to take to translate strings added in JS files? (Choose two.)

A.
$.trans( '<string>')
Answers
A.
$.trans( '<string>')
B.
$.image._C<string>');
Answers
B.
$.image._C<string>');
C.
translate('<string>'); define (( 'jquery1,
Answers
C.
translate('<string>'); define (( 'jquery1,
D.
'mage/Translate' 1, function ($, $t) {...});
Answers
D.
'mage/Translate' 1, function ($, $t) {...});
Suggested answer: A, D

Explanation:

To translate strings added in JS files in Magento, you should use the following two actions:

1. $.trans('<string>') - This function is a shorthand for translating strings in JavaScript.

2. 'mage/Translate', function ($, $t) {...} - This method is used to include the Magento translation component in your JavaScript and then use the $t function to translate strings.

asked 02/10/2024
Kohsuke Shimizu
35 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first