mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Added constants for locales
This commit is contained in:
parent
062d5aeb4f
commit
1212ef51f7
@ -6,21 +6,21 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (!isset($_SESSION["locale"])) {
|
if (!isset($_SESSION["locale"])) {
|
||||||
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
|
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
|
||||||
switch ($lang){
|
switch ($lang){
|
||||||
case "de":
|
case "de":
|
||||||
$locale = "de_DE.UTF-8";
|
$locale = "de_DE.UTF-8";
|
||||||
break;
|
break;
|
||||||
case "fr":
|
case "fr":
|
||||||
$locale = "fr_FR.UTF-8";
|
$locale = "fr_FR.UTF-8";
|
||||||
break;
|
break;
|
||||||
case "it":
|
case "it":
|
||||||
$locale = "it_IT.UTF-8";
|
$locale = "it_IT.UTF-8";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$locale = "en_US.UTF-8";
|
$locale = "en_US.UTF-8";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// debug
|
// debug
|
||||||
@ -30,10 +30,8 @@ $_SESSION["locale"] = $locale;
|
|||||||
putenv("LANG=" . $_SESSION["locale"]);
|
putenv("LANG=" . $_SESSION["locale"]);
|
||||||
setlocale(LC_ALL, $_SESSION["locale"]);
|
setlocale(LC_ALL, $_SESSION["locale"]);
|
||||||
|
|
||||||
$domain = "messages";
|
bindtextdomain(LOCALE_DOMAIN, LOCALE_ROOT);
|
||||||
$locale_root = "locale";
|
bind_textdomain_codeset(LOCALE_DOMAIN, 'UTF-8');
|
||||||
bindtextdomain($domain, $locale_root);
|
|
||||||
bind_textdomain_codeset($domain, 'UTF-8');
|
|
||||||
|
|
||||||
textdomain($domain);
|
textdomain(LOCALE_DOMAIN);
|
||||||
?>
|
?>
|
||||||
|
@ -43,6 +43,10 @@ define('RASPI_TORPROXY_CONFIG', '/etc/tor/torrc');
|
|||||||
define('RASPI_OPENVPN_ENABLED', false );
|
define('RASPI_OPENVPN_ENABLED', false );
|
||||||
define('RASPI_TORPROXY_ENABLED', false );
|
define('RASPI_TORPROXY_ENABLED', false );
|
||||||
|
|
||||||
|
// Locale settings
|
||||||
|
define('LOCALE_ROOT', 'locale');
|
||||||
|
define('LOCALE_DOMAIN', 'messages');
|
||||||
|
|
||||||
include_once( RASPI_CONFIG.'/raspap.php' );
|
include_once( RASPI_CONFIG.'/raspap.php' );
|
||||||
include_once( 'includes/locale.php');
|
include_once( 'includes/locale.php');
|
||||||
include_once( 'includes/functions.php' );
|
include_once( 'includes/functions.php' );
|
||||||
|
Loading…
Reference in New Issue
Block a user