Could anyone post a detailed info on how to implement multilingualism on the site?
2 answers
There are a lot of ways to implement multilingualism. Nothing prevents you from inventing yours. The choice of one or another method depends on the task. As a rule, if a framework is used to create a site, then the framework itself contains the possibility of multilingualism.
As an example, here is the implementation of multilingualism in django:
1) static content in the templates is wrapped in a special tag. Then the phrases that were wrapped in the tag are translated into a special file (here I am a little simplified, but the essence is clear). Then, the current locale is taken from the query and the corresponding entry is displayed. If the entry is not in the translation file, the default entry is displayed in the template.
2) dynamic content (i.e. content that is stored in the database). In django, there is a modeltranslation module (it is possible that the name is confusing), it does the following: creates additional fields for each translation field (for example, there is a name field, this model will create additional fields name_en, name_ru, name_pk, etc.). Then the module looks at which language is selected and selects the appropriate field.
I learned from my own experience that it is better to create separate sites (mirrors, on subdomains). The attitude of the search engines will also be strange if the same page will speak in different languages. There may be a case when Google in the index keeps the English version of the site, and Yandex is Russian. This is the case if you think about issuing a language using an IP address. Of course, if the site is not for search engines, you can work. I will not be unfounded, here's a look at how multilingualism is implemented on the site http://www.mp3cut.ru/
- oneAnd if the domain names are occupied and managed to tear only one? Why such an example? 1. Initially, the language that works with default is specified 2. The button for changing the language using the hidden method is executed from search engines from under JavaScript without the '<a>' tag, and using the onclick or Jquery type $ ("# id or .class"). Click (function () {send to the page where the cookie is written and the session with the desired language;}); This excludes that the search engine will take a simple div as a link and will use it as a source of new data. This means that the site indexation to EN or DE is already excluded. - Palmervan
- oneThe latest leaks of secret information through Yandex prove the opposite. But how to promote the site in the Russian segment? The most business version of en.site.ru site.ru de.site.ru - jfjgjkslxd