diff options
author | Andrew Dolgov <[email protected]> | 2013-09-27 13:45:21 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-09-27 13:45:21 +0400 |
commit | 5ddd2705ca0c2729d4a5a6e37b6df8ad8b67379d (patch) | |
tree | c809658183a4a6a5183f05a1fc74ca6589b4cc5e /include/rssfuncs.php | |
parent | a10de509f39d5ff5d526ed812cdfa37466fba42d (diff) |
make language detection optional (closes #779)
Diffstat (limited to 'include/rssfuncs.php')
-rw-r--r-- | include/rssfuncs.php | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 6d067065e..13d6baeab 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -356,10 +356,12 @@ $rss->init(); } - require_once "lib/languagedetect/LanguageDetect.php"; + if (DETECT_ARTICLE_LANGUAGE) { + require_once "lib/languagedetect/LanguageDetect.php"; - $lang = new Text_LanguageDetect(); - $lang->setNameMode(2); + $lang = new Text_LanguageDetect(); + $lang->setNameMode(2); + } // print_r($rss); @@ -572,15 +574,17 @@ print "\n"; } - $entry_language = $lang->detect($entry_title . " " . $entry_content, 1); + $entry_language = ""; + + if (DETECT_ARTICLE_LANGUAGE) { + $entry_language = $lang->detect($entry_title . " " . $entry_content, 1); - if (count($entry_language) > 0) { - $entry_language = array_keys($entry_language); - $entry_language = db_escape_string(substr($entry_language[0], 0, 2)); + if (count($entry_language) > 0) { + $entry_language = array_keys($entry_language); + $entry_language = db_escape_string(substr($entry_language[0], 0, 2)); - _debug("detected language: $entry_language", $debug_enabled); - } else{ - $entry_language = ""; + _debug("detected language: $entry_language", $debug_enabled); + } } $entry_comments = $item->get_comments_url(); |