thienson98/tftranslator 问题修复 & 功能扩展

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

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

thienson98/tftranslator

Composer 安装命令:

composer require thienson98/tftranslator

包简介

A simple package help you automatically translate all text on your site to other languages.

README 文档

README

A simple Laravel package help you automatically translate all text on your site to other languages. Writed by Trieu Tai Niem.

Requirement

  • PHP: >= 7.0
  • Laravel: >= 5.5

Features

  • Automatically find translate string in parameter of translation functions ( _() or lang() ) and generate into json translation files

  • Automatically translates text found into other languages ​​using google translator

  • Automatically updates and translates newly added text

Installation

Open terminal and change directory to your project folder, now using composer command bellow to install package:

composer require thienson98/tftranslator

Finally, open laravel config file config/app.php and add the following line to end of $provider array:

ThienSon98\TFTranslator\TFTranslatorServiceProvider::class

That's all!

How to use?

If you want to automatically generate keys from translation functions (__ or lang) into json language files, use the following command:

php artisan 3F:translator

Of course, you can also use the above command to update the changes in your files

Auto find and insert translation function

You do not want to take the effort to insert text as parameter of translation function?

Do not worry! You just execute the command bellow:

php artisan 3F:translator --auto

Translation functions will be added to the view files and automatically generated json language files.

Specify other languages

The default languages of the translator are Vietnamese (vi) and English (en). You can translate into other languages with the --lang=<language code> option.

For example, use the following command to translate to Japanese:

php artisan 3F:translator --lang=ja

Or translate to Vietnamese, Japanese and Chinese:

php artisan 3F:translator --lang=ja,vi,zh

It supports all languages and works with all of the options.

Remove unused keys

To clean unused translation keys, you can use the following command:

php artisan 3F:translator --clear

It will remove all the keys that are not using in views.

Just write the translation keys

Of course, if you do not want to use Google translator to translate your texts. You can use the option below:

php artisan 3F:translator --justwrite

It will ignore auto-translations and only give you translation keys into json files.

This option works with all of the options above.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固