PHP code example of nixphp / i18n

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

    

nixphp / i18n example snippets


echo t('welcome');

echo t('greeting', ['name' => 'John']);

use NixPHP\I18n\Support\Language;

t()->setLanguage(Language::DE);

/index.php?lang=de

translator()->get('unknown_key');
// → "unknown_key"