U
U
usja2012-03-15 20:45:37
Zend Framework
usja, 2012-03-15 20:45:37

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

2 answer(s)
S
Stdit, 2012-03-15
@Stdit

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: '

A
AlexPres, 2013-06-04
@AlexPres

site.com
site.com/eng/

There are only 4 ways , and this one is number 3 in terms of coolness =) Although if you are “interested in an unlimited number of languages”, then the choice is correct, you should just use ISO codes right away, not custom ones.
I made a special default router in Zend FW so that it always works like yours - server.com/ru/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question