How can I create a multilingual website version?

Source: Internet
Author: User
For example, for a website like this, the product is the same after the language is switched, is a database shared, or is it simply a server? Www. farfetch. comcnshoppingwomencreatures-of-the-wind -- jainic-jacket -- item-11220708.aspx? Storeid99...

For example, for a website like this, the product is the same after the language is switched, is a database shared, or is it simply a server?
Http://www.farfetch.com/cn/shopping/women/creatures-of-the-wind--jainic-jacket--item-11220708.aspx? Storeid = 9946 & from = 1 & ffref = lp_pic_5_1 _

Http://www.apicloud.com/index?

Thank you!

Reply content:

For example, for a website like this, the product is the same after the language is switched, is a database shared, or is it simply a server?
Http://www.farfetch.com/cn/shopping/women/creatures-of-the-wind--jainic-jacket--item-11220708.aspx? Storeid = 9946 & from = 1 & ffref = lp_pic_5_1 _

Http://www.apicloud.com/index?

Thank you!

Generally, frameworks provide such functions, such as php codeigniter and ruby on rails.
I have not studied the specific implementation, but the idea is to get the corresponding strings in the language file based on the current language.
The language is not stored in the database, because there is not much data, it is stored in files.
In fact, this is useless. You can find a framework that supports multiple languages.

Multiple languages are divided into two parts:
1. Display strings on the page, which are translated using language files
2. the multilingual database data must be supported during database design. Generally, the Multilingual fields are placed in a multilingual table. For example, the Multilingual table corresponding to Table x is x_i18n. In the background management, users are asked to enter data in different languages. The foreground searches for corresponding data display in different languages.

1. different languages may access different website content when switching, because Chinese websites are mainly targeting Chinese, English is mainly targeting Europe and America, and website products are different in emphasis, the corresponding content will be different.
2. If you simply implement multiple languages, many frameworks will bring their own i18 functions. Use tags for pages ~

Yii2 creates a class specifically for string translation, and then references it at a time.
Return [

'Create' => 'create', 'update' => 'update', 'delete' => 'delete', 'operate' => 'operation ', 'submit '=> 'Submit', 'search' => 'search', 'reset' => 'reset ',

Implemented in multiple languages, such:
The Chinese configuration file contains
Key => 'this is the Content'
English configuration file
Key => 'this is content'

Go to www.x.com/zh/xxx.html to read the Chinese configuration file,
Go to www.x.com/en/xxx.html to read the English configuration file,

See drupal

Configure a multi-language file and follow certain rules. Use an array to translate the files that require multiple languages. When displayed, use the configuration file of any language. This is also the general implementation of the Framework.

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.