4

I have created 2 store views one for English and another for Persian and it works,but when I change website language, it converts only Magento phrases,

Actually, I want to convert all additional information, I tried using the language dictionary 'fa_IR.csv'(Persian dictionary) but that also affects only Magento prases.

How can I resolve it?

Thanks.

kaustubh borate
  • 367
  • 3
  • 12

2 Answers2

2

You need to create separate static blocks/cms-pages for each English and Persian store view.

Cms pages will show when we change store view.

Now, you can use below syntax to get store wise static blocks in phtml (template) file.

<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('block-english')->toHtml(); ?>
<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('block-persian')->toHtml();?>

Where block-english and block-persian are your block identifiers.

NOTE: Only 1 block will show to frontend depending upon store selection.

If you have any questions don't hesitate to ask.

Nitesh Kuyate
  • 2,108
  • 5
  • 25
  • 47
1

Create all static block separately for Persian storeview and then assign to Persian store. Also use below syntax for put static title in phtml file.

<?= /* @escapeNotVerified */ __('your text here') ?>
Swapan
  • 109
  • 2
  • 12