hyva-themes/magento2-i18n-csv-diff

Magento命令,用于显示第一个CSV文件中存在而第二个文件中不存在的所有翻译。

安装: 45

依赖项: 0

建议: 0

安全: 0

星标: 12

关注者: 4

分支: 0

开放问题: 2

类型:magento2-module

1.0.2 2023-08-11 09:36 UTC

This package is auto-updated.

Last update: 2024-09-03 09:38:31 UTC


README

Hyvä Themes

hyva-themes/magento2-i18n-csv-diff

Supported Magento Versions

此模块添加了bin/magento i18n:diff-csvi18n: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

安装

  1. 通过composer安装
    composer require hyva-themes/magento2-i18n-csv-diff
    
  2. 启用模块
    bin/magento setup:upgrade
    

配置

要使用i18n:translate-csv命令,请配置您的API密钥,在系统配置中的Hyva Themes > 本地化 CLI > 翻译 > DeepL API Key

许可证

BSD-3-Clause许可证。有关更多信息,请参阅许可证文件