Skip to content

API L10n L10nManager

Christophe SAUVEUR edited this page Sep 29, 2024 · 2 revisions

L10nManager Class

chsxf\MFX\L10n

final class L10nManager implements Services\ILocalizationService

Summary

Helper class for managing localization

Since 1.0

Methods

__construct

public function __construct(Services\IConfigService $configService)

Constructor

Since 1.0

Parameters

Name Type Description
$configService IConfigService Config service instance

bindTextDomain

public function bindTextDomain(string $key, string $path, string $charset = 'UTF-8')

Binds a new text domain

Since 2.0

Parameters

Name Type Description
$key string Text domain key
$path string Text domain path
$charset string Text domain charset (Defaults to UTF-8)

getLanguage

public function getLanguage(): string

Gets the current language from the current locale

Since 2.0

Returns

string


getLocale

public function getLocale(): string

Gets the current locale from environment

Since 2.0

Returns

string


Clone this wiki locally