kecik / language
Language Libararies for Kecik Framework
Installs: 145
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/kecik/language
Requires
- php: >=5.4.0
This package is not auto-updated.
Last update: 2025-10-25 23:47:58 UTC
README
A library created specifically Kecik Framework, this library was made for ease in making use of multi-language projects.
Installation
composer.json files
{
"require": {
"kecik/language": "1.0.*@dev"
}
}
Run a command
composer install
This library requires a file in json format as a dictionary. Examples json file contents.
nama file: lang_id.json
{
"signin": "Masuk",
"form": {
"validation": {
"must be fill": "Harus diisi"
}
}
}
nama file: lang_us.json
{
"signin": "Sign In",
"form": {
"validation": {
"must be fill": "Must be fill"
}
}
}
Example Using
<?php require "vendor/autoload.php"; $app = new Kecik\Kecik(); $lang = new Kecik\Language(array( 'id'=>'lang_id.json', 'us'=>'lang_us.json' )); $app->get('/', function() use ($lang){ echo 'Indonesia Sign In :'.$lang->id('signin').'<br />'; echo 'English [US] Sign In :'.$lang->us('signin').'<br />'; echo 'Indonesia Must be fill : '.$lang->id('must be fill', array('form', 'validation')).'<br />'; echo 'English [US] Must be fill :'.$lang->us('must be fill', array('form', 'validation')); }); $app->run(); ?>