Kecik Language
A library created specifically Kecik Framework, this library was made for ease in making use of multi-language projects., (*1)
Installation
composer.json files, (*2)
{
"require": {
"kecik/language": "1.0.*@dev"
}
}
Run a command, (*3)
composer install
This library requires a file in json format as a dictionary. Examples json file contents., (*4)
nama file: lang_id.json, (*5)
{
"signin": "Masuk",
"form": {
"validation": {
"must be fill": "Harus diisi"
}
}
}
nama file: lang_us.json, (*6)
{
"signin": "Sign In",
"form": {
"validation": {
"must be fill": "Must be fill"
}
}
}
Example Using
'lang_id.json',
'us'=>'lang_us.json'
));
$app->get('/', function() use ($lang){
echo 'Indonesia Sign In :'.$lang->id('signin').'
';
echo 'English [US] Sign In :'.$lang->us('signin').'
';
echo 'Indonesia Must be fill : '.$lang->id('must be fill', array('form', 'validation')).'
';
echo 'English [US] Must be fill :'.$lang->us('must be fill', array('form', 'validation'));
});
$app->run();
?>