aboutsummaryrefslogtreecommitdiffstats
path: root/include/help.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-10-07 16:00:34 +0000
committerMario <mario@mariovavti.com>2023-10-07 16:00:34 +0000
commit2f2e353ecef52639a78cac3bc407ccfe64197ac9 (patch)
tree557793121ec08dce6e97c064a100994e8d3990c5 /include/help.php
parent0092b7c0a4d6cf49c092e2232af63f87be63142b (diff)
downloadvolse-hubzilla-2f2e353ecef52639a78cac3bc407ccfe64197ac9.tar.gz
volse-hubzilla-2f2e353ecef52639a78cac3bc407ccfe64197ac9.tar.bz2
volse-hubzilla-2f2e353ecef52639a78cac3bc407ccfe64197ac9.zip
use new lang detect library which supports much more languages
Diffstat (limited to 'include/help.php')
-rw-r--r--include/help.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/help.php b/include/help.php
index 8a913578a..9e4be57f9 100644
--- a/include/help.php
+++ b/include/help.php
@@ -1,6 +1,7 @@
<?php
use \Michelf\MarkdownExtra;
+use CommerceGuys\Intl\Language\LanguageRepository;
require_once('include/items.php');
@@ -183,11 +184,11 @@ function preg_callback_help_include($matches) {
* * \e boolean \b from_url - true if language from URL overrides browser default
*/
function determine_help_language() {
- $lang_detect = new Text_LanguageDetect();
- // Set this mode to recognize language by the short code like "en", "ru", etc.
- $lang_detect->setNameMode(2);
- if($lang_detect->languageExists(argv(1))) {
+ $language_repository = new LanguageRepository;
+ $languages = $language_repository->getList();
+
+ if(array_key_exists(argv(1), $languages)) {
$lang = argv(1);
$from_url = true;
} else {