Lang

Translate given argument

Translates the given argument to current lang.

Glossary

Arguments

$string
Text to be translated.
$variable
Value to replace %s inside the text.

Example

Text for save -button:

$txtSave = $this->get('lang','save');

Get title for word 'Table'

$txtTable = $this->get('lang', 'table');

If /title is not given but is found in glossary, it is used. Thus, the example above is shorthand for:

$txtTable = $this->get('lang', 'table/title');

Get plural version of word 'Table'

$txtTables = $this->get('lang', 'table/plural');

Using variables inside translation: 'Add new %s'

$addCustomer = $this->get('lang', 'record_add', 'Customer');