Opencart Architecture
April 4, 2015
Libraries
Languages
Languages are stored in catalog/language/ and loaded in Controllers
Define a language key
The Values that are used across many pages are stored is english.php. If you want to add a new value just follow the syntax below:
code
$_['language_key']='This is test';
Load a language
The languages based on special pages are located inside the folders. For example, for error page the language file can be found at:
code
catalog/language/english/error/not_found.php
Language file can be loaded into controller by using the syntax as below:
code
$this->language->load('error/not_found');
Fetch Language Value
code
$this->language->get('language_key');
Loading and Using a language
code
$this->language->load('route path of the language');
to get the specific language data use this syntax
code
$this->language->get('language file data keyword');