我尝试按照https://mage2.pro/t/topic/270和http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-i18n.html#config-cli-subcommands-xlate-example2的说明进行操作,但仍然失败了。
我想要将页眉搜索框中的文本从“Search entire store here...”更改为“Suche...”
目前,在app/i18n/Test/de_ch文件夹中有以下文件:
- composer.json
- de_ch.csv
- language.xml
- registration.php
composer.json的内容如下:
{
"name": "test/de_ch",
"description": "German (Switzerland) language",
"version": "100.0.1",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
"magento/framework": "100.0.*"
},
"type": "magento2-language",
"autoload": {
"files": [
"registration.php"
]
}
}
de_ch.csv
"Search entire store here...","Suche..."
language.xml
<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd">
<code>de_CH</code>
<vendor>Test</vendor>
<package>de_ch</package>
</language>
registration.php
<?php \Magento\Framework\Component\ComponentRegistrar::register(\Magento\Framework\Component\ComponentRegistrar::LANGUAGE,'Test_de_ch',__DIR__);
在管理员页面,我配置了商店(商店 > 配置 > 常规 > 常规 > 区域选项 > 区域)为Deutsch (Schweiz)。
然后,尝试运行php bin/magento setup:upgrade和php bin/magento cache:clean。
但是仍然没有变化,搜索表单中的文本仍然是“在此处搜索整个商店...”。