Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JLanguage

Liste de tous les membres

Fonctions membres publiques

 __construct ($lang=null, $debug=false)
 _ ($string, $jsSafe=false, $interpretBackSlashes=true)
 transliterate ($string)
 getTransliterator ()
 setTransliterator ($function)
 getPluralSuffixes ($count)
 getPluralSuffixesCallback ()
 setPluralSuffixesCallback ($function)
 getIgnoredSearchWords ()
 getIgnoredSearchWordsCallback ()
 setIgnoredSearchWordsCallback ($function)
 getLowerLimitSearchWord ()
 getLowerLimitSearchWordCallback ()
 setLowerLimitSearchWordCallback ($function)
 getUpperLimitSearchWord ()
 getUpperLimitSearchWordCallback ()
 setUpperLimitSearchWordCallback ($function)
 getSearchDisplayedCharactersNumber ()
 getSearchDisplayedCharactersNumberCallback ()
 setSearchDisplayedCharactersNumberCallback ($function)
 load ($extension= 'joomla', $basePath=JPATH_BASE, $lang=null, $reload=false, $default=true)
 get ($property, $default=null)
 getName ()
 getPaths ($extension=null)
 getErrorFiles ()
 getTag ()
 isRTL ()
 setDebug ($debug)
 getDebug ()
 getDefault ()
 setDefault ($lang)
 getOrphans ()
 getUsed ()
 hasKey ($string)
 setLanguage ($lang)
 getLocale ()
 getFirstDay ()
 getWeekEnd ()

Fonctions membres publiques statiques

static getInstance ($lang, $debug=false)
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)

Fonctions membres protégées

 loadLanguage ($filename, $extension= 'unknown')
 parse ($filename)
 getCallerInfo ()

Attributs protégés

 $debug = false
 $default = 'en-GB'
 $orphans = array()
 $metadata = null
 $locale = null
 $lang = null
 $paths = array()
 $errorfiles = array()
 $strings = array()
 $used = array()
 $counter = 0
 $override = array()
 $transliterator = null
 $pluralSuffixesCallback = null
 $ignoredSearchWordsCallback = null
 $lowerLimitSearchWordCallback = null
 $upperLimitSearchWordCallback = null
 $searchDisplayedCharactersNumberCallback = null

Attributs protégés statiques

static $languages = array()

Description détaillée

Définition à la ligne 24 du fichier language.php.


Documentation des constructeurs et destructeur

JLanguage::__construct (   $lang = null,
  $debug = false 
)

Constructor activating the default information of the language.

Paramètres:
string$langThe language
boolean$debugIndicates if language debugging is enabled.
Depuis:
11.1

Définition à la ligne 186 du fichier language.php.

{
$this->strings = array();
if ($lang == null)
{
}
$this->setLanguage($lang);
$this->setDebug($debug);
$filename = JPATH_BASE . "/language/overrides/$lang.override.ini";
if (file_exists($filename) && $contents = $this->parse($filename))
{
if (is_array($contents))
{
// Sort the underlying heap by key values to optimize merging
ksort($contents, SORT_STRING);
$this->override = $contents;
}
unset($contents);
}
// Look for a language specific localise class
$class = str_replace('-', '_', $lang . 'Localise');
$paths = array();
if (defined('JPATH_SITE'))
{
// Note: Manual indexing to enforce load order.
$paths[0] = JPATH_SITE . "/language/overrides/$lang.localise.php";
$paths[2] = JPATH_SITE . "/language/$lang/$lang.localise.php";
}
if (defined('JPATH_ADMINISTRATOR'))
{
// Note: Manual indexing to enforce load order.
$paths[1] = JPATH_ADMINISTRATOR . "/language/overrides/$lang.localise.php";
$paths[3] = JPATH_ADMINISTRATOR . "/language/$lang/$lang.localise.php";
}
ksort($paths);
$path = reset($paths);
while (!class_exists($class) && $path)
{
if (file_exists($path))
{
require_once $path;
}
$path = next($paths);
}
if (class_exists($class))
{
/* Class exists. Try to find
* -a transliterate method,
* -a getPluralSuffixes method,
* -a getIgnoredSearchWords method
* -a getLowerLimitSearchWord method
* -a getUpperLimitSearchWord method
* -a getSearchDisplayCharactersNumber method
*/
if (method_exists($class, 'transliterate'))
{
$this->transliterator = array($class, 'transliterate');
}
if (method_exists($class, 'getPluralSuffixes'))
{
$this->pluralSuffixesCallback = array($class, 'getPluralSuffixes');
}
if (method_exists($class, 'getIgnoredSearchWords'))
{
$this->ignoredSearchWordsCallback = array($class, 'getIgnoredSearchWords');
}
if (method_exists($class, 'getLowerLimitSearchWord'))
{
$this->lowerLimitSearchWordCallback = array($class, 'getLowerLimitSearchWord');
}
if (method_exists($class, 'getUpperLimitSearchWord'))
{
$this->upperLimitSearchWordCallback = array($class, 'getUpperLimitSearchWord');
}
if (method_exists($class, 'getSearchDisplayedCharactersNumber'))
{
$this->searchDisplayedCharactersNumberCallback = array($class, 'getSearchDisplayedCharactersNumber');
}
}
$this->load();
}

