ferdiunal/nova-translations
Composer 安装命令:
composer require ferdiunal/nova-translations
包简介
A Laravel Nova Translations
README 文档
README
This package allows you to find and manage the translation keys and language files in your project using the spatie/laravel-translation-loader package. By default, it includes free translation tools like Google Translate, Bing Translate, and MyMemory Translate, as well as paid tools that offer a certain amount of free usage, such as DeepL Translate and NLPCloud Translate. You can also add other translation tools as shown in the example below.
Installation
To install, run the following command in your project directory:
composer require ferdiunal/nova-translations
Configuration
Optionally, you can publish the migration file using this command:
php artisan vendor:publish --tag nova-translations-migrations
Optionally, you can publish the configuration file using this command:
php artisan vendor:publish --tag nova-translations-config
Usage
To import the translation keys and language files used in your project into a table, you can run the following command. You can use the -T|--translater parameter to specify the supported translation tools for this process.
php artisan nova-translations:import --help Description: Import translations from the language files Usage: nova-translation:import [options] Options: -T, --translater[=TRANSLATER] The translater to use: google,bing,deepl,mymemory,nlpcloud -h, --help Display help for the given command. When no command is given display help for the list command -q, --quiet Do not output any message -V, --version Display this application version --ansi|--no-ansi Force (or disable --no-ansi) ANSI output -n, --no-interaction Do not ask any interactive question --env[=ENV] The environment the command should run under -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Then, update the tools method in the app/NovaServiceProvider file as follows:
// app/NovaServiceProvider.php class NovaServiceProvider extends NovaApplicationServiceProvider { /** * Get the tools that should be listed in the Nova sidebar. * * @return array */ public function tools() { return [ ... // Other Nova Tools new NovaTranslations, ]; } }
Translators
Google Translate
If you want to use Google Translate in your project, you need to add the following package:
composer require stichoza/google-translate-php
DeepL Translate
If you want to use DeepL Translate in your project, you need to add the following package:
composer require deeplcom/deepl-php
Then, add the following key to your environment file:
DEEPL_API_KEY=xxxxxxxx...
NLPCloud Translate
If you want to use NLP Translate in your project, you need to add the following package:
composer require nlpcloud/nlpcloud-client
Then, add the following key to your environment file:
NLPCLOUD_API_KEY=xxxxxxxx
For different languages, you need to add the required language code to the config/nova-translations configuration file from here.
return [ .... 'services' => [ 'nlpcloud' => [ // https://nlpcloud.com/ 'api_key' => env('NLPCLOUD_API_KEY'), 'languages' => [ // https://docs.nlpcloud.com/#translation // Add the language code you want here ], ], ], ];
OTHER NOVA PACKAGES
-
This package provides an interface for Spatie's settings package in Laravel Nova. It allows you to easily manage your application's configuration settings.
-
This package integrates Spatie's Media Library package with Laravel Nova, allowing you to manage and organize your media files efficiently.
-
This package provides a Nova field that controls the accessibility of encrypted data in the database and is managed by model casts. It ensures that your sensitive data is securely stored.
Contributing
Contributions are welcome, and any contributors must adhere to the project's code of conduct and licensing terms.
Support
For support, please open an issue in the GitHub repository.
Licence
This project is open-sourced software licensed under the MIT license.
ferdiunal/nova-translations 适用场景与选型建议
ferdiunal/nova-translations 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 7, 最近一次更新时间为 2024 年 08 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「translations」 「nova」 「laravel」 「spatie」 「nova-tool」 「spatie-translatable」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ferdiunal/nova-translations 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ferdiunal/nova-translations 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ferdiunal/nova-translations 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova card that shows you your system information.
A Laravel Nova card.
A Laravel Nova package for publishable fields
A Laravel Nova package for translatable fields
Deepl Automated translations for Laravel lang files
A Laravel Nova Image field. you can paste or drag or chose an image
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-07
