Closed tanguy-fgl closed 2 years ago
no need to use that just follow this http://codeigniter.com/userguide3/libraries/language.html
Thanks it worked I just want to adapt the
Like this one
Maybe no
Ok, to change the theme you use a form but where does it sends the value because I want to add a toggle switch button for the theme (I think it's better) but I didn't find how to post it
Xera uses cookies to change theme.
I'm working to translate Xera in other languages with an automated detection of the default browser, my system is working great in other projects and I want to integrate it on all pages. Is there a file that Xera load on all pages? I just have to integrate this code on all the pages and it will be finished:
<?php $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); $acceptLang = ['fr', 'en']; $lang = in_array($lang, $acceptLang) ? $lang : 'en'; require_once "app/language/{$lang}.php"; /*I just have to create the languages files using php arrays*/ ?>