Answer the question
In order to leave comments, you need to log in
How to organize multilingualism?
Good evening gentlemen.
How to create multilingual templates and distribute them across
site.com
site.com/eng/
is clear, but what about the content of the site? After all, there are several ways.
I'm interested for an unlimited number of languages, ie. in a separate table, we store the language id and its name, and when creating, for example, a text page, we indicate which lang_id we are adding / editing. And here I ran into questions that cannot be sorted out in my head: languages can be both an independent structure and a mirror one; galleries - they are unlikely to be different - you need to make a mirror one.
Does anyone have working examples of how this is implemented? I would be very grateful if you show how you create multilingual sites, using text pages as an example.
Answer the question
In order to leave comments, you need to log in
Galleries can also contain language, especially if the images contain text. If a record does not have a language specified, the language is set to "unknown" or null, which comes into queries with other languages, roughly speaking where lang in ('ru', 'en', 'unknown') or where lang = 'ru ' or lang is null. There is also a specific task when an entity must have several languages at the same time, but it is more difficult to implement, especially on RDBMS. Other databases may have advanced features for this, for example, in MongoDB, a query for all articles in Russian, English or indeterminate languages in category 123 will look something like this: find({lang:{$in:['en','ru' ,'unknown']}, category: 123}), while the index by lang is used and the selection will include articles with lang:'en' or lang: '
site.com
site.com/eng/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question