Answer the question
In order to leave comments, you need to log in
Need help finishing multiple languages?
Hi all. I'm trying to make several languages on the site, but it doesn't work for me.
Here's what to do at the moment. There are 2 folders ru and en in each folder there is a lang.lng file, one is Russian and the other is English. For example, the contents of the lang.lng file
<?php
$lang = array(
'glav1' => 'Главная',
'game2' => 'Игра',
'forum3' => 'Форум',
'overver4' => 'О Сервере',
);
@setlocale(LC_ALL, "ru");
?>
$tpl->set('{lang}', $lang);
if(!$checkLang){
$rMyLang = 'Русский';
$checkLang = 'ru';
}
include SYSTEM_DIR.'/'.$checkLang.'/lang.lng';
<a href="" lang="ru" id="lang_rus" class="lang ru"></a>
<a href="" lang="en" id="lang_eng" class="lang en"></a>
Answer the question
In order to leave comments, you need to log in
$checkLang = (isset($_GET['lang']) AND in_array($_GET['lang'], ['ru', 'en'])) ? $_GET['lang'] : 'ru';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question