Documentation des fonctions membres

JLanguage::_ (   $string,
  $jsSafe = false,
  $interpretBackSlashes = true 
)

Translate function, mimics the php gettext (alias _) function.

The function checks if $jsSafe is true, then if $interpretBackslashes is true.

Paramètres:
string$stringThe string to translate
boolean$jsSafeMake the result javascript safe
boolean$interpretBackSlashesInterpret and
Renvoie:
string The translation of the string
Depuis:
11.1

Définition à la ligne 320 du fichier language.php.

{
// Detect empty string
if ($string == '')
{
return '';
}
$key = strtoupper($string);
if (isset($this->strings[$key]))
{
$string = $this->debug ? '**' . $this->strings[$key] . '**' : $this->strings[$key];
// Store debug information
if ($this->debug)
{
$caller = $this->getCallerInfo();
if (!array_key_exists($key, $this->used))
{
$this->used[$key] = array();
}
$this->used[$key][] = $caller;
}
}
else
{
if ($this->debug)
{
$caller = $this->getCallerInfo();
$caller['string'] = $string;
if (!array_key_exists($key, $this->orphans))
{
$this->orphans[$key] = array();
}
$this->orphans[$key][] = $caller;
$string = '??' . $string . '??';
}
}
if ($jsSafe)
{
// Javascript filter
$string = addslashes($string);
}
elseif ($interpretBackSlashes)
{
// Interpret \n and \t characters
$string = str_replace(array('\\\\', '\t', '\n'), array("\\", "\t", "\n"), $string);
}
return $string;
}
static JLanguage::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:
11.1

Définition à la ligne 687 du fichier language.php.

{
static $paths = array();
// Return false if no language was specified
if (!$lang)
{
return false;
}
$path = $basePath . '/language/' . $lang;
// Return previous check results if it exists
if (isset($paths[$path]))
{
return $paths[$path];
}
// Check if the language exists
$paths[$path] = is_dir($path);
return $paths[$path];
}
JLanguage::get (   $property,
  $default = null 
)

Get a metadata language property.

Paramètres:
string$propertyThe name of the property.
mixed$defaultThe default value.
Renvoie:
mixed The value of the property.
Depuis:
11.1

Définition à la ligne 918 du fichier language.php.

{
if (isset($this->metadata[$property]))
{
return $this->metadata[$property];
}
return $default;
}
JLanguage::getCallerInfo ( )
protected

Determine who called JLanguage or JText.

Renvoie:
array Caller information.
Depuis:
11.1

Définition à la ligne 935 du fichier language.php.

{
// Try to determine the source if none was provided
if (!function_exists('debug_backtrace'))
{
return null;
}
$backtrace = debug_backtrace();
$info = array();
// Search through the backtrace to our caller
$continue = true;
while ($continue && next($backtrace))
{
$step = current($backtrace);
$class = @ $step['class'];
// We're looking for something outside of language.php
if ($class != 'JLanguage' && $class != 'JText')
{
$info['function'] = @ $step['function'];
$info['class'] = $class;
$info['step'] = prev($backtrace);
// Determine the file and name of the file
$info['file'] = @ $step['file'];
$info['line'] = @ $step['line'];
$continue = false;
}
}
return $info;
}
JLanguage::getDebug ( )

