Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe LanguageHelper

Fonctions membres publiques statiques

static createLanguageList ($actualLanguage, $basePath=JPATH_BASE, $caching=false, $installed=false)
 
static detectLanguage ()
 
static parseIniFile ($fileName, $debug=false)
 
static saveToIniFile ($fileName, array $strings)
 
static exists ($lang, $basePath=JPATH_BASE)
 
static getMetadata ($lang)
 
static getKnownLanguages ($basePath=JPATH_BASE)
 
static getLanguagePath ($basePath=JPATH_BASE, $language=null)
 
static parseLanguageFiles ($dir=null)
 
static parseXMLLanguageFile ($path)
 

Description détaillée

Language helper class

Depuis
1.5

Documentation des fonctions membres

◆ createLanguageList()

static createLanguageList (   $actualLanguage,
  $basePath = JPATH_BASE,
  $caching = false,
  $installed = false 
)
static

Builds a list of the system languages which can be used in a select option

Paramètres
string$actualLanguageClient key for the area
string$basePathBase path to use
boolean$cachingTrue if caching is used
boolean$installedGet only installed languages
Renvoie
array List of system languages
Depuis
1.5

Références $basePath, $clientId, $language, Language\$languages, $list, Language\$metadata, JPATH_ADMINISTRATOR, et null.

Référencé par LoginHelper\getLanguageList(), SetupModel\getLanguages(), et LanguageField\getOptions().

◆ detectLanguage()

static detectLanguage ( )
static

◆ exists()

static exists (   $lang,
  $basePath = JPATH_BASE 
)
static

Checks if a language exists.

This is a simple, quick check for the directory that should contain language files for the given user.

Paramètres
string$langLanguage to check.
string$basePathOptional path to check.
Renvoie
boolean True if the language exists.
Depuis
3.7.0

Références $basePath, Language\$lang, $path, et Language\$paths.

Référencé par DatabaseModel\initialise(), AdministratorApplication\initialiseApp(), SiteApplication\initialiseApp(), et SetupModel\validateDbConnection().

◆ getKnownLanguages()

static getKnownLanguages (   $basePath = JPATH_BASE)
static

Returns a list of known languages for an area

Paramètres
string$basePathThe basepath to use
Renvoie
array key/value pair with the language file and real name.
Depuis
3.7.0

Références $basePath.

Référencé par AdminLanguage\existing(), LanguageclientField\getOptions(), et PlgSystemLanguagecode\onContentPrepareForm().

◆ getLanguagePath()

static getLanguagePath (   $basePath = JPATH_BASE,
  $language = null 
)
static

Get the path to a language

Paramètres
string$basePathThe basepath to use.
string$languageThe language tag.
Renvoie
string language related path or null.
Depuis
3.7.0

Références $basePath, et $language.

Référencé par Users\admin_language(), InstallationApplication\getLocaliseAdmin(), InstalledModel\getPath(), LanguagesModel\getPath(), PlgSampledataMultilang\getPath(), Users\language(), et Language\load().

◆ getMetadata()

static getMetadata (   $lang)
static

Returns an associative array holding the metadata.

Paramètres
string$langThe name of the language.
Renvoie
mixed If $lang exists return key/value pair with the language metadata, otherwise return NULL.
Depuis
3.7.0

Références Language\$lang, $result, JPATH_BASE, et null.

Référencé par Language\__construct(), et LanguagesHelper\getList().

◆ parseIniFile()

static parseIniFile (   $fileName,
  $debug = false 
)
static

Parse strings from a language file.

Paramètres
string$fileNameThe language ini file path.
boolean$debugIf set to true debug language ini file.
Renvoie
array The strings parsed.
Depuis
3.9.0

Références Language\$debug, Language\$strings, et null.

Référencé par OverridesModel\delete(), OverrideModel\getItem(), OverridesModel\getOverrides(), Language\parse(), StringsModel\refresh(), et OverrideModel\save().

◆ parseLanguageFiles()

static parseLanguageFiles (   $dir = null)
static

Searches for language directories within a certain base dir.

Paramètres
string$dirdirectory of files.
Renvoie
array Array holding the found languages as filename => real name pairs.
Depuis
3.7.0

Références $dir, Language\$languages, et Language\$metadata.

◆ parseXMLLanguageFile()

static parseXMLLanguageFile (   $path)
static

Parse XML file for language information.

Paramètres
string$pathPath to the XML files.
Renvoie
array Array holding the found metadata as a key => value pair.
Depuis
3.7.0
Exceptions

Références Language\$metadata, $path, et $xml.

Référencé par Users\admin_language(), LanguageAdapter\createContentLanguage(), Users\language(), et InstalledController\switchAdminLanguage().

◆ saveToIniFile()

static saveToIniFile (   $fileName,
array  $strings 
)
static

Save strings to a language file.

Paramètres
string$fileNameThe language ini file path.
array$stringsThe array of strings.
Renvoie
boolean True if saved, false otherwise.
Depuis
3.7.0

Références $key, Language\$strings, et File\write().

Référencé par OverridesModel\delete(), et OverrideModel\save().


La documentation de cette classe a été générée à partir du fichier suivant :