我試圖按照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 的指示操作,但我仍然失敗。如何在Magento 2中安裝語言包?
我試圖改變從標題搜索框的文本「這裏搜索整個店面......」到「Suche ...」
現在,我已經在應用中的以下文件/國際化/測試/將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__);
在管理,我用德語(瑞士)配置的存儲(存儲>配置>常規>常規>區域設置選項>區域設置)。
然後,試圖PHP斌/ Magento的設置:升級和PHP斌/ Magento的緩存:清潔
但沒有什麼,在搜索表單中的文本仍然是「這裏搜索整店......」
好極了,現在可以使用! 您可以發佈整個代碼來幫助其他人:) – Henry
是的,我們昨天更新了文檔。對大寫錯誤感到抱歉。如果您現在發現有關該主題的問題,請告訴我們。 –
是的,它可以覆蓋它嗎?我創建應用程序/設計/主題/默認/ i18n/xx_XX.csv,但它不覆蓋,所以我不能添加自定義,如果不是在原來的csv。 –