Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Latest commit

 

History

History
61 lines (45 loc) · 1.51 KB

README.md

File metadata and controls

61 lines (45 loc) · 1.51 KB

This package deprecated and abandoned.

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