public class Lang

class.lang.php #148

The Lang class loads and manages languages

Properties

public static
class.lang.php #160
static array $_languages

Context information of all available languages

Methods

public static
class.lang.php #186
static Dictionary Dictionary()

Get dictionary

Returns

Return the current dictionary

public static
class.lang.php #196
static array Transliterations()

Get transliterations

Returns

Returns the array of transliterations

public static
class.lang.php #247
static void activate()

Activate language, load translations for core and extensions. If the specified language cannot be found, Symphony will default to English. If no language is available at all, Symphony will throw an error.

Note: Beginning with Symphony 2.2 translations bundled with extensions will only be loaded when the core dictionary of the specific language is available.

public static
class.lang.php #627
static string createFilename()

Given a string, this will clean it for use as a filename. Preserves multi-byte characters.

Parameters
  • $string String to be cleaned up

  • $delim Replacement for invalid characters

  • $apply_transliteration If true, umlauts and special characters will be substituted

Returns

Returns created filename

public static
class.lang.php #572
static string createHandle()

Given a string, this will clean it for use as a Symphony handle. Preserves multi-byte characters.

Parameters
  • $string String to be cleaned up

  • $max_length The maximum number of characters in the handle

  • $delim All non-valid characters will be replaced with this

  • $uriencode Force the resultant string to be uri encoded making it safe for URLs

  • $apply_transliteration If true, this will run the string through an array of substitution characters

Returns

Returns resultant handle

public static
class.lang.php #303
static void fetch()

Fetch all languages available in the core language folder and the language extensions. The function stores all language information in the public variable $_languages. It contains an array with the name, source, path and status of each language. Furthermore it add an array of all extensions available in a specific language. The language status (enabled/disabled) can only be determined when the Extension Manager has been initialized before. During installation all extension status are set to disabled.

public static
class.lang.php #233
static string get()

Get current language

public static
class.lang.php #480
static array getAvailableLanguages()

Get an array of the codes and names of all languages that are available system wide.

Note: Beginning with Symphony 2.2 language files are only available when the language extension is explicitly enabled.

Returns

Returns an associative array of language codes and names, e. g. 'en' => 'English'

public static
class.lang.php #203
static void initialize()

Initialize dictionary, transliterations and dates array

boolean isLocalized()

Check if Symphony is localised.

Returns

Returns true for localized system, false for English system

public static
class.lang.php #420
static void load()

Load language file. Each language file contains three arrays: about, dictionary and transliterations.

Parameters
  • $path Path of the language file that should be loaded

  • $clear True, if the current dictionary should be cleared, defaults to false

public static
class.lang.php #512
static string localizeDate()

Localize dates.

Parameters
  • $string Standard date that should be localized

Returns

Return the given date with translated month and day names

public static
class.lang.php #216
static void set()

Set system language.

Parameters
  • $lang Language code, e. g. 'en' or 'pt-br'

public static
class.lang.php #532
static string standardizeDate()

Standardize dates.

Parameters
  • $string Localized date that should be standardized

Returns

Returns the given date with English month and day names

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details