aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/Languages.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-05-25 13:26:05 +0200
committerArthurHoaro <arthur@hoa.ro>2017-10-22 13:16:53 +0200
commitf39580c6fd171b849cec5832b4912182696341f2 (patch)
treec184380d829e2f9b22b2375f4bdc8d085cd6a9be /application/Languages.php
parentd6379763290230242caac5fe1e7c589a29fa6bf0 (diff)
downloadShaarli-f39580c6fd171b849cec5832b4912182696341f2.tar.gz
Shaarli-f39580c6fd171b849cec5832b4912182696341f2.tar.zst
Shaarli-f39580c6fd171b849cec5832b4912182696341f2.zip
Add language selection in the configure page of the default theme
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}