Get the Debug property.

Renvoie:
boolean True is in debug mode.
Depuis:
11.1

Définition à la ligne 1070 du fichier language.php.

{
return $this->debug;
}
JLanguage::getDefault ( )

Get the default language code.

Renvoie:
string Language code.
Depuis:
11.1

Définition à la ligne 1082 du fichier language.php.

{
}
JLanguage::getErrorFiles ( )

Get a list of language files that are in error state.

Renvoie:
array
Depuis:
11.1

Définition à la ligne 1017 du fichier language.php.

{
}
JLanguage::getFirstDay ( )

Get the first day of the week for this language.

Renvoie:
integer The first day of the week according to the language
Depuis:
11.1

Définition à la ligne 1267 du fichier language.php.

{
return (int) (isset($this->metadata['firstDay']) ? $this->metadata['firstDay'] : 0);
}
JLanguage::getIgnoredSearchWords ( )

Returns an array of ignored search words

Renvoie:
array The array of ignored search words.
Depuis:
11.1

Définition à la ligne 490 du fichier language.php.

{
if ($this->ignoredSearchWordsCallback !== null)
{
return call_user_func($this->ignoredSearchWordsCallback);
}
else
{
return array();
}
}
JLanguage::getIgnoredSearchWordsCallback ( )

Getter for ignoredSearchWordsCallback function.

Renvoie:
callable Function name or the actual function.
Depuis:
11.1

Définition à la ligne 509 du fichier language.php.

static JLanguage::getInstance (   $lang,
  $debug = false 
)
static

Returns a language object.

Paramètres:
string$langThe language to use.
boolean$debugThe debug mode.
Renvoie:
JLanguage The Language object.
Depuis:
11.1

Définition à la ligne 297 du fichier language.php.

Référencé par JFactory\createLanguage().

{
if (!isset(self::$languages[$lang . $debug]))
{
self::$languages[$lang . $debug] = new JLanguage($lang, $debug);
}
return self::$languages[$lang . $debug];
}

+ Voici le graphe des appelants de cette fonction :

static JLanguage::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:
11.1

Définition à la ligne 1184 du fichier language.php.

Référencé par JLanguageHelper\createLanguageList(), et JLanguageHelper\getLanguages().

{
$dir = self::getLanguagePath($basePath);
$knownLanguages = self::parseLanguageFiles($dir);
return $knownLanguages;
}

+ Voici le graphe des appelants de cette fonction :

static JLanguage::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:
11.1

Définition à la ligne 1202 du fichier language.php.

{
$dir = $basePath . '/language';
if (!empty($language))
{
$dir .= '/' . $language;
}
return $dir;
}
JLanguage::getLocale ( )

Get the language locale based on current language.

Renvoie:
array The locale according to the language.
Depuis:
11.1

Définition à la ligne 1241 du fichier language.php.

{
if (!isset($this->locale))
{
$locale = str_replace(' ', '', isset($this->metadata['locale']) ? $this->metadata['locale'] : '');
if ($locale)
{
$this->locale = explode(',', $locale);
}
else
{
$this->locale = false;
}
}
return $this->locale;
}
JLanguage::getLowerLimitSearchWord ( )

Returns a lower limit integer for length of search words

Renvoie:
integer The lower limit integer for length of search words (3 if no value was set for a specific language).
Depuis:
11.1

Définition à la ligne 538 du fichier language.php.

{
if ($this->lowerLimitSearchWordCallback !== null)
{
return call_user_func($this->lowerLimitSearchWordCallback);
}
else
{
return 3;
}
}
JLanguage::getLowerLimitSearchWordCallback ( )

Getter for lowerLimitSearchWordCallback function

Renvoie:
callable Function name or the actual function.
Depuis:
11.1

Définition à la ligne 557 du fichier language.php.

static JLanguage::getMetadata (   $lang)
static

Returns a 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:
11.1

Définition à la ligne 1155 du fichier language.php.

{
$path = self::getLanguagePath(JPATH_BASE, $lang);
$file = $lang . '.xml';
$result = null;
if (is_file("$path/$file"))
{
$result = self::parseXMLLanguageFile("$path/$file");
}
if (empty($result))
{
return null;
}
return $result;
}
JLanguage::getName ( )

