From f39580c6fd171b849cec5832b4912182696341f2 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Thu, 25 May 2017 13:26:05 +0200 Subject: Add language selection in the configure page of the default theme --- application/Languages.php | 16 +++++++++++++++- application/NetscapeBookmarkUtils.php | 1 - 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'application') 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 /** * 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'), + ]; + } } diff --git a/application/NetscapeBookmarkUtils.php b/application/NetscapeBookmarkUtils.php index 31a14537..dd7057f8 100644 --- a/application/NetscapeBookmarkUtils.php +++ b/application/NetscapeBookmarkUtils.php @@ -36,7 +36,6 @@ class NetscapeBookmarkUtils } $bookmarkLinks = array(); -7 foreach ($linkDb as $link) { if ($link['private'] != 0 && $selection == 'public') { continue; -- cgit v1.2.3