how can I change "AED - United Arab Emirates Dirham" to "AED - UAE Dirham" in Luma currency switcher?

I created en_US.csv file in my custom theme > i18n folder and added "united Arab Emirates" in the 1st column and "UAE" in the 2nd column. But still not working.

enter image description here

有帮助吗?

解决方案

Override currency.phtml file in your theme

app/design/frontend/{vendore}/{theme}/Magento_Directory/templates/currency.phtml

Change line number 35

<?= $block->escapeHtml($_code) ?> - <?= $block->escapeHtml($_name) ?>

to

<?= __($block->escapeHtml($_code)) ?> - <?= __($block->escapeHtml($_name)) ?>

Create app/design/frontend/{vendore}/{theme}/i18n/en_US.csv file and write below code

"United Arab Emirates Dirham","UAE Dirham"

Change line number 28

<?= $block->escapeHtml($currentCurrencyCode) ?> - <?= @$block->escapeHtml($currencies[$currentCurrencyCode]) ?>

to

<?= __($block->escapeHtml($currentCurrencyCode)) ?> - <?= __(@$block->escapeHtml($currencies[$currentCurrencyCode])) ?>

I hope it's useful for you.

许可以下: CC-BY-SA归因
scroll top