Getter for Name.

Renvoie:
string Official name element of the language.
Depuis:
11.1

Définition à la ligne 979 du fichier language.php.

{
return $this->metadata['name'];
}
JLanguage::getOrphans ( )

Get the list of orphaned strings if being tracked.

Renvoie:
array Orphaned text.
Depuis:
11.1

Définition à la ligne 1111 du fichier language.php.

{
}
JLanguage::getPaths (   $extension = null)

Get a list of language files that have been loaded.

Paramètres:
string$extensionAn optional extension name.
Renvoie:
array
Depuis:
11.1

Définition à la ligne 993 du fichier language.php.

{
if (isset($extension))
{
if (isset($this->paths[$extension]))
{
return $this->paths[$extension];
}
return null;
}
else
{
return $this->paths;
}
}
JLanguage::getPluralSuffixes (   $count)

Returns an array of suffixes for plural rules.

Paramètres:
integer$countThe count number the rule is for.
Renvoie:
array The array of suffixes.
Depuis:
11.1

Définition à la ligne 442 du fichier language.php.

{
if ($this->pluralSuffixesCallback !== null)
{
return call_user_func($this->pluralSuffixesCallback, $count);
}
else
{
return array((string) $count);
}
}
JLanguage::getPluralSuffixesCallback ( )

Getter for pluralSuffixesCallback function.

Renvoie:
callable Function name or the actual function.
Depuis:
11.1

Définition à la ligne 461 du fichier language.php.

JLanguage::getSearchDisplayedCharactersNumber ( )

Returns the number of characters displayed in search results.

Renvoie:
integer The number of characters displayed (200 if no value was set for a specific language).
Depuis:
11.1

Définition à la ligne 634 du fichier language.php.

{
if ($this->searchDisplayedCharactersNumberCallback !== null)
{
return call_user_func($this->searchDisplayedCharactersNumberCallback);
}
else
{
return 200;
}
}
JLanguage::getSearchDisplayedCharactersNumberCallback ( )

Getter for searchDisplayedCharactersNumberCallback function

Renvoie:
callable Function name or the actual function.
Depuis:
11.1

Définition à la ligne 653 du fichier language.php.

JLanguage::getTag ( )

Getter for the language tag (as defined in RFC 3066)

Renvoie:
string The language tag.
Depuis:
11.1

Définition à la ligne 1029 du fichier language.php.

{
return $this->metadata['tag'];
}
JLanguage::getTransliterator ( )

Getter for transliteration function

Renvoie:
callable The transliterator function
Depuis:
11.1

Définition à la ligne 411 du fichier language.php.

{
}
JLanguage::getUpperLimitSearchWord ( )

Returns an upper limit integer for length of search words

Renvoie:
integer The upper limit integer for length of search words (20 if no value was set for a specific language).
Depuis:
11.1

Définition à la ligne 586 du fichier language.php.

{
if ($this->upperLimitSearchWordCallback !== null)
{
return call_user_func($this->upperLimitSearchWordCallback);
}
else
{
return 20;
}
}
JLanguage::getUpperLimitSearchWordCallback ( )

Getter for upperLimitSearchWordCallback function

Renvoie:
callable Function name or the actual function.
Depuis:
11.1

Définition à la ligne 605 du fichier language.php.

JLanguage::getUsed ( )

Get the list of used strings.

Used strings are those strings requested and found either as a string or a constant.

Renvoie:
array Used strings.
Depuis:
11.1

Définition à la ligne 1125 du fichier language.php.

{
return $this->used;
}
JLanguage::getWeekEnd ( )

Get the weekends days for this language.

Renvoie:
string The weekend days of the week separated by a comma according to the language
Depuis:
3.2

Définition à la ligne 1279 du fichier language.php.

{
return (isset($this->metadata['weekEnd']) && $this->metadata['weekEnd']) ? $this->metadata['weekEnd'] : '0,6';
}
JLanguage::hasKey (   $string)

Determines is a key exists.

Paramètres:
string$stringThe key to check.
Renvoie:
boolean True, if the key exists.
Depuis:
11.1

Définition à la ligne 1139 du fichier language.php.

