microparts/i18n-php

This package is abandoned and no longer maintained. No replacement package was suggested.

Pagination format for TeamcIO standards.

1.0.1 2019-04-30 09:55 UTC

This package is auto-updated.

Last update: 2020-08-19 07:15:38 UTC


README

I18n For PHP

CircleCI codecov

A small instrument for help us use internalization company standard. Have a hard dependency from configuration package.

Installation

composer install microparts/i18n-php

Usage

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();

Depends

  • >= PHP 7.2
  • Composer for install package

License

GNU GPL v3