diglin/oro-deepl
Composer 安装命令:
composer require diglin/oro-deepl
包简介
Allow to extract non translated strings from OroPlatform applications and translate them through deepl web service. A Deepl developer account is required
README 文档
README
Translation is boring ? Not anymore with the powerful helps of the machine learning tool DeepL. Thanks to this bundle, you can translate all non-translated strings from the OroPlatform database and export them into a YAML or CSV file for reuse.
The translation will take care to not translate strings with such tags: "It could be cool if this {{ won't be translated }} or my dear %hello world% stay safe"
If you have created translation files into your own bundles, they need to be loaded into the database before to proceed translation with Deepl. You must use the command "oro:translation:convert" before.
Special recommendation
Translating via DeepL API costs. So for this reason, if any problem appears while exporting. Do not run again the same command right now. Instead, open the ... TODO (because I have to check exactly how to proceed...)
CSV Export
In the case, a CSV file is exported, the english value is exported also and can be used for human translation or for checking translated values.
Once you did the check of the translation, use the command "diglin:oro:deepl:translate:convert" to convert the CSV into a YAML file located into the translations folder then it will load the content into your OroPlatform database.
On Production environment, you just need to let the generated files onto the translations folder, after your deployment, run the command oro:platform:update --force (do a database backup before to run it).
YAML Export
The generated file can be used one to one to be loaded into your application. OroPlatform can also load it into your database if needed (e.g. to allow backend users to edit those translations).
Same as for the CSV export, on Production environment, you just need to let the generated files onto the translations folder, after your deployment, run the command oro:platform:update --force (do a database backup before to run it).
Installation
composer require diglin/oro-deepl
Requirement
- OroPlatform 4.x, 5.0, 5.1 (may work on previous versions but not tested)
Configuration
DeepL API Key is required if you want to translate the strings automatically.
- Please, go to OroPlatform Backoffice, menu
System > Configuration > System Configuration > Integrations > DeepL - or provide the key via the parameter
deepl-api-key - or set the key into the
var/deepl-license.keyfile.
If no API Key is present, an error message will be displayed but empty translation will still be generated.
Usage examples
Export empty strings of values in CSV to be translated
bin/console --env=prod diglin:oro:deepl:translate:export --format csv --disable-deepl de_DE
Export translation into a CSV file, an english value will be available for translation check
bin/console --env=prod diglin:oro:deepl:translate:export --format csv de_DE
Export translation directly into a YAML file, existing data will be merged but overwritten if duplicate happens. The generated file will have a timestamp
bin/console --env=prod diglin:oro:deepl:translate:export --format yml de_DE
Export translation directly into a YAML file, existing data will be merged but overwritten if duplicate happens. The existing domain translation file (e.g. messages.de_DE.yml) will be overwritten.
bin/console --env=prod diglin:oro:deepl:translate:export --format yml --overwrite de_DE
Translate only messages domain
bin/console --env=prod diglin:oro:deepl:translate:export --domains messages de_DE
Calculate the number of characters will be exported for locale de_DE, useful to estimate DeepL cost
bin/console --env=prod diglin:oro:deepl:translate:export --domains messages,jsmessages,workflows,validators,security --simulate de_DE
Load previously generated CSV file and convert it to YAML, import it into the database and rebuild language cache without frontend interruption
bin/console --env=prod diglin:oro:deepl:translate:convert --rebuild-cache translations/messages.de_DE.csv de_DE
Do you have a tip ?
Well, we admit that diglin:oro:deepl:translate:export is a long command but at least it describes what it does.
If you prefer, you can use this shortcut instead: d:o:d:t:e
ROADMAP
- Add translation button for backend users in different areas (CMS, products, translation management)-
License
See MIT
Author
- Diglin GmbH
- https://www.diglin.com/
- @diglin_
- Follow me on github!
diglin/oro-deepl 适用场景与选型建议
diglin/oro-deepl 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 662 次下载、GitHub Stars 达 2, 最近一次更新时间为 2021 年 02 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 diglin/oro-deepl 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 diglin/oro-deepl 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 662
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-02-17