Skip to content

Language functions

Moisés Barrachina Planelles edited this page Oct 4, 2023 · 3 revisions

Backend Frontend Template provides several functions about languages:

$this->languages_codes_names_get()

Returns a language list
  $languages_codes_names = [
		'ab' => $this->__('Abkhazian'),
		'aa' => $this->__('Afar'),
		'af' => $this->__('Afrikaans'),
		'ak' => $this->__('Akan'),
		'sq' => $this->__('Albanian'),
		'am' => $this->__('Amharic'),
		[...]

$this->languages_get($country_code)

Returns the data stored in the setting $this->option_field_get("languages")

$this->language_admin_get($country_code)

Returns the data stored in the setting $this->option_field_get("language_admin") if exists in $this->option_field_get("languages")

If languages empty it will set the languages 'en' and 'es'
If language_admin empty or not found on languages, it will set the first language stored in languages
Clone this wiki locally