PHP Class SimpleSAML\Locale\Localization

Show file Open project: simplesamlphp/simplesamlphp Class Usage Examples

Public Methods

Method Description
__construct ( SimpleSAML_Configuration $configuration ) Constructor
addDomain ( $localeDir, $domain ) * Add a new translation domain (We're assuming that each domain only exists in one place)
addModuleDomain ( $module, $localeDir = null ) * Add a new translation domain from a module (We're assuming that each domain only exists in one place)
getDomainLocaleDir ( string $domain ) Get the default locale dir for a specific module aka. domain
getLangPath ( $domain = self::DEFAULT_DOMAIN ) * Get and check path of localization file
getLocaleDir ( ) Dump the default locale directory
getRegisteredDomains ( ) Show which domains are registered
isI18NBackendDefault ( ) Test to check if backend is set to default

Private Methods

Method Description
loadGettextGettextFromPO ( string $domain = self::DEFAULT_DOMAIN, boolean $catchException = true ) Load translation domain from Gettext/Gettext using .po
setupL10N ( ) Set up L18N if configured or fallback to old system
setupTranslator ( ) Setup the translator

Method Details

__construct() public method

Constructor
public __construct ( SimpleSAML_Configuration $configuration )
$configuration SimpleSAML_Configuration Configuration object

addDomain() public method

* Add a new translation domain (We're assuming that each domain only exists in one place)
public addDomain ( $localeDir, $domain )
$localeDir Location of translations
$domain Domain at location

addModuleDomain() public method

* Add a new translation domain from a module (We're assuming that each domain only exists in one place)
public addModuleDomain ( $module, $localeDir = null )
$module Module name
$localeDir Absolute path if the module is housed elsewhere

getDomainLocaleDir() public method

Get the default locale dir for a specific module aka. domain
public getDomainLocaleDir ( string $domain )
$domain string Name of module/domain

getLangPath() public method

* Get and check path of localization file
public getLangPath ( $domain = self::DEFAULT_DOMAIN )
$domain Name of localization domain

getLocaleDir() public method

Dump the default locale directory
public getLocaleDir ( )

getRegisteredDomains() public method

Show which domains are registered

isI18NBackendDefault() public method

(if false: backend unset/there's an error)