public class Symphony.Language

symphony.js

The Language object stores the dictionary with all needed translations. It offers public functions to add strings and get their translation and it offers private functions to handle variables and get the translations via an synchronous AJAX request. Since Symphony 2.3, it is also possible to define different translations for the same string, by using page namespaces. This is a private object

Methods

public static
symphony.js
static Language()

The Language object stores the dictionary with all needed translations. It offers public functions to add strings and get their translation and it offers private functions to handle variables and get the translations via an synchronous AJAX request. Since Symphony 2.3, it is also possible to define different translations for the same string, by using page namespaces. This is a private object

public static
static add(Object $strings)

Add strings to the Dictionary

Parameters
  • $strings ObjectObject with English string as key, value should be false

public static
static String get(String $string, Object $inserts)

Get translated string from the Dictionary. The function replaces variables like {$name} with the a specified value if an object of inserts is passed in the function call.

Parameters
  • $string StringEnglish string to be translated

  • $inserts ObjectObject with variable name and value pairs

Returns

Returns the translated string

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