FrenchMarie Posted January 16, 2021 Share Posted January 16, 2021 Hello, I am coming to you following a problem using lang in a PHP file for the redirection of the index file. I don't know if the solution exists but I hope to have your help, you will find attached the part of the code : if ($vars['templatefile']=="homepage"){ $_SESSION['Language']; $link = $_LANG["localeLanguage"]; header("Location: " . $link); exit; } A big thank you in advance for your advice and for your help 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 16, 2021 Share Posted January 16, 2021 assuming that you have created a Language Override for 'localeLanguage' (it's not a default language string)... $_LANG['localeLanguage'] = "https://www.google.com"; ... then you could do this in the hook... if ($vars['templatefile']=="homepage"){ $link = Lang::trans('localeLanguage'); if ($link != 'localeLanguage') { header("Location: " . $link); exit; } } and that should, assuming the language string exists, redirect users to the URL defined in the language overrides file for the current selected language.... if no string exists, then there is no redirection. 0 Quote Link to comment Share on other sites More sharing options...
FrenchMarie Posted January 16, 2021 Author Share Posted January 16, 2021 Hello, Thanks for your feedback and also a big thank you for your quick response, because your code is working as hoped. A thousand thanks to you, really 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.