class TransliterationService (View source)

Properties

protected Service $localizationService
protected bool $transliterationRules

Methods

string
transliterate(string $text, string $language = null)

Translaterates UTF-8 string to ASCII. (北京 to 'Bei Jing')

Details

string transliterate(string $text, string $language = null)

Translaterates UTF-8 string to ASCII. (北京 to 'Bei Jing')

Accepts language parameter that maps to a configurable array of special transliteration rules if present.

Parameters

string $text

Text to transliterate

string $language

Optional language for specific rules (falls back to current locale if not provided)

Return Value

string