PHP code example of kasseler / gettext

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

    

kasseler / gettext example snippets


define('GETTEXT_CLASS', true);

//                    filename   locale   charset
init_translate_domain('message', 'fr',    'UTF-8',  'path_to_locales_dir');

echo gettext('Add');
echo ngettext('Minute', 'Minutes', 2);

echo _gettext('Add');
echo _ngettext('Minute', 'Minutes', 2);