\l10nManager

Classe de base Gérant les plugins

Summary

Methods
Properties
Constants
__construct()
getLabel()
loadFileReplaceLabels()
loadL10nFile()
loadL10nArray()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct() 

getLabel()

getLabel(  $domain,   $label, null  $forceLocale = null) : string

Retreives the localized label for the given domain.

Parameters

$domain

string A domain is the unique name referencing the content loaded from a localization file, for exemple 'newsItem' if you have loaded the labels for a newsItem object.

$label

string The label is the unique key for which you want to retreive the translation, for example 'news_date'

null $forceLocale

string By default the currently displayed language in MindFlow is used. But there are cases you may want to force the language you get the translation for. You can specify an ISO2 language key here, such as 'fr'.

Returns

string —

the localized label

loadFileReplaceLabels()

loadFileReplaceLabels(  $domain,   $template_file) : mixed|string

Load a template file and replaces all the marker {tags} with the definitions from the given domain, applying the current locale

Parameters

$domain

String the domain where the marker {tags} substitution definitions should be looked for

$template_file

String the file, usually html, containing some marker {tags}

Returns

mixed|string —

the file content with replaced markers

loadL10nFile()

loadL10nFile(  $domain,   $languageFilePath) 

Parameters

$domain
$languageFilePath

loadL10nArray()

loadL10nArray(  $domain,   $l10nArray) 

Adds the content of an existing l10n array to the existing domain

Parameters

$domain

string unique name for an existing array of labels

$l10nArray

array the array of labels to merge with the existing one.