aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/Languages.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/Languages.php')
-rw-r--r--application/Languages.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/application/Languages.php b/application/Languages.php
index 4ba32f29..357c7524 100644
--- a/application/Languages.php
+++ b/application/Languages.php
@@ -62,7 +62,7 @@ class Languages
62 /** 62 /**
63 * Languages constructor. 63 * Languages constructor.
64 * 64 *
65 * @param string $language lang determined by autoLocale(), can be override. 65 * @param string $language lang determined by autoLocale(), can be overridden.
66 * @param ConfigManager $conf instance. 66 * @param ConfigManager $conf instance.
67 */ 67 */
68 public function __construct($language, $conf) 68 public function __construct($language, $conf)
@@ -147,4 +147,18 @@ class Languages
147 { 147 {
148 return preg_match('/^[a-z]{2}(_[A-Z]{2})?/', $language) === 1; 148 return preg_match('/^[a-z]{2}(_[A-Z]{2})?/', $language) === 1;
149 } 149 }
150
151 /**
152 * Get the list of available languages for Shaarli.
153 *
154 * @return array List of available languages, with their label.
155 */
156 public static function getAvailableLanguages()
157 {
158 return [
159 'auto' => t('Automatic'),
160 'en' => t('English'),
161 'fr' => t('French'),
162 ];
163 }
150} 164}