{
$key = strtoupper($string);
return isset($this->strings[$key]);
}
JLanguage::isRTL ( )

Get the RTL property.

Renvoie:
boolean True is it an RTL language.
Depuis:
11.1

Définition à la ligne 1041 du fichier language.php.

{
return (bool) $this->metadata['rtl'];
}
JLanguage::load (   $extension = 'joomla',
  $basePath = JPATH_BASE,
  $lang = null,
  $reload = false,
  $default = true 
)

Loads a single language file and appends the results to the existing strings

Paramètres:
string$extensionThe extension for which a language file should be loaded.
string$basePathThe basepath to use.
string$langThe language to load, default null for the current language.
boolean$reloadFlag that will force a language to be reloaded if set to true.
boolean$defaultFlag that force the default language to be loaded if the current does not exist.
Renvoie:
boolean True if the file has successfully loaded.
Depuis:
11.1

Définition à la ligne 724 du fichier language.php.

{
if (!$lang)
{
}
$path = self::getLanguagePath($basePath, $lang);
$internal = $extension == 'joomla' || $extension == '';
$filename = $internal ? $lang : $lang . '.' . $extension;
$filename = "$path/$filename.ini";
if (isset($this->paths[$extension][$filename]) && !$reload)
{
// This file has already been tested for loading.
$result = $this->paths[$extension][$filename];
}
else
{
// Load the language file
$result = $this->loadLanguage($filename, $extension);
// Check whether there was a problem with loading the file
if ($result === false && $default)
{
// No strings, so either file doesn't exist or the file is invalid
$oldFilename = $filename;
// Check the standard file name
$path = self::getLanguagePath($basePath, $this->default);
$filename = $internal ? $this->default : $this->default . '.' . $extension;
$filename = "$path/$filename.ini";
// If the one we tried is different than the new name, try again
if ($oldFilename != $filename)
{
$result = $this->loadLanguage($filename, $extension, false);
}
}
}
return $result;
}
JLanguage::loadLanguage (   $filename,
  $extension = 'unknown' 
)
protected

Loads a language file.

This method will not note the successful loading of a file - use load() instead.

Paramètres:
string$filenameThe name of the file.
string$extensionThe name of the extension.
Renvoie:
boolean True if new strings have been added to the language
Voir également:
JLanguage::load()
Depuis:
11.1

Définition à la ligne 782 du fichier language.php.

{
$this->counter++;
$result = false;
$strings = false;
if (file_exists($filename))
{
$strings = $this->parse($filename);
}
if ($strings)
{
if (is_array($strings))
{
// Sort the underlying heap by key values to optimize merging
ksort($strings, SORT_STRING);
$this->strings = array_merge($this->strings, $strings);
}
if (is_array($strings) && count($strings))
{
// Do not bother with ksort here. Since the originals were sorted, PHP will already have chosen the best heap.
$this->strings = array_merge($this->strings, $this->override);
$result = true;
}
}
// Record the result of loading the extension's file.
if (!isset($this->paths[$extension]))
{
$this->paths[$extension] = array();
}
$this->paths[$extension][$filename] = $result;
return $result;
}
JLanguage::parse (   $filename)
protected

Parses a language file.

Paramètres:
string$filenameThe name of the file.
Renvoie:
array The array of parsed strings.
Depuis:
11.1

Définition à la ligne 831 du fichier language.php.

Références JText\sprintf().

