PHP code example of bubu-framework / lang

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

    

bubu-framework / lang example snippets




use Bubu\Lang\Lang;

// Setup new translation
$trad = [
    'hello' => [
        Lang::FR => 'Bonjour',
        Lang::EN => 'Hello'
    ],

    'how' => [
        Lang::FR => 'Comment'
    ]
];

Lang::registre($trad);

// Change default lang
Lang::setLang(Lang::FR);

// Get translation
echo Lang::get('hello');