How to create your own text using the Inline Translation tool in Magento Enterprise

I created a piece of text in a Magento template, and the built-in translation tool is turned on and works fine, but when I visit a page using my custom text, it seems to ignore that it is being translated (without the book icon and the dashed red frame).

So here is what I have (approximately):

<div class="foo"> <?php echo $this->__('My custom Text'); ?> </div> 

Which does great, and if I edit the corresponding CSV file, it will change accordingly.

Is there a way to “add” this to a translation tool vector?

Thanks in advance!

+4
source share
1 answer

OK, To find the problem - for anyone who wants to use the built-in translation, follow these steps:

 <div class="foo"> <span> <?php echo $this->__('My custom Text'); ?> </span> </div> 

Valid broadcast embedded tags are listed here on line 87 of application / code / kernel /Mag/Kernel/Model/Translation/Inline.php ("_allowedTagsSimple"). Including a div here is crazy, but wrapping in gaps should be generally quite safe.

+10
source

Source: https://habr.com/ru/post/1387371/


All Articles