承接 ejesus/laravel-auto-translator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ejesus/laravel-auto-translator

最新稳定版本:v1.0.1

Composer 安装命令:

composer require ejesus/laravel-auto-translator

包简介

A Laravel package that leverages the DeepL Translation API to automatically translate all your language files based on an existing translation, making multilingual projects faster and easier to manage.

README 文档

README

A Laravel package that automatically translates content based on user input. This package allows users to specify a source language (--from) and a target language (--to), supporting multiple target languages by separating them with commas (e.g., pt,es). The package uses Deepl API for translation, requiring an API key to work.

Installation

  1. Install the package via Composer:
composer require edgar/laravel-auto-translator
  1. Add the API key to your .env file: To use Deepl API, you need to obtain an API key from Deepl (https://www.deepl.com/pro) and set it in your .env file.
TRANSLATE_API_KEY=your_deepl_api_key

Usage

You can use the package with the following Artisan command:

php artisan translator:run --from=<source_language> --to=<target_languages>

Parameters

  • --from: The source language code (e.g., en for English, de for German).
  • --to: The target language(s) for translation. You can specify multiple target languages by separating them with commas (e.g., pt,es for Portuguese and Spanish).

Example

To translate from English (en) to Portuguese (pt) and Spanish (es):

php artisan translator:run --from=en --to=pt,es

This command will automatically translate your content from English to both Portuguese and Spanish using Deepl API.

Requirements

  • Deepl API Key: You need to create an account on Deepl and generate an API key. Place the key in your .env file under the variable TRANSLATE_API_KEY.

  • Laravel 8 or higher.

Notes

  • The translation will be done based on the API capabilities of Deepl. If Deepl API has any rate limits or issues, the translation process might be delayed.
  • The --from and --to languages should use standard ISO language codes (e.g., en, es, de, etc.).
  • If multiple target languages are provided, the content will be translated and saved for each target language specified.

License

This package is open source and available under the MIT License.

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固