dynamix/i18n

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (v1.2.25) of this package.

I18n components for DynamixCMS

v1.2.25 2017-02-13 14:55 UTC

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']