What is the best way to store multiple language versions of a website?

My website (on Linux servers) must support multiple languages.
What is the best practice for storing / storing versions of multiple languages ​​on one site?
Some I can think of:

  • save to DB
  • a different view file for each language
  • gettex
  • hard-coded words in PHP files (e.g. phpBB)
+3
source share
3 answers

With websites, you really have several categories of content to localize:

  • Content elements such as articles that you in many cases created, edited, and published to the CMS.
  • , ( ), tagline, blurb, , , . (, , , : , ).
  • , " , ", "...", .., . .

1. - CMS . , , . PHP CMS, Django CMS (Django-CMS-2, FeinCMS) . , , , ( , ISO, ). CMS, HTML , gettext - , .mo( .po) .

2. CMS , CMS. , , . , CMS , . gettext. , (if $language = X display content1 ...)

3., , gettext. , , , ( ) 100 , .

3. ( .mo).

, , - HTML , .

EDIT: gettext,.po .mo GNU gettext (, - ) , . PHP PHP gettext functions, Zend

+2

Zend_Translate Gettext-, mo . + .

echo $translation->_("Hello World");

.

+1
0
source

Source: https://habr.com/ru/post/1754521/


All Articles