From 0135a340a504f30171400d4552e1956019e4e980 Mon Sep 17 00:00:00 2001 From: Vasil Kolev Date: Fri, 23 Oct 2015 17:28:52 +0300 Subject: [PATCH] fix usage --- schedule/parse.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/schedule/parse.php b/schedule/parse.php index f01351d..6ab9345 100644 --- a/schedule/parse.php +++ b/schedule/parse.php @@ -9,9 +9,6 @@ $data = require __DIR__ . DIRECTORY_SEPARATOR . 'load.php'; -/* sensible default */ -if (empty($lang)) $lang = 'bg'; - /* no idea why do I have to write this, doesn't seem to exist in the system */ $languages = array('en' => array('name' => 'English', 'locale' => 'en_US.UTF8'), 'bg' => array ('name' => 'Български', 'locale' => 'bg_BG.UTF8')); @@ -30,7 +27,7 @@ $last_hall_id = max($hall_ids); /* We need to set these so we actually parse properly the dates. WP fucks up both. */ date_default_timezone_set('Europe/Sofia'); -setlocale(LC_TIME, $languages[$lang]['locale']); +setlocale(LC_TIME, $languages[$CF['lang']]['locale']); foreach ($data['slots'] as $slot_id => $slot) { if (! in_array($slot['hall_id'], $CF['allowedhallids'])) continue; @@ -127,7 +124,7 @@ $lines[] = ''; $legend = []; foreach($data['tracks'] as $track) { - $legend[] = '' . $track['name'][$lang] . ''; + $legend[] = '' . $track['name'][$CF['lang']] . ''; } foreach ($languages as $l => $n) { $legend[] = '' . $n['name'] . '';