Architectural question: a multilingual site?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
10 views
Good afternoon everyone.

The question arose about the creation of a multilingual website.

The site will feature various news, articles and etc partitions while there is no guarantee that an article from the Russian version will be translated into English.

To open will be in a subfolder domen.ru/(EN/ru)/

How best to implement database and administration content?
by | 10 views

6 Answers

0 like 0 dislike
The most simple in such situation, in my opinion, just duplicate the fields that are necessary to translate, something like:
id: integer, required
title_ru: string, required
body_ru: text, required
title_en: string
body_en: text
\r
and change depending on the url fields for the sample. The scheme is simple, easy to implement, virtually no overhead, but the main drawback — very inflexible
by
0 like 0 dislike
Well, if the content will be different, maybe two different sites?
by
0 like 0 dislike
As a rule, the English version shall be the English-language page, texts, news, etc., In Russian of course Russian. Devman correctly advised, in the usual list of fields in the database (as if it were monolingual architecture of the website) add a field that is responsible for language. And then it's simple, in the admin, make the switch-the filter that will show records or a single field value, or with others. In the front too, just use this filter. A sufficiently flexible language can be at least as, in fact, you can even dynamically add from admin panel) Home — base to swell with redundant fields will not.
by
0 like 0 dislike
And what can you say about gettext for multi-language sites?
by
0 like 0 dislike
That's just such a module and implemented a method of appending to an existing table fields for localization:
\r
name_locale
content_locale etc.
\r
The window editing data in the admin add bookmark "Language", which shot out into the open fields to edit data localization. Localization added page, news, test blocks. Also made to the connection settings of individual design template for a second language that is included when you change the language.
\r
you can see what happened.
by
0 like 0 dislike
The best model for transfer of data are, for example, in the globalize plugin for AR. github.com/svenfuchs/globalize3 — if you're interested.
\r
The variant with the separate table for all translations is translation of strings, for example. But you'll have to bother with the caching, since it will do well, a lot of queries.
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
25,317 users