PHP code example of fisharebest / localization

1. Go to this page and download the library: Download fisharebest/localization 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/ */

    

fisharebest / localization example snippets


// Create the translation
$translation1 = new Translation('/path/to/core/fr.mo');
$translation2 = new Translation('/path/to/extra/fr.mo');
// Create the translator
$translator = new Translator(array_merge($translation1->asArray(), $translation2->asArray()), $locale->pluralRule());

$translation = new Translation('/path/to/fr.mo');
file_put_contents('/path/to/fr.php', ' return ' . var_export($translations->asArray(), true) . ';');