]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/Languages.php
Add language selection in the configure page of the default theme
[github/shaarli/Shaarli.git] / application / Languages.php
index 4ba32f29384d55490af8db47d5416de615216f80..357c7524ed458a128148522b124dd17876faac87 100644 (file)
@@ -62,7 +62,7 @@ class Languages
     /**
      * Languages constructor.
      *
-     * @param string        $language lang determined by autoLocale(), can be override.
+     * @param string        $language lang determined by autoLocale(), can be overridden.
      * @param ConfigManager $conf     instance.
      */
     public function __construct($language, $conf)
@@ -147,4 +147,18 @@ class Languages
     {
         return preg_match('/^[a-z]{2}(_[A-Z]{2})?/', $language) === 1;
     }
+
+    /**
+     * Get the list of available languages for Shaarli.
+     *
+     * @return array List of available languages, with their label.
+     */
+    public static function getAvailableLanguages()
+    {
+        return [
+            'auto' => t('Automatic'),
+            'en' => t('English'),
+            'fr' => t('French'),
+        ];
+    }
 }