dynamix/i18n 问题修复 & 功能扩展

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

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

dynamix/i18n

最新稳定版本:v1.2.25

Composer 安装命令:

composer require dynamix/i18n

包简介

I18n components for DynamixCMS

README 文档

README

This package will serve to give i18n support with 80 locales.

I18n API

I18n::add

// Your data structure
$data = array('en' => 'helloworld', 'fr' => 'bonjour');

// Type of translation (required!)
$type = 'title';

// The i18n key is used with the `App::locale()` value.
$key = 'groupname.keyname';

// Ready ! 
I18n::add($data, $type, $key = null);

I18n::read

// Get your i18n id !
$id = 1;

// Read it
$i18n = I18n::read($id);

// Read it 
$i18n['en'] // = 'helloworld';

I18n::change

// Get your i18n id !
$id = 1;

// Make your datas
$data = array('en' => 'goodbye', 'fr' => 'aurevoir');

// Edit it
I18n::change($id, $data);

I18n::remove

// Get your i18n id !
$id = 1;

// Remove it
I18n::remove($id);

I18n::get

// Get your i18n id !
$key = 'groupname.keyname';

// Remove it
I18n::get($key);

I18n::getTranslation

// Get Translation
I18n::getTranslation($i18n_id, $locale = App::getLocale());

Locale API

Locale::getFrontEnabled

// Get Front Enabled Locale
Locale::getFrontEnabled();// array of Locale object

MomentJS

If you need to use momentjs in your app, just add these lines to copy dist/momentjs repo to your public path

GruntJS

copy: {
	files: [
		// MomentJS
		{expand: true, cwd: './../../../workbench/dynamix/i18n/dist/momentjs/', src: ['**'], dest: './../../../public/momentjs/'}
	]
},

BrunchJS

plugins
  assetsmanager:
    copyTo:
      '../../../' : ['../../../../workbench/dynamix/i18n/dist/momentjs','../../../../vendor/dynamix/i18n/dist/momentjs']

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-07-08