]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
add text_languagedetect to guess article language for better hyphenation
[tt-rss.git] / include / functions.php
index cef0ea9eb6dd3cae9c4ac77d71ac6896041643c6..9d14aae7ad58915cc3fc47ecf9b2a99057c42366 100644 (file)
@@ -1,6 +1,6 @@
 <?php
        define('EXPECTED_CONFIG_VERSION', 26);
-       define('SCHEMA_VERSION', 121);
+       define('SCHEMA_VERSION', 122);
 
        define('LABEL_BASE_INDEX', -1024);
        define('PLUGIN_FEED_BASE_INDEX', -128);
@@ -87,6 +87,7 @@
        require_once "lib/accept-to-gettext.php";
        require_once "lib/gettext/gettext.inc";
 
+       require_once "lib/languagedetect/LanguageDetect.php";
 
        function startup_gettext() {
 
                                                comments,
                                                int_id,
                                                uuid,
+                                               lang,
                                                hide_images,
                                                unread,feed_id,marked,published,link,last_read,orig_feed_id,
                                                last_marked, last_published,
                                                                "tag_cache," .
                                                                "label_cache," .
                                                                "link," .
+                                                               "lang," .
                                                                "uuid," .
                                                                "last_read," .
                                                                "(SELECT hide_images FROM ttrss_feeds WHERE id = feed_id) AS hide_images," .
                        ccache_update($feed_id, $owner_uid);
                }
 
-               $result = db_query("SELECT id,title,link,content,feed_id,comments,int_id,
+               $result = db_query("SELECT id,title,link,content,feed_id,comments,int_id,lang,
                        ".SUBSTRING_FOR_DATE."(updated,1,16) as updated,
                        (SELECT site_url FROM ttrss_feeds WHERE id = feed_id) as site_url,
                        (SELECT hide_images FROM ttrss_feeds WHERE id = feed_id) as hide_images,
                                }
                        $rv['content'] .= "</div>";
 
-                       $rv['content'] .= "<div class=\"postContent\" lang=\"en\">";
+                       $rv['content'] .= "<div class=\"postContent\" lang=\"".$line['lang']."\">";
 
                        $rv['content'] .= $line["content"];
                        $rv['content'] .= format_article_enclosures($id,