imega/translit

dev-master 2016-11-18 08:09 UTC

This package is not auto-updated.

Last update: 2024-04-27 17:31:51 UTC


README

Latest Stable Version Minimum PHP Version CircleCI Travis Build Status Scrutinizer Code Quality Scrutinizer Code Coverage Scrutinizer Build Status

The conversion of scripts or writing is a procedure of replacing text written in one script or writing system with the characters of another script or system in order to make the text (e.g., proper names) legible for users of another language or script.

Allowed systems for romanizing Russian

Romanization of the Russian alphabet is the process of transliterating the Russian language from the Cyrillic script into the Latin alphabet. See https://en.wikipedia.org/wiki/Romanization_of_Russian

Class System
Passport Passport (2013-) ICAO
Passport2010 Passport (2010)
Passport1997 Passport (1997)

Usage

$formatter = new Formatter(
    [
        Passport::setDefault('translit', ''),
    ]
);
echo $formatter->getValue('translit', 'щука'); // shchuka
$formatter = new Formatter(
    [
        Passport::setDefault('translit', ''),
        Passport2010::setDefault('passport2010', ''),
        Passport1997::setDefault('passport1997', ''),
    ]
);

$value = "Ехал Грека через реку, видит Грека - в реке рак. Сунул Грека руку в реку, рак за руку Грека - цап!";

//Ekhal Greka cherez reku, vidit Greka - v reke rak. Sunul Greka ruku v reku, rak za ruku Greka - tsap!
echo $formatter->getValue('translit', $value);

//Ekhal Greka cherez reku, vidit Greka - v reke rak. Sunul Greka ruku v reku, rak za ruku Greka - tcap!
echo $formatter->getValue('passport2010', $value);

//Ekhal Greka cherez reku, vidit Greka - v reke rak. Sunul Greka ruku v reku, rak za ruku Greka - tsap!
echo $formatter->getValue('passport1997', $value);

The MIT License (MIT)

Copyright © 2016 iMega info@imega.ru

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.