Ecshop is a world-oriented open-source marketplace system, so the setting of the language pack is essential, so now the Ecshop provides 3 language packs, which are traditional, simplified and English, respectively. These language pack files are placed by default under the root directory languages.
Here's how the language pack is loaded to facilitate the two development process, modifying the default configuration items.
Ecshop basically back-Office files have
Require (DirName (__file__). '/includes/init.php ');
This introduction.
The role of this init.php file can be referenced in the Ecshop workflow loading configuration described here.
In this file, $smarty->assign (' Lang ', $_lang);
This is to assign the data in the language pack to the variable lang so that the foreground can be called. Say, the configuration in the language pack is given by an array,
This way, if the background call, the introduction of the language package file directly, you can use, for example, the background file by introducing \languages\en_us\common.php This file, we can use the inside of the array $_lang[' User_center '] To get User_center language configuration, because init.php inside the default introduced require (Root_path. ' Languages/'. $_cfg[' Lang '. '/common.php ');
So language inside of the common.php configuration array is available in any loaded init.php file.
If you want to use other files, you need to introduce them when you use them.
For example, flow.php the configuration file for the purchase process in the file of this order processing process, we should introduce
\languages\en_us\shopping_flow.php This file is in flow.php.
The following is the modification of these files, by default, as long as in the languages directly under the directory of the files are can be modified by the background, so that the customer's own modifications to provide convenience, and for security and convenience, the background used search to find later modified, so positioning fast, simple and convenient user use.
Management of language configuration items in Ecshop