hyva-themes / magento2-i18n-csv-diff
Magento命令,用于显示第一个CSV文件中存在而第二个文件中不存在的所有翻译。
1.0.2
2023-08-11 09:36 UTC
Requires
- php: >=7.4.0
README
hyva-themes/magento2-i18n-csv-diff
此模块添加了bin/magento i18n:diff-csv
和i18n:translate-csv
命令。
i18n:diff-csv
该命令接受两个CSV文件作为参数。
它根据文件的第一列显示第一个CSV文件中存在而第二个文件中不存在的所有翻译。
i18n:translate
该命令接受一个目标语言的2字母ISO代码作为参数。
它从stdin读取Magento本地化CSV字典,使用DeepL API进行翻译,并将其写入stdout。
务必在之后检查自动翻译!
使用示例
-
收集所有Magento和Hyvä字符串
bin/magento i18n:collect-phrases vendor/magento/ > magento-strings.csv bin/magento i18n:collect-phrases vendor/hyva-themes/magento2-default-theme/ > hyva-strings.csv bin/magento i18n:collect-phrases vendor/hyva-themes/magento2-theme-module/ >> hyva-strings.csv
-
查找所有不属于原生Magento的Hyvä特定翻译
bin/magento i18n:diff-csv hyva-strings.csv magento-strings.csv
-
查找所有缺失在Hyvä翻译文件中的翻译
bin/magento i18n:diff-csv hyva-strings.csv i18n/de_DE.csv
-
查找所有在翻译文件中但未在Hyvä中使用过的翻译
bin/magento i18n:diff-csv i18n/de_DE.csv hyva-strings.csv
-
向现有字典文件添加新的翻译。
bin/magento i18n:diff-csv hyva-strings.csv i18n/de_DE.csv | bin/magento i18n:translate-csv DE >> i18n/de_DE.csv
安装
- 通过composer安装
composer require hyva-themes/magento2-i18n-csv-diff
- 启用模块
bin/magento setup:upgrade
配置
要使用i18n:translate-csv
命令,请配置您的API密钥,在系统配置中的Hyva Themes > 本地化 CLI > 翻译 > DeepL API Key。
许可证
BSD-3-Clause许可证。有关更多信息,请参阅许可证文件。