Translating Process

Working with language translations

Creating new languages

New languages can be added to AbanteCart as extensions from the marketplace or downloaded from Alternately, new languages can be created in the admin manually. This is done with creating new language in System -> Localization -> Languages. In this case, language can be translated using auto-translation mode in "Load missing language data" section. 
We recommend creating new language by creating new extension. Simplest process will be to copy any existing language extension, rename all files, replace flag icons and translate the text. Text can be translated using Google translator and manually verified and corrected.

Using Language translations in the code

AbanteCart using ALanguage class to handle all text translation. There is a global instance of ALanguage class always present in the registry for all controllers. Default language set from selected language [english.xml] is loaded for any run and available in any place. If any additional language sets are loaded they might override translation if same keys are used. Keep this in mind. To avoid overriding language text can be requested from specific section by specifying section at an argument to get() function. In controller, values can be accessed with function $this->language->get()

In the template (corresponding .tpl file) this value will be available in $heading_title
Each controller auto-loads corresponding language translation that is available for it. For instance, for controller catalog/product there will be catalog/product language set loaded automatically once the controller is loaded.
If you need more translation, you can load any other language set that will be used in controller and templates that are processed by given controller. Below are the examples how it is done:

To add a language translation, you need to create an XML file and place it to the corespondent location in admin[storefront]/language/english/.. directory.
Once controller loads this new language translation XML fist time it will load XML details to the database and will cache the result. Once XML files are loaded in the database they are no longer used (possibly only for reset of values in the database). Translations are now used from database or cache. Users can change translations and these will reset the cache automatically after edit.

You can always create a new local instance of ALanguage class, but this is not desired.