Version of Ecshop currently in use: 2.7.3,ecshop 2.7. The location of the language pack for the 3 version of the online store system is under the Ecshop file languages/xxx/where the XXX represents the various language folders that contain the contents of the specified language. The default language pack for Ecshop is the Chinese Simplified zh_cn directory.
The loading process for language packs is through the Require (Root_path) in the init.php of Ecshop. ' Languages/'. $_cfg[' Lang '. '/common.php ') handles and controls the code to load.
The value of this $_cfg[' lang ' is stored in the data table Shop_config. Searches for the Code=lang record, and the corresponding value is the language pack name. The default is ZH_CN.
The array name in all language packs is $_lang.
We can see the initialization of the $smarty->assign (' Lang ', $_lang) in init.php by Smarty;
When the Ecshop language pack is initialized, we can access each name in the language pack through {$lang. Edit} in the template.
Ecshop backstage, also have fastidious. Language Pack loading. His control file is inside the admin/includes/init.php.
[PHP]View PlainCopy
- Require (Root_path. ' languages/'. $_cfg[' Lang '. '/admin/common.php ');
- Require (Root_path. ' languages/'. $_cfg[' Lang '. '/admin/log_action.php ');
- if (file_exists (Root_path. ' languages/'. $_cfg[' Lang '. '/admin/'. basename (php_self)))
- {
- Include (Root_path. ' languages/'. $_cfg[' Lang '. '/admin/'. basename (php_self));
- }
Suppose a file in the background is named admin/user.php.
Then the language pack file used for this page is the loaded languages\zh_cn\admin\user.php
This has to be especially important.
This means that if you want to create a new page in the background. Then also in the language pack to create a new language package file can be.
Ecshop the loading principle of the language pack lang