gymmed/laravel-package-translator
Composer 安装命令:
composer create-project gymmed/laravel-package-translator
包简介
Translates laravel package language document using google translate. Works for ecommerce bagisto documents.
关键字:
README 文档
README
Laravel Package Translator
Neat way to translate Laravel package documents with google translate. Highly recommend for Bagisto package development. This package uses stichoza/google-translate-php to translate.
Installation
You can install the package via composer:
composer require gymmed/laravel-package-translator
Usage
To use the command with arguments and options, follow this format:
package-translator:translate {package} {translateFrom} {translateTo} {--comments} {--force}
Explanation of Arguments:
- {package}: The package path, e.g., Namespace/PackageName
- {translateFrom}: Language code with source translation file, e.g., en/app
- {translateTo}: Language code with target translation file, e.g., lt/app
- {--comments}: (Optional) If you want to include comments.
- {--force}: (Optional) If you want to force the operation.
usage example:
php artisan package-translator:translate Webkul/Shop en/app lt/app
will translate document from:
rootDirectory/packages/Webkul/Shop/src/Resources/lang/en/app.php
will create translated document in:
rootDirectory/packages/Webkul/Shop/src/Resources/lang/lt/app.php
returned results:
You can translate and leave original text as comments for manual double checking:
php artisan package-translator:translate Webkul/Shop en/app lt/app --comments --force
Use --force option to overwrite document.
returned results:
as code from:
return [ ... 'datagrid' => [ 'toolbar' => [ 'length-of' => ':length of', 'results' => ':total Results', 'selected' => ':total Selected', 'mass-actions' => [ 'must-select-a-mass-action' => 'You must select a mass action.', 'must-select-a-mass-action-option' => 'You must select a mass action\'s option.', 'no-records-selected' => 'No records have been selected.', 'select-action' => 'Select Action', ], ... ];
to:
return [ ... 'datagrid' => [ 'toolbar' => [ 'length-of' => ' :length iš', /* :length of */ 'results' => ' :total Rezultatai', /* :total Results */ 'selected' => ' :total Pasirinkta', /* :total Selected */ 'mass-actions' => [ 'must-select-a-mass-action' => 'Turite pasirinkti masinį veiksmą.', /* You must select a mass action. */ 'must-select-a-mass-action-option' => 'Turite pasirinkti masinio veiksmo parinktį.', /* You must select a mass action\'s option. */ 'no-records-selected' => 'Nepasirinkta jokių įrašų.', /* No records have been selected. */ 'select-action' => 'Pasirinkite Veiksmas', /* Select Action */ ], ... ];
If you decide you don't want comments anymore, you can use:
package-translator:uncomment {package} {languageCodeAndFile}
example:
php artisan package-translator:uncomment Webkul/Shop lt/app
returned results:
gymmed/laravel-package-translator 适用场景与选型建议
gymmed/laravel-package-translator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 10 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「translator」 「laravel」 「google-translate」 「bagisto」 「gymmed」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 gymmed/laravel-package-translator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gymmed/laravel-package-translator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 gymmed/laravel-package-translator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Olympus Hermes is a bundle used to translate all messages from your WordPress packages and Olympus bundles.
Alfabank REST API integration
This is a simple light weight language parser to help with language key translation built for speed using in-memory caching optimization technique.
Simple and fast translator and tools to internationalize your PHP application.
Taiwan Address to English version
Free Baidu Translate API PHP Package
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-14