php - Website internatinalization issues -
php - Website internatinalization issues -
nearly in every multilanguage project changing translation logic. blog projects creating new columns in database title_en, title_ru ... , content_en, content_ru...
if have id of blogpost, have access languages. works know column based translation not flexible , not direction. thinking row based translation every blogpost's row have columns like: id, title, content, locale
.
but way has problems , 1 of them me is, how build connection between blogpost , it's translations?
i mean if opened blogpost in english language illustration , alter language russian, how know blogpost open?
one way utilize 1 token tranlations of page. utilize 1 token translations of page? mean
example.com/en/mypage example.com/ru/mypage example.com/de/mypage
please share experience me. give thanks you
drupal well. have column in called tid (translation id). set master language point tid master language column.
so table this(ish)
| id | lang | title | body | tid | | 1 | en | hello | hello world | 0 | // master node has no tid | 2 | fr | bonjour | bonjour (french word world) | 1 | | 3 | sp | hola | hola (spanish stuff) | 1 |then can utilize tid , lang find still have per row entries.
example.com/en/mypage select * pages id=1
exmaple.com/fr/mypage select * pages tid=1 , lang="fr"
php internationalization multilanguage
Comments
Post a Comment