How to do long country, multi-language e-commerce website design

Source: Internet
Author: User
Tags time zones
Now the company to do in a number of countries, support multi-lingual website, that we should design, is under a domain name, through/cn,/fr this form to do, or through the domain name. fr,.en,.cn is better.

Reply content:

Now the company to do in a number of countries, support multi-lingual website, that we should design, is under a domain name, through/cn,/fr this form to do, or through the domain name. fr,.en,.cn is better.

It is recommended that you use a subdomain, not a directory.
For example, your main station is
www.example.com
The following are the sub-stations

zh.example.com //中国us.example.com //美国jp.example.com //日本...

Personally think how comfortable how to come, Amazon they don't have no domain name
But if you want each country to be in a synchronized state, you need to consider a cookie cross-domain issue.

Assuming that a domain name is used to provide services to many countries around the world, in addition to solving the language problem, it is more important to solve the time zone problem. Our platform development defaults to the East Eight (Beijing time), which may not be a concern. At this point, you need to let the user choose their country (determine language) and time zone ( Some countries have multiple time zones, such as the United States.

If Date.timezone is not configured in php.ini, the default time is Coordinated Universal Time UTC (Universal times coordinated).

ini_set('date.timezone', 'UTC'); //UTC时间echo date('Y-m-d H:i:s', time())."\n"; //输出2015-12-11 02:43:28ini_set('date.timezone', 'PRC'); //北京时间(UTC+8)echo date('Y-m-d H:i:s', time());."\n" //输出2015-12-11 10:43:28

To develop a Web site that targets multiple time zones, the database stores UTC time, and the output is based on a time zone.
JS Gets the client time, calculates the difference between the client and the server, and then calculates the activity time of the visiting guest's time zone.
The United States does not have a unified Beijing time, the United States has four time zones in use, very chaotic.

As for the multi-lingual, it is quite good to solve, with the array on the line, with the login interface as an example:

在render加载模板时require语言文件:require APP_ROOT.'/lang/'.$app['lang'].'/'.$template;require APP_ROOT.'/themes/'.$app['theme'].'/'.$template;lang/zh_CN/login.php
  
    '登录',    'Username'    => '帐号',    'Password'    => '密码',    'Remember me' => '记住我',);lang/en_US/login.php
  
    'Login',    'Username' => 'Username',    'Password' => 'Password',    'Remember me' => 'Remember me',);
  • 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.