Management of language configuration items in Ecshop

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.