sensejus / magento2-translation-merger
将 magento i18n:collect 命令结果中的翻译与当前主题翻译合并
v1.0.0
2016-11-24 15:51 UTC
Requires
- php: ~5.5.0|~5.6.0|~7.0.0
This package is not auto-updated.
Last update: 2024-09-28 20:03:42 UTC
README
将 magento i18n:collect 命令结果中的翻译与当前主题翻译合并。因此,每次您在模板中添加一些新的可翻译字符串时,您可以通过运行以下命令自动更新主题/模块的翻译文件:
示例
php bin/magento i18n:collect-phrases --output "app/i18n/Vendorname/sv_SE/sv_SE.csv" --magento
php bin/magento translation-merger:merge app/i18n/Vendorname/sv_SE/ app/design/frontend/Yourtheme/Yourthemepackage/i18n/ sv_SE
此模块修复了运行 bin/magento i18n:pack 时 magento 的问题,但由于某种原因,它只是替换了当前主题/模块的 CSV 翻译,而没有合并它们。
安装
将其添加到您的 composer.json 中
"require-dev": { "sensejus/magento2-translation-merger":"1.0.0" }
运行
composer update
或直接运行
composer require sensejus/magento2-translation-merger
用法
bin/magento translation-merger:merge [输入目录] [输出目录] [地区]
参数
输入目录 - 收集的 Magento CSV 文件的输入目录。(默认:app/i18n/)
输出目录 - 收集的 Magento CSV 文件的输出目录。(默认:app/design/frontend/base/i18n/)
地区 地区(默认:en_US)