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?
Asked
Active
Viewed 2,246 times
1
D.R.
- 315
- 1
- 5
- 19
-
Maybe you just need to clear some directories. – Steve Johnson Jun 12 '16 at 13:55
1 Answers
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.
Claudiu Creanga
- 6,247
- 2
- 49
- 88