step 1: get the translation texts
php bin/magento i18n:collect-phrases --output=zh_Hans_CN.csv --magento .
Step 2: on root folder there must be translation file of this name
Step 3: Create folders
mkdir app/i18n mkdir app/i18n/ngage/ mkdir app/i18n/ngage/zh_Hans_CN/
Step 4 :Create the file composer.json with the following contents:
{
"name": "test/nl_nl",
"description": "Chinese Language",
"version": "100.0.1",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
"magento/framework": "100.0.*"
},
"type": "magento2-language",
"autoload": {
"files": [
"registration.php"
]
}
,"extra": {"map": "*", "ngage/zh_Hans_CN"}
}Stpe 5 : Create the file language.xml with the following contents:
<?xml version="1.0"?> <language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd"> zh_Hans_CN <vendor>ngage</vendor> <package>zh_hans_cn</package> </language>
Step 6: Create the file registration.php with the following content:
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
'ngage_zh_hans_cn',
__DIR__
);Step 7: deploy setup
php bin/magento setup:static-content:deploy php bin/magento setup:static-content:deploy nl_NL php bin/magento indexer:reindex php bin/magento cache:clean php bin/magento cache:flush
