Gettext library to translate with i18n
<?php
use POMO\MO;
// Create MO object
$translations = new MO();
// Import MO file
$translations->import_from_file($the_mo_filepath);
// Translate
$translations->translate($text);
The easiest way to install POMO is via composer.
composer require pomo/pomo
<?php
require 'vendor/autoload.php';
use POMO\MO;
[...]
POMO works with PHP 5.3 or above.
POMO is licensed under the GPLv2 License.