public class Lang

class.lang.php #43

The Lang class loads and manages languages

Methods

public static
class.lang.php #81
static array Dictionary()

Get the current dictionary

Returns

Return the dictionary

public static
class.lang.php #113
static array Languages()

Get a list of either enabled or disabled languages. Example:

	          array(
	    [...]

	    'en' => array(
	        'name' => 'English',
	        'handle' => 'english',
	        'extensions' => array()
	    ),

	    'it' => array(
	        'name' => 'Italiano',
	        'handle' => 'italian',
	        'extensions' => array(
	            [...]
	        )
	    ),

	    [...]
	)
	
	        
Returns

Return an array of languages (both enabled and disabled)

See Also
public static
class.lang.php #123
static array Transliterations()

Get transliterations

Returns

Returns the transliterations array

public static
class.lang.php #531
static string createFilename(string $string, string $delim, boolean $apply_transliteration)

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

Parameters
  • $string stringString to be cleaned up

  • $delim stringReplacement for invalid characters

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

Returns

Returns created filename

public static
class.lang.php #510
static string createHandle(string $string, int $max_length, string $delim, boolean $uriencode, boolean $apply_transliteration, array $additional_rule_set)

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

Parameters
  • $string stringString to be cleaned up

  • $max_length intThe maximum number of characters in the handle

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

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

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

  • $additional_rule_set arrayAn array of REGEX patterns that should be applied to the $string. This occurs after the string has been trimmed and joined with the $delim

Returns

Returns resultant handle

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

Get current language

public static
class.lang.php #418
static array getAvailableLanguages(boolean $checkStatus)

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.

Parameters
  • $checkStatus boolean(optional) If false, retrieves a list a languages that support core translation.

Returns

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

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

Initialize transliterations, datetime dictionary and languages array.

public static
class.lang.php #321
static boolean isLanguageEnabled(string $code)

Given a valid language code, this function checks if the language is enabled.

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

Returns

If true, the language is enabled.

public static
class.lang.php #438
static boolean isLocalized()

Check if Symphony is localised.

Returns

Returns true for localized system, false for English system

public static
class.lang.php #570
static boolean isUnicodeCompiled()

Returns boolean if PHP has been compiled with unicode support. This is useful to determine if unicode modifier's can be used in regular expression's

See Also
public static
class.lang.php #450
static string localizeDate(string $string)

Localize dates.

Parameters
  • $string stringStandard date that should be localized

Returns

Return the given date with translated month and day names

public static
class.lang.php #270
static void set(string $code, boolean $checkStatus)

Set system language, load translations for core and extensions. If the specified language cannot be found, Symphony will default to English.

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

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

  • $checkStatus boolean(optional) If false, set the language even if it's not enabled. Defaults to true.

public static
class.lang.php #469
static string standardizeDate(string $string)

Standardize dates.

Parameters
  • $string stringLocalized date that should be standardized

Returns

Returns the given date with English month and day names

public static
class.lang.php #382
static string translate(string $string, array $inserts, string $namespace)

This function is an internal alias for __().

Parameters
  • $string stringThe string that should be translated

  • $inserts array(optional) Optional array used to replace translation placeholders, defaults to NULL

  • $namespace string(optional) Optional string used to define the namespace, defaults to NULL.

Returns

Returns the translated string

See Also

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