Notes
Opencart Architecture
early notes on OpenCart architecture, mostly how language files are defined, loaded and read in controllers
OpenCart
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:
1$_['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:
catalog/language/english/error/not_found.php
Language file can be loaded into controller by using the syntax as below:
1$this->language->load('error/not_found');
Fetch Language Value
1$this->language->get('language_key');
Loading and Using a language
1$this->language->load('route path of the language');
to get the specific language data use this syntax
1$this->language->get('language file data keyword');