aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/Translate.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-08 14:18:32 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-08 14:18:32 +0100
commit73023bc12b81a27045703e1f733faeb2b4e02cec (patch)
tree14aca1a1953d0a813c06794e48a63738abccdcea /lib/Minz/Translate.php
parent26da4aa448906f857a252507b34d369a386043c6 (diff)
parent0e4e16ac55097aa173c7c439367294ebd7645562 (diff)
Merge branch 'dev' into 252-extensions
Conflicts: app/FreshRSS.php app/Models/Configuration.php app/views/index/index.phtml app/views/index/normal.phtml lib/Minz/Configuration.php lib/Minz/Translate.php lib/lib_rss.php
Diffstat (limited to 'lib/Minz/Translate.php')
-rw-r--r--lib/Minz/Translate.php25
1 files changed, 17 insertions, 8 deletions
diff --git a/lib/Minz/Translate.php b/lib/Minz/Translate.php
index aa96728f2..b05c9c695 100644
--- a/lib/Minz/Translate.php
+++ b/lib/Minz/Translate.php
@@ -25,22 +25,31 @@ class Minz_Translate {
private static $translates = array();
/**
- * Load $lang_name and $lang_path based on configuration and selected language.
+ * Init the translation object.
+ * @param $lang_name the lang to show.
*/
- public static function init() {
- $l = Minz_Configuration::language();
- self::$lang_name = Minz_Session::param('language', $l);
+ public static function init($lang_name) {
+ self::$lang_name = $lang_name;
self::$lang_files = array();
self::$translates = array();
-
self::registerPath(APP_PATH . '/i18n');
}
/**
- * Alias for init().
+ * Reset the translation object with a new language.
+ * @param $lang_name the new language to use
+ */
+ public static function reset($lang_name) {
+ self::init($lang_name);
+ }
+
+ /**
+ * Return the list of available languages.
+ * @return an array.
+ * @todo fix this method.
*/
- public static function reset() {
- self::init();
+ public static function availableLanguages() {
+ return array();
}
/**