diff --git a/classes/feeds.php b/classes/feeds.php index 07677a8cd..292c9e0d4 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -733,7 +733,7 @@ class Feeds extends Handler_Protected { if (DB_TYPE == "pgsql") { print "
"; print ""; - print_select("search_language", "", Pref_Feeds::get_ts_languages(), + print_select("search_language", get_pref('DEFAULT_SEARCH_LANGUAGE'), Pref_Feeds::get_ts_languages(), "dojoType='dijit.form.Select' title=\"".__('Used for word stemming')."\""); print "
"; } diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index cb10e2322..d75b47f87 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -28,6 +28,7 @@ class Pref_Prefs extends Handler_Protected { __('Feeds') => [ 'DEFAULT_UPDATE_INTERVAL', 'FRESH_ARTICLE_MAX_AGE', + 'DEFAULT_SEARCH_LANGUAGE', 'BLOCK_SEPARATOR', 'ENABLE_FEED_CATS', 'BLOCK_SEPARATOR', @@ -68,6 +69,7 @@ class Pref_Prefs extends Handler_Protected { $this->pref_help = [ "ALLOW_DUPLICATE_POSTS" => array(__("Allow duplicate articles"), ""), "BLACKLISTED_TAGS" => array(__("Blacklisted tags"), __("Never apply these tags automatically (comma-separated list).")), + "DEFAULT_SEARCH_LANGUAGE" => array(__("Default language"), __("Used for full-text search")), "CDM_AUTO_CATCHUP" => array(__("Mark read on scroll"), __("Mark articles as read as you scroll past them")), "CDM_EXPANDED" => array(__("Always expand articles")), "COMBINED_DISPLAY_MODE" => array(__("Combined mode"), __("Show flat list of articles instead of separate panels")), @@ -560,6 +562,10 @@ class Pref_Prefs extends Handler_Protected { continue; } + if ($pref_name == "DEFAULT_SEARCH_LANGUAGE" && DB_TYPE != "pgsql") { + continue; + } + if ($item = $prefs_available[$pref_name]) { print "
"; @@ -613,6 +619,10 @@ class Pref_Prefs extends Handler_Protected { print_select_hash($pref_name, $value, $update_intervals_nodefault, 'dojoType="dijit.form.Select"'); + } else if ($pref_name == "DEFAULT_SEARCH_LANGUAGE") { + + print_select($pref_name, $value, Pref_Feeds::get_ts_languages(), + 'dojoType="dijit.form.Select"'); } else if ($type_name == "bool") { diff --git a/classes/rssutils.php b/classes/rssutils.php index 5aff2f8a3..4aa9a0379 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -308,7 +308,12 @@ class RSSUtils { $fetch_url = $row["feed_url"]; $feed_language = mb_strtolower($row["feed_language"]); - if (!$feed_language) $feed_language = 'english'; + + if (!$feed_language) + $feed_language = mb_strtolower(get_pref('DEFAULT_SEARCH_LANGUAGE', $owner_uid)); + + if (!$feed_language) + $feed_language = 'simple'; } else { return false;