{
if ($this->debug)
{
// Capture hidden PHP errors from the parsing.
$php_errormsg = null;
$track_errors = ini_get('track_errors');
ini_set('track_errors', true);
}
$contents = file_get_contents($filename);
$contents = str_replace('_QQ_', '"\""', $contents);
$strings = @parse_ini_string($contents);
if (!is_array($strings))
{
$strings = array();
}
if ($this->debug)
{
// Restore error tracking to what it was before.
ini_set('track_errors', $track_errors);
// Initialise variables for manually parsing the file for common errors.
$blacklist = array('YES', 'NO', 'NULL', 'FALSE', 'ON', 'OFF', 'NONE', 'TRUE');
$regex = '/^(|(\[[^\]]*\])|([A-Z][A-Z0-9_\-\.]*\s*=(\s*(("[^"]*")|(_QQ_)))+))\s*(;.*)?$/';
$this->debug = false;
$errors = array();
// Open the file as a stream.
$file = new SplFileObject($filename);
foreach ($file as $lineNumber => $line)
{
// Avoid BOM error as BOM is OK when using parse_ini
if ($lineNumber == 0)
{
$line = str_replace("\xEF\xBB\xBF", '', $line);
}
// Check that the key is not in the blacklist and that the line format passes the regex.
$key = strtoupper(trim(substr($line, 0, strpos($line, '='))));
// Workaround to reduce regex complexity when matching escaped quotes
$line = str_replace('\"', '_QQ_', $line);
if (!preg_match($regex, $line) || in_array($key, $blacklist))
{
$errors[] = $lineNumber;
}
}
// Check if we encountered any errors.
if (count($errors))
{
if (basename($filename) != $this->lang . '.ini')
{
$this->errorfiles[$filename] = $filename . JText::sprintf('JERROR_PARSING_LANGUAGE_FILE', implode(', ', $errors));
}
else
{
$this->errorfiles[$filename] = $filename . ' : error(s) in line(s) ' . implode(', ', $errors);
}
}
elseif ($php_errormsg)
{
// We didn't find any errors but there's probably a parse notice.
$this->errorfiles['PHP' . $filename] = 'PHP parser errors :' . $php_errormsg;
}
$this->debug = true;
}
return $strings;
}

+ Voici le graphe d'appel pour cette fonction :

static JLanguage::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:
11.1

Définition à la ligne 1293 du fichier language.php.

{
$languages = array();
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir));
foreach ($iterator as $file)
{
$langs = array();
$fileName = $file->getFilename();
if (!$file->isFile() || !preg_match("/^([-_A-Za-z]*)\.xml$/", $fileName))
{
continue;
}
try
{
$metadata = self::parseXMLLanguageFile($file->getRealPath());
if ($metadata)
{
$lang = str_replace('.xml', '', $fileName);
$langs[$lang] = $metadata;
}
$languages = array_merge($languages, $langs);
}
catch (RuntimeException $e)
{
}
}
return $languages;
}
static JLanguage::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:
11.1
Exceptions:
RuntimeException

Définition à la ligne 1339 du fichier language.php.

{
if (!is_readable($path))
{
throw new RuntimeException('File not found or not readable');
}
// Try to load the file
$xml = simplexml_load_file($path);
if (!$xml)
{
return null;
}
// Check that it's a metadata file
if ((string) $xml->getName() != 'metafile')
{
return null;
}
$metadata = array();
foreach ($xml->metadata->children() as $child)
{
$metadata[$child->getName()] = (string) $child;
}
return $metadata;
}
JLanguage::setDebug (   $debug)

Set the Debug property.

Paramètres:
boolean$debugThe debug setting.
Renvoie:
boolean Previous value.
Depuis:
11.1

Définition à la ligne 1055 du fichier language.php.

{
$previous = $this->debug;
$this->debug = (boolean) $debug;
return $previous;
}
JLanguage::setDefault (   $lang)

Set the default language code.

Paramètres:
string$langThe language code.
Renvoie:
string Previous value.
Depuis:
11.1

Définition à la ligne 1096 du fichier language.php.

{
$previous = $this->default;
$this->default = $lang;
return $previous;
}
JLanguage::setIgnoredSearchWordsCallback (   $function)

Setter for the ignoredSearchWordsCallback function

Paramètres:
callable$functionFunction name or actual function.
Renvoie:
callable The previous function.
Depuis:
11.1

Définition à la ligne 523 du fichier language.php.

{
$this->ignoredSearchWordsCallback = $function;
return $previous;
}
JLanguage::setLanguage (   $lang)

Set the language attributes to the given language.

Once called, the language still needs to be loaded using JLanguage::load().

Paramètres:
string$langLanguage code.
Renvoie:
string Previous value.
Depuis:
11.1

Définition à la ligne 1225 du fichier language.php.

{
$previous = $this->lang;
$this->lang = $lang;
$this->metadata = $this->getMetadata($this->lang);
return $previous;
}
JLanguage::setLowerLimitSearchWordCallback (   $function)

Setter for the lowerLimitSearchWordCallback function.

