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',);