mkhdev/awt 问题修复 & 功能扩展

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

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

mkhdev/awt

最新稳定版本:v1.1

Composer 安装命令:

composer require mkhdev/awt

包简介

Awesome Translation For Laravel

README 文档

README

AWT Create Laravel Lang file for current locale and translate the keys from google

Laravel Awesome Translation Helper using Google Translation

// Generate translation file based in current app locale 
 awtTrans('Hello World !')

Installation

Require this package, with Composer, in the root directory of your project.

$ composer require mkhdev/awt

Add the service provider to config/app.php in the providers array, or if you're using Laravel 5.5, this can be done via the automatic package discovery.

mkhdev\AWT\AWTServiceProvider::class,

★ New Config File

Publish package config file "awt.php" to access new customize features

php artisan vendor:publish --provider=mkhdev\AWT\AWTServiceProvider
  • This file allow you to Enable/Disable Google Translator
  • Enable/Disable application current locale for translator
  • Set default locale if you disabled app locale for translator

Documentation

Helper Function

You can use helper function to get the trans key or generate it if not found

 awtTrans('Hello World !')

In view you can use it like this

 {{awtTrans('Hello World !')}}

Blade Directives

You can use our blade directive for fast translation

 @awt('Hello World !')

Customize Locale

You can customize the locale by adding it as a second argument

awtTrans('Hello World !', 'ar')
{{awtTrans('Hello World !', 'ar')}}
@awt('Hello World !', 'ar')

License

MIT © Mustafa Khaled

统计信息

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

GitHub 信息

  • Stars: 13
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-07-29