1. Go to this page and download the library: Download rinkattendant6/json-i18n library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rinkattendant6 / json-i18n example snippets
$t = new \JsonI18n\Translate('en-CA');
// By default, strings will be outputted in the locale given in the constructor
// In this case, Canadian English will be returned unless explicitly stated otherwise
// Optional settings
$t->setSettings([
'strict' => false,
]);
$t->addResource('path/to/file.json');
$t->_ef('greeting', 'Jason'); // prints out "Hello"