Paramètres:
callable$functionFunction name or actual function.
Renvoie:
callable The previous function.
Depuis:
11.1

Définition à la ligne 571 du fichier language.php.

{
$this->lowerLimitSearchWordCallback = $function;
return $previous;
}
JLanguage::setPluralSuffixesCallback (   $function)

Set the pluralSuffixes function.

Paramètres:
callable$functionFunction name or actual function.
Renvoie:
callable The previous function.
Depuis:
11.1

Définition à la ligne 475 du fichier language.php.

{
$this->pluralSuffixesCallback = $function;
return $previous;
}
JLanguage::setSearchDisplayedCharactersNumberCallback (   $function)

Setter for the searchDisplayedCharactersNumberCallback function.

Paramètres:
callable$functionFunction name or the actual function.
Renvoie:
callable The previous function.
Depuis:
11.1

Définition à la ligne 667 du fichier language.php.

{
$this->searchDisplayedCharactersNumberCallback = $function;
return $previous;
}
JLanguage::setTransliterator (   $function)

Set the transliteration function.

Paramètres:
callable$functionFunction name or the actual function.
Renvoie:
callable The previous function.
Depuis:
11.1

Définition à la ligne 425 du fichier language.php.

{
$previous = $this->transliterator;
$this->transliterator = $function;
return $previous;
}
JLanguage::setUpperLimitSearchWordCallback (   $function)

Setter for the upperLimitSearchWordCallback function

Paramètres:
callable$functionFunction name or the actual function.
Renvoie:
callable The previous function.
Depuis:
11.1

Définition à la ligne 619 du fichier language.php.

{
$this->upperLimitSearchWordCallback = $function;
return $previous;
}
JLanguage::transliterate (   $string)

Transliterate function

This method processes a string and replaces all accented UTF-8 characters by unaccented ASCII-7 "equivalents".

Paramètres:
string$stringThe string to transliterate.
Renvoie:
string The transliteration of the string.
Depuis:
11.1

Définition à la ligne 391 du fichier language.php.

Références JString\strtolower(), et JLanguageTransliterate\utf8_latin_to_ascii().

{
if ($this->transliterator !== null)
{
return call_user_func($this->transliterator, $string);
}
$string = JString::strtolower($string);
return $string;
}

+ Voici le graphe d'appel pour cette fonction :


Documentation des données membres

JLanguage::$counter = 0
protected

Définition à la ligne 120 du fichier language.php.

JLanguage::$debug = false
protected

Définition à la ligne 40 du fichier language.php.

JLanguage::$default = 'en-GB'
protected

Définition à la ligne 48 du fichier language.php.

JLanguage::$errorfiles = array()
protected

Définition à la ligne 96 du fichier language.php.

JLanguage::$ignoredSearchWordsCallback = null
protected

Définition à la ligne 152 du fichier language.php.

JLanguage::$lang = null
protected

Définition à la ligne 80 du fichier language.php.

JLanguage::$languages = array()
staticprotected

Définition à la ligne 32 du fichier language.php.

JLanguage::$locale = null
protected

Définition à la ligne 72 du fichier language.php.

JLanguage::$lowerLimitSearchWordCallback = null
protected

Définition à la ligne 160 du fichier language.php.

JLanguage::$metadata = null
protected

Définition à la ligne 64 du fichier language.php.

JLanguage::$orphans = array()
protected

Définition à la ligne 56 du fichier language.php.

JLanguage::$override = array()
protected

Définition à la ligne 128 du fichier language.php.

JLanguage::$paths = array()
protected

Définition à la ligne 88 du fichier language.php.

JLanguage::$pluralSuffixesCallback = null
protected

Définition à la ligne 144 du fichier language.php.

JLanguage::$searchDisplayedCharactersNumberCallback = null
protected

Définition à la ligne 176 du fichier language.php.

JLanguage::$strings = array()
protected

Définition à la ligne 104 du fichier language.php.

JLanguage::$transliterator = null
protected

Définition à la ligne 136 du fichier language.php.

JLanguage::$upperLimitSearchWordCallback = null
protected

Définition à la ligne 168 du fichier language.php.

JLanguage::$used = array()
protected

Définition à la ligne 112 du fichier language.php.


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