diff options
author | Philip Häusler <msquare@notrademark.de> | 2013-12-26 13:34:48 +0100 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2013-12-26 13:34:48 +0100 |
commit | 0c98f13eee10a61cabdc13e7aa75916d50b8b078 (patch) | |
tree | d3931a0b5ffb03e59c3589de5dcfa3910e10bca6 /includes/helper/internationalization_helper.php | |
parent | 3cc147d235bc977aedb660d896cbb54d1a4f92ec (diff) |
user password recovery
Diffstat (limited to 'includes/helper/internationalization_helper.php')
-rw-r--r-- | includes/helper/internationalization_helper.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/includes/helper/internationalization_helper.php b/includes/helper/internationalization_helper.php index ae88eb21..db150fec 100644 --- a/includes/helper/internationalization_helper.php +++ b/includes/helper/internationalization_helper.php @@ -17,14 +17,26 @@ function gettext_init() { elseif (! isset($_SESSION['locale'])) $_SESSION['locale'] = $default_locale; - putenv('LC_ALL=' . $_SESSION['locale']); - setlocale(LC_ALL, $_SESSION['locale']); + gettext_locale(); bindtextdomain('default', '../locale'); bind_textdomain_codeset('default', 'UTF-8'); textdomain('default'); } /** + * Swich gettext locale. + * + * @param string $locale + */ +function gettext_locale($locale = null) { + if ($locale == null) + $locale = $_SESSION['locale']; + + putenv('LC_ALL=' . $locale); + setlocale(LC_ALL, $locale); +} + +/** * Renders language selection. * * @return string |