sarvar
New Member
- Messages
- 82
- Reaction score
- 0
- Points
- 0
Hey, I recently made a php script on my site which allows visitors to change the language. I made languages folder and stored en.php, ru.php and uz.php with translations. Then I pulled the language file with this code.
When I visit the site, default language works fine. But when I assing lang in the URL, I get random letters. Any ideas to fix this issue?
PHP:
// Get user language
$lang = $_GET['lang'];
switch($lang){
case 'en':
include 'languages/en.php';
break;
case 'ru':
include 'languages/ru.php';
break;
case 'uz':
include 'languages/uz.php';
break;
default:
include 'languages/en.php';
}
When I visit the site, default language works fine. But when I assing lang in the URL, I get random letters. Any ideas to fix this issue?