Skip to content

Latest commit

 

History

History
226 lines (85 loc) · 3.5 KB

File metadata and controls

226 lines (85 loc) · 3.5 KB

AsciiSlugger

Constants

Constant Visibility Type Value
LOCALE_TO_TRANSLITERATOR_ID private ['am' => 'Amharic-Latin', 'ar' => 'Arabic-Latin', 'az' => 'Azerbaijani-Latin', 'be' => 'Belarusian-Latin', 'bg' => 'Bulgarian-Latin', 'bn' => 'Bengali-Latin', 'de' => 'de-ASCII', 'el' => 'Greek-Latin', 'fa' => 'Persian-Latin', 'he' => 'Hebrew-Latin', 'hy' => 'Armenian-Latin', 'ka' => 'Georgian-Latin', 'kk' => 'Kazakh-Latin', 'ky' => 'Kirghiz-Latin', 'ko' => 'Korean-Latin', 'mk' => 'Macedonian-Latin', 'mn' => 'Mongolian-Latin', 'or' => 'Oriya-Latin', 'ps' => 'Pashto-Latin', 'ru' => 'Russian-Latin', 'sr' => 'Serbian-Latin', 'sr_Cyrl' => 'Serbian-Latin', 'th' => 'Thai-Latin', 'tk' => 'Turkmen-Latin', 'uk' => 'Ukrainian-Latin', 'uz' => 'Uzbek-Latin', 'zh' => 'Han-Latin']

Properties

defaultLocale

private ?string $defaultLocale

symbolsMap

private \Closure|array $symbolsMap

transliterators

Cache of transliterators per locale.

private array $transliterators

Methods

__construct

public __construct(string $defaultLocale = null, array|\Closure $symbolsMap = null): mixed

Parameters:

Parameter Type Description
$defaultLocale string
$symbolsMap array|\Closure

setLocale

{@inheritdoc}

public setLocale(string $locale): mixed

Parameters:

Parameter Type Description
$locale string

getLocale

{@inheritdoc}

public getLocale(): string

slug

Creates a slug for the given string and locale, using appropriate transliteration when needed.

public slug(string $string, string $separator = '-', string $locale = null): \Symfony\Component\String\AbstractUnicodeString

Parameters:

Parameter Type Description
$string string
$separator string
$locale string

createTransliterator

private createTransliterator(string $locale): ?\Transliterator

Parameters:

Parameter Type Description
$locale string

getParentLocale

private static getParentLocale(?string $locale): ?string
  • This method is static.

Parameters:

Parameter Type Description
$locale ?string