0

I'm running Magento 2 in developer mode, but I need to translate the error message:

Provided Zip/Postal Code seems to be invalid. Example: 1234 AB/1234AB. If you believe it is the right one you can ignore this notice.

So I created the string in app/design/frontend/Mgs/claue/i18n/nl_NL.csv

I run the following commands:

  1. bin/magento setup:upgrade

  2. bin/magento setup:static-content:deploy -f nl_NL

  3. bin/magento cache:flush

  4. bin/magento cache:clean

After that I wait till the static files will be created and look into: pub/static/frontend/Mgs/claue/nl_NL/i18n

And there is only 1 file: en_US.csv and not nl_NL.csv

How is that possible? Is there another way to translate that string?

UPDATE: It's registered in vendor/magento/language-nl_nl/registration.php

<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::LANGUAGE,'magento_nl_nl', __DIR__);

Magento version: 2.3.0

4
  • Have you registered your language file?
    – aravind
    Nov 12, 2019 at 10:45
  • @aravind Yes, it's in vendor/magento/language-nl_nl/registration.php
    – n00bly
    Nov 12, 2019 at 11:25
  • To override you need to register your lanugage again in your theme app/i18n/Vendor/nl_nl
    – aravind
    Nov 12, 2019 at 11:36
  • Hi @aravind, I have no idea how to do that...
    – n00bly
    Nov 12, 2019 at 12:19

1 Answer 1

0

app/i18n/DesignVendor/nl_nl/registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
    'designvendor_nl_nl',
    __DIR__
);

app/i18n/DesignVendor/nl_nl/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>nl_NL</code>
    <vendor>designvendor</vendor>
    <package>nl_nl</package>
</language>

Then You can copy your csv file from vendor and paste in

app/i18n/DesignVendor/nl_nl/nl_NL.csv

You can download module from here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.