nerdexam
Magento

M70-301 · Question #59

Using Magentos JavaScript translator object, which is the correct option for translating JavaScript strings within a.phtml file?

The correct answer is D. Translator-add({"To be translated":"<?php echo $this->_('To be translated'); ? >"}). See the full explanation below for the reasoning.

Question

Using Magentos JavaScript translator object, which is the correct option for translating JavaScript strings within a.phtml file?

Options

  • ATranslator.newTranslation({"To be translated":"Translated Copy Here"});
  • BTranslator.add("To be translated");
  • CTranslate({"To be translated","<?php echo $this->__(`To be translated'); ?>"});
  • DTranslator-add({"To be translated":"<?php echo $this->_('To be translated'); ? >"});

How the community answered

(52 responses)
  • A
    4% (2)
  • B
    10% (5)
  • C
    2% (1)
  • D
    85% (44)

Community Discussion

No community discussion yet for this question.

Full M70-301 Practice