Magento 2.3.5 - Inline Translate within a CMS Block
-
13-04-2021 - |
Pergunta
I'm running a multi website and store setup. I'm trying to use inline translation within a CMS block so I don't have to create multiple blocks for different stores.
For example I'm using this within a CMS block to enable inline translation.
<h1 class="hero-h1"><?php echo __('Welcome to this website') ?></h1>
However it doesn't appear on the page, when I inspect element it shows as
<h1 class="hero-h1"><!--?php echo __('Welcome to this website') ?--></h1>
Is there anyway text can be inline translated in a CMS Block?
Solução
php translate will not work in static block
you need to add like:
<h1 class="hero-h1">{{trans "Welcome to this website" }}</h1>
You can add translation as per link
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange