1

Tried to translate the "newsletter"-module by creating the "uk_UA.csv" in the directory "app/code/Magento/Newsletter/i18n/uk_UA.csv", but this not working.
Do the same in the core of Magento, and it's working. What am I doing wrong?

1

As you know you shouldn't touch the vendor folder because it will be overwritten.

You can do it the following way (which I think it is best practice):

Create path:

/app/i18n/magento/uk_ua/

In that folder create 4 files:

composer.json

{
"name": "magento/uk_ua",
  "description": "Ukrainian",
  "version": "100.0.1",
  "license": [
    "OSL-3.0",
    "AFL-3.0"
  ],
  "require": {
    "magento/framework": "100.0.*"
  },
  "type": "magento2-language",
  "autoload": {
    "files": [
      "registration.php"
    ]
  }
}

uk_UA.csv

"some newsletter text","changed newsletter text"

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>uk_UA</code>
    <vendor>magento</vendor>
    <package>uk_ua</package>
</language>

registration.php

<?php

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

?>

Bare in mind that it is case sensitive. Path, registration and vendor are uk_ua, but csv and code is uk_UA.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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