alkalab/magic-translation 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

alkalab/magic-translation

Composer 安装命令:

composer require alkalab/magic-translation

包简介

Automatically translate your Laravel localization files to any language using Google Translate through an Artisan command.

README 文档

README

Automatically translate your Laravel localization files to any language using Google Translate through an Artisan command.

This package supports for any string:

  • Parameters (example: 'localized string :foo')
  • Emojis (example: 'localized string 🚀')
  • HTML tags (example: 'localized string <i>yes </i>')

Installation

As any Laravel package, simply

composer require alkalab/magic-translation

How to use it?

Simple, once installed the Artisan command is:

php artisan magic:translate {file} {target} {--no-validation}

  • {file}: the file that needs to be translated inside your resources/assets/lang/en/, without the .php extension. Example: "validation" to translate resources/assets/lang/en/validation.php
  • {target}: the language code (2 characters) in which the strings will be translated. Example: "fr" to translate to resources/assets/lang/fr/
  • --no-validation: an optional command option. If set, the strings will be automatically translated without validation. You can always change them afterward of course. Otherwise, you will be validating every translation 1 by 1.

Example:

php artisan magic:translate validation fr --no-validation

Important notes

  • This is using Google Translator, please check the translations as even though it's pretty good sometimes it will not work correctly 😉.
  • This first version only translates from English to another language. Not the other way around.
  • As of right now, this is using the wonderful Stichoza/google-translate-php package. This package does not use the Google Cloud API but directly the Google Translate website. Therefore, it might stop working at some point. If that happens, this package will be updated to use the Cloud API instead.

Any bug, idea or improvement, feel free to improve it or create a new issue.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固