定制 flextype-components/i18n 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

flextype-components/i18n

最新稳定版本:v1.3.0

Composer 安装命令:

composer require flextype-components/i18n

包简介

I18n Component for messages internationalization of your application.

README 文档

README

version MIT License

I18n Component for messages internationalization of your application.

Installation

composer require flextype-components/i18n

Usage

use Flextype\Component\I18n\I18n;

Add translation keys

I18n::add(['auth_login' => 'Login', 'auth_password' => 'Password'], [],'en_US');

Returns translation of a string. If no translation exists, the original string will be returned. No parameters are replaced.

$translated_string = I18n::find('auth_login');

Global Translation/Internationalization function. Accepts an translation key and returns its translation for selected language. If the given translation key is not available in the current dictionary the translation key will be returned.

// Display a translated message
echo __('auth_login', 'auth');

// With parameter replacement
echo __('auth_welcome_message', [':username' => $username], 'en_US');

Set default locale

I18n::$locale = 'en_US';

License

See LICENSE

统计信息

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

GitHub 信息

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

其他信息

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