Knowledge Base

Premium URL Shortener

How to automatically show language based on user's browser language in Premium URL Shortener

To switch the language for users based on the user's browser language settings, you can do the following. Open the file includes/core.php and go to line 89 to find the code below

$_language=$config["default_lang"];
You will need to replace that by 

if($lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) && 
file_exists(ROOT."/includes/languages/".Main::clean($lang,3,TRUE).".php")){
  $_language = $lang;
} else {
  $_language = $config["default_lang"];
}

Was this helpful? Yes No

Still have questions?

If you still have questions, feel free to open a ticket and we will gladly help you out!

Open a ticket