dynamix / i18n
I18n components for DynamixCMS
Installs: 948
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 9
Forks: 0
Open Issues: 0
pkg:composer/dynamix/i18n
Requires
- illuminate/support: 4.2.*
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']