Phorum на многих языках

confguru

ExAdmin
Команда форума
Phorum на многих языках

http://hackers.phorum.org/read.php?f=4&i=326&t=326

1. To the header.php add following to the automatic resolve of users accept language:

if (!isset($lg)) {
$lg = explode(",",$HTTP_ACCEPT_LANGUAGE);
$lg = StrToLower(Substr(chop($lg[0]),0,2));
}


//testing, if user language is avalilable in the phorum, if not, use english version.
if (($lg<>"en") && ($lg<>"cs") && ($lg<>"de"))
$lg="en";

2. To the header.php add

AddGetVar ("lg",$lg);

- all the links in the phorum will contains parametr lg in URL

3. Rename all language files in the lang directory as folows:
english.php -> langen.php
czech.php -> langcs.php
Ё
4. As language file in the file 1.php, 2.php etc in the ADMIN/FORUMS replace:
$ForumLang='lang/english.php';
with:
$ForumLang='lang/lang'.$lg.'.php';

5. After it the language the Phorum will chose automatically, if you want direct link to the some versions, link the title page of the phorum with parameter lg set to the language - for example:

http://www.phorum.org/?lg=jp - for japanese version
 
Сверху