Elgg  Version 1.9
Functions | Variables
languages.js File Reference

Go to the source code of this file.


elgg provide ('elgg.config.translations')
 Provides language-related functionality. More...


elgg config language = 'en'
elgg add_translation
 Analagous to the php version. More...
elgg get_language
 Get the current language. More...
elgg echo
 Translates a string. More...

Function Documentation

elgg provide ( 'elgg.config.translations )

Provides language-related functionality.

Variable Documentation

elgg add_translation
Initial value:
= function(lang, translations) {
elgg.provide('elgg.config.translations.' + lang);
elgg.extend(elgg.config.translations[lang], translations);
Definition: install.js:23
$CONFIG translations
String translations for the current language.
Definition: config.php:48

Analagous to the php version.

Merges translations for a given language into the current translations map.

Definition at line 14 of file languages.js.

elgg echo
Initial value:
= function(key, argv, language) {
if (elgg.isString(argv)) {
language = argv;
argv = [];
var translations = elgg.config.translations,
dlang = elgg.get_language(),
language = language || dlang;
argv = argv || [];
map = translations[language] || translations[dlang];
if (map && map[key]) {
return vsprintf(map[key], argv);
return key;
Definition: install.js:23
elgg config language
Definition: languages.js:8
$CONFIG translations
String translations for the current language.
Definition: config.php:48

Translates a string.

{String}key The string to translate
{Array}argv vsprintf support
{String}language The language to display it in
{String} The translation

Definition at line 43 of file languages.js.

elgg get_language
Initial value:
= function() {
var user = elgg.get_logged_in_user_entity();
if (user && user.language) {
return user.language;
return elgg.config.language;
Definition: install.js:23
elgg menu user
Definition: admin.php:190

Get the current language.


Definition at line 24 of file languages.js.

elgg config language = 'en'

Definition at line 8 of file languages.js.