diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-09-18 18:23:27 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-09-18 18:23:27 +0200 |
commit | 20fb3d04d4cb376afe931d78b8951350d0975165 (patch) | |
tree | c8921dad6ce455215ca8d959fd27e2cc9e3415ce /extensions/FunnyQuestion | |
parent | 494e797fd6857f9a71bd5da7b53a1754500332fd (diff) |
FunnyQuestion: Fix i18n bug
Diffstat (limited to 'extensions/FunnyQuestion')
-rw-r--r-- | extensions/FunnyQuestion/FunnyQuestion.body.php | 9 | ||||
-rw-r--r-- | extensions/FunnyQuestion/FunnyQuestion.i18n.php | 2 | ||||
-rw-r--r-- | extensions/FunnyQuestion/FunnyQuestion.php | 1 |
3 files changed, 6 insertions, 6 deletions
diff --git a/extensions/FunnyQuestion/FunnyQuestion.body.php b/extensions/FunnyQuestion/FunnyQuestion.body.php index 2bfb9343..ae0a25ab 100644 --- a/extensions/FunnyQuestion/FunnyQuestion.body.php +++ b/extensions/FunnyQuestion/FunnyQuestion.body.php @@ -8,9 +8,9 @@ class FunnyQuestion { } private static function getLang() { - global $wgLang; + global $wgLang, $wgFunnyQuestions; - return (!empty($wgFunnyQuestions[$wgLang->getCode()]) ? $wgFunnyQuestions[$wgLang->getCode()] : 'en'); + return (!empty($wgFunnyQuestions[$wgLang->getCode()]) ? $wgLang->getCode() : 'en'); } private static function getFunnyQuestion() { @@ -20,7 +20,7 @@ class FunnyQuestion { $time = time(); # make sure the user is not able to tell us the question to answer $hash = sha1($time.$question.$wgFunnyQuestionHash); - + return array('question' => $question, 'time' => $time, 'hash' => $hash); } @@ -85,7 +85,7 @@ class FunnyQuestion { if (!$wgUser->isLoggedIn() && !self::hasFunnyCookie()) { $funnyQuestion = self::getFunnyQuestion(); - $editpage->editFormTextAfterWarn .= + $editpage->editFormTextAfterWarn .= '<div class="editOptions"> <label for="FunnyAnswerField"><strong>' .wfMsg('question-'.sha1($funnyQuestion['question'])).'</strong></label> @@ -128,4 +128,3 @@ class FunnyQuestion { } ?> - diff --git a/extensions/FunnyQuestion/FunnyQuestion.i18n.php b/extensions/FunnyQuestion/FunnyQuestion.i18n.php index a8b31e3d..1bd830e0 100644 --- a/extensions/FunnyQuestion/FunnyQuestion.i18n.php +++ b/extensions/FunnyQuestion/FunnyQuestion.i18n.php @@ -18,7 +18,7 @@ foreach ($messages as $lang => $translations) { if (!empty($wgFunnyQuestions[$lang])) { foreach (array_keys($wgFunnyQuestions[$lang]) as $question) { $messages[$lang]['question-'.sha1($question)] = $question; - } + } } } diff --git a/extensions/FunnyQuestion/FunnyQuestion.php b/extensions/FunnyQuestion/FunnyQuestion.php index 907d070a..b6c21078 100644 --- a/extensions/FunnyQuestion/FunnyQuestion.php +++ b/extensions/FunnyQuestion/FunnyQuestion.php @@ -8,6 +8,7 @@ $wgExtensionCredits['other'][] = array( 'url' => 'https://www.archlinux.de' ); +global $wgFunnyQuestions; $wgFunnyQuestions = array( 'en' => array("What is the Ultimate Answer to the Ultimate Question of Life, The Universe, and Everything?" => "42"), 'de' => array("Was ist die ultimaative Antwort nach dem Leben, dem Universum und dem ganzen Rest?" => "42") |