Question

I'm building an online store using Magento version 2.1.8. I've created a Luma child-theme.

Magento offers CSV files for translating most of it. But the minicart uses JavaScript for the text strings within it.

enter image description here

How can I overwrite the default English text, for Romanian?

Was it helpful?

Solution

For JS translate you must create language pack with below files.

/app/i18n/Myshop/ro_ro/language.xml:

<?xml version="1.0"?>
<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd">
    <code>ro_RO</code>
    <vendor>Myshop</vendor>
    <package>ro_ro</package>
</language>

/app/i18n/Myshop/ro_ro/registration.php:

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
    'myshop_ro_ro',
    __DIR__
);

/app/i18n/Myshop/ro_ro/ro_RO.csv with your translates (examples):

"Cart Subtotal:","Costul mărfurilor:"
"Go to Checkout","Du-te la checkout"
...

For apply your store must use Romanian locale, of course. JS translates are stored in /pub/static/frontend/Myshop/Mytheme/ro_RO/js-translation.json.

Remove this file for refresh, clear cache and browser local storage. Enjoy!

OTHER TIPS

Hello Evgeny Levinsky I have similar issue with italian language. But I'm not understanding where exactly I should create the files which you explained in the above answer. My theme files are stored in following location app/design/frontend/TemplateMonster/theme055 inside that one i18n directory is there but inside that only csv files are there. Should i create inside that or should I create new directory as following app/i18n/TemplateMonster/theme055

Please help about this. this is little urgent.

Thank You, Kishan

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top