1. Go to this page and download the library: Download jelix/simplelocalization 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/ */
// with multiple files
$locales = new \Jelix\SimpleLocalization\Container('translation.%LANG%.php');
// note that %LANG% in the path will be replace by a lang code
// with a single file
$locales = new \Jelix\SimpleLocalization\Container('translation.php');
// with an array of file name. You can mix path with `%LANG%` tag and path without it
$locales = new \Jelix\SimpleLocalization\Container(array('translation.%LANG%.php', 'other_translation.php'));
// with an array of strings
$locales = new \Jelix\SimpleLocalization\Container(array(
'en' => array(
'welcome' => 'Bonjour le monde',
'thank.you' => 'Merci'
),
'fr' => array(
'welcome' => 'Bonjour le monde',
'thank.you' => 'Merci'
)
));
$str = $locales->get('welcome');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.