summaryrefslogtreecommitdiff
path: root/includes/helper/internationalization_helper.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-01-21 23:07:20 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-01-21 23:07:20 +0100
commit8506d6d27e3b926521007064abcdcc2f69c6aa06 (patch)
tree4c0207871b3e9a831f8a619ff095ad71adb66f05 /includes/helper/internationalization_helper.php
parent740026a9de6cba73c4e77aba78950d0a791b6b62 (diff)
Refactoring: Config cleanup / moved to class
Diffstat (limited to 'includes/helper/internationalization_helper.php')
-rw-r--r--includes/helper/internationalization_helper.php12
1 files changed, 3 insertions, 9 deletions
diff --git a/includes/helper/internationalization_helper.php b/includes/helper/internationalization_helper.php
index 7c04ebbd..ed16de15 100644
--- a/includes/helper/internationalization_helper.php
+++ b/includes/helper/internationalization_helper.php
@@ -1,10 +1,4 @@
<?php
-$locales = [
- 'de_DE.UTF-8' => 'Deutsch',
- 'en_US.UTF-8' => 'English'
-];
-
-$default_locale = 'en_US.UTF-8';
/**
* Return currently active locale
@@ -31,7 +25,8 @@ function locale_short()
*/
function gettext_init()
{
- global $locales, $default_locale;
+ $locales = config('locales');
+ $default_locale = config('default_locale');
if (isset($_REQUEST['set_locale']) && isset($locales[$_REQUEST['set_locale']])) {
$_SESSION['locale'] = $_REQUEST['set_locale'];
@@ -67,11 +62,10 @@ function gettext_locale($locale = null)
*/
function make_langselect()
{
- global $locales;
$url = $_SERVER['REQUEST_URI'] . (strpos($_SERVER['REQUEST_URI'], '?') > 0 ? '&' : '?') . 'set_locale=';
$items = [];
- foreach ($locales as $locale => $name) {
+ foreach (config('locales') as $locale => $name) {
$items[] = toolbar_item_link(
htmlspecialchars($url) . $locale,
'',