aboutsummaryrefslogtreecommitdiff
path: root/app/FreshRSS.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-06 21:10:51 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-06 21:10:51 +0100
commitaddcea9cd45a87f2ae56f879bad86425efc16fba (patch)
tree2ee5d9b04e7ff01ae632a5f7747022bd0cc2ac09 /app/FreshRSS.php
parent5f9672111f86c693d843138c00934a6c3eeede45 (diff)
Fix i18n loading and availableLanguages calls
- Change the way to init i18n - Add a availableLanguages() method to Minz_Translate See https://github.com/FreshRSS/FreshRSS/issues/730
Diffstat (limited to 'app/FreshRSS.php')
-rw-r--r--app/FreshRSS.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/app/FreshRSS.php b/app/FreshRSS.php
index a53174394..7b5df7ced 100644
--- a/app/FreshRSS.php
+++ b/app/FreshRSS.php
@@ -31,15 +31,25 @@ class FreshRSS extends Minz_FrontController {
// Load context and configuration.
FreshRSS_Context::init();
- // Init i18n.
- Minz_Session::_param('language', FreshRSS_Context::$user_conf->language);
- Minz_Translate::init();
-
+ $this->initI18n();
$this->loadStylesAndScripts();
$this->loadNotifications();
$this->loadExtensions();
}
+ private function initI18n() {
+ $lang = Minz_Session::param('language');
+ if ($lang === false) {
+ Minz_Session::_param('language', FreshRSS_Context::$user_conf->language);
+ $lang = FreshRSS_Context::$user_conf->language;
+ }
+
+ Minz_Translate::init(array(
+ 'en' => 'English',
+ 'fr' => 'Français',
+ ), $lang);
+ }
+
private function loadStylesAndScripts() {
$theme = FreshRSS_Themes::load(FreshRSS_Context::$user_conf->theme);
if ($theme) {