PHP code example of metarush / lang
1. Go to this page and download the library: Download metarush/lang 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/ */
metarush / lang example snippets
$lang = (new \MetaRush\Lang\Builder())
->setLocalePath('path/to/locales/folder/')
->setLocale('en-US')
->build();
$foo = $lang->get('foo');
// $foo now contains 'hello world'
$vars = [
'size' => 'big',
'color' => 'brown',
'animal' => 'fox',
];
$bar = $lang->get('bar', $vars);
// $bar now contains 'the big brown fox jumped'