A small instrument for help us use internalization company standard. Have a hard dependency from configuration package.
composer install microparts/i18n-php
Basic:
$manager = new Manager($conf); // $conf is a our default configuration module
$i18n = $manager->load();
$i18n->getDisplayLang();
$i18n->isTranslateList();
$i18n->getFallbackLang();
$i18n->getSecondLang();
With headers, but headers from PSR MessageInterface
:
$manager = new Manager($conf); // $conf is a our default configuration module
$i18n = $manager->withMessage($request)->load();
$i18n->getDisplayLang();
$i18n->isTranslateList();
$i18n->getFallbackLang();
$i18n->getSecondLang();
With headers, but headers from other source:
$manager = new Manager($conf); // $conf is a our default configuration module
$i18n = $manager->withHeaders($headers)->load(); // where $headers is a key => value array of headers
$i18n->getDisplayLang();
$i18n->isTranslateList();
$i18n->getFallbackLang();
$i18n->getSecondLang();
- >= PHP 7.2
- Composer for install package
GNU GPL v3