]> git.wh0rd.org Git - tt-rss.git/commitdiff
more I18N work
authorAndrew Dolgov <fox@madoka.spb.ru>
Mon, 5 Mar 2007 09:04:55 +0000 (10:04 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Mon, 5 Mar 2007 09:04:55 +0000 (10:04 +0100)
backend.php
errors.php
functions.php
modules/opml_domdoc.php
modules/opml_domxml.php
opml.php
prefs.php
sanity_check.php
tt-rss.php
update-translations.sh

index 1f0cf2e811f7395b0ad65bd5f9c7beeb78bd68f1..03f90e2e1b8d46644453be59f005d3782b8d2639 100644 (file)
@@ -22,6 +22,7 @@
        require_once "functions.php";
 
        no_cache_incantation();
+       startup_gettext();
 
        $script_started = getmicrotime();
 
index 16efd09a9e0bfff6eaa1ad41b229cb223b15eeb7..c7499a9ce5595fad016a8b65b466523116136838 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
        $ERRORS[0] = __("Unknown error");
 
        $ERRORS[1] = __("This program requires XmlHttpRequest " .
index a90eed1858ad9ffa1c009fc2e91d2e7aebe3512a..f7a0cc54d8c615954bd2fd1f20f112cb5a0b8b65 100644 (file)
@@ -6,6 +6,11 @@
                define('DEFAULT_ERROR_LEVEL', E_ERROR | E_WARNING | E_PARSE);
        } */
 
+       require_once "accept-to-gettext.php";
+       require_once "gettext/gettext.inc";
+
+       startup_gettext();
+
        require_once 'config.php';
        require_once 'db-prefs.php';
        require_once 'compat.php';
@@ -18,9 +23,6 @@
        require_once "magpierss/rss_fetch.inc";
        require_once 'magpierss/rss_utils.inc';
 
-       require_once "accept-to-gettext.php";
-       require_once "gettext/gettext.inc";
-
        function purge_feed($link, $feed_id, $purge_interval, $debug = false) {
 
                $rows = -1;
                                        <ul class=\"headlineDropdownMenu\">
                                        <li class=\"top2\">
                                        Select:
-                                               <a href=\"$sel_all_link\">All</a>,
-                                               <a href=\"$sel_unread_link\">Unread</a>,
-                                               <a href=\"$sel_none_link\">None</a></li>
+                                               <a href=\"$sel_all_link\">".__('All')."</a>,
+                                               <a href=\"$sel_unread_link\">".__('Unread')."</a>,
+                                               <a href=\"$sel_none_link\">".__('None')."</a></li>
                                        <li class=\"vsep\">&nbsp;</li>
                                        <li class=\"top\">Selection<ul>
-                                               <li onclick=\"$tog_unread_link\">Toggle unread</li>
-                                               <li onclick=\"$tog_marked_link\">Toggle starred</li></ul></li>
-                                       <li class=\"vsep\">&nbsp;</li>
-                                       <li class=\"top\"><a href=\"$catchup_page_link\">Mark as read</a><ul>
-                                               <li onclick=\"$catchup_page_link\">This page</li>
-                                               <li onclick=\"$catchup_feed_link\">Entire feed</li></ul></li>
+                                               <li onclick=\"$tog_unread_link\">".__('Toggle unread')."</li>
+                                               <li onclick=\"$tog_marked_link\">".__('Toggle starred')."</li></ul></li>
                                        <li class=\"vsep\">&nbsp;</li>
-                                       <!-- <li class=\"top2\">
-                                       Page:
-                                               <a href=\"$page_prev_link\">Previous</a>,
-                                               <a href=\"$page_next_link\">Next</a></li> -->";
+                                       <li class=\"top\"><a href=\"$catchup_page_link\">".__('Mark as read')."</a><ul>
+                                               <li onclick=\"$catchup_page_link\">".__('This page')."</li>
+                                               <li onclick=\"$catchup_feed_link\">".__('Entire feed')."</li></ul></li>
+                                       <li class=\"vsep\">&nbsp;</li>";
 
                                        if ($limit != 0) {
                                                print "
-                                               <li class=\"top\"><a href=\"$page_next_link\">Next page</a><ul>
-                                                       <li onclick=\"$page_prev_link\">Previous page</li>
-                                                       <li onclick=\"$page_first_link\">First page</li></ul></li>
+                                               <li class=\"top\"><a href=\"$page_next_link\">".__('Next page')."</a><ul>
+                                                       <li onclick=\"$page_prev_link\">".__('Previous page')."</li>
+                                                       <li onclick=\"$page_first_link\">".__('First page')."</li></ul></li>
                                                        </ul>";
                                        }
 
 
                                print "<td class=\"headlineActions$rtl_cpart\">".
                                        __('Select:')."
-                                                               <a href=\"$sel_all_link\">All</a>,
-                                                               <a href=\"$sel_unread_link\">Unread</a>,
-                                                               <a href=\"$sel_none_link\">None</a>
+                                                               <a href=\"$sel_all_link\">".__('All')."</a>,
+                                                               <a href=\"$sel_unread_link\">".__('Unread')."</a>,
+                                                               <a href=\"$sel_none_link\">".__('None')."</a>
                                                &nbsp;&nbsp;".
-                                               __('Toggle:')." <a href=\"$tog_unread_link\">Unread</a>,
-                                                       <a href=\"$tog_marked_link\">Starred</a>
+                                               __('Toggle:')." <a href=\"$tog_unread_link\">".__('Unread')."</a>,
+                                                       <a href=\"$tog_marked_link\">".__('Starred')."</a>
                                                &nbsp;&nbsp;".
                                                __('Mark as read:')."
-                                                       <a href=\"#\" onclick=\"$catchup_page_link\">Page</a>,
-                                                       <a href=\"#\" onclick=\"$catchup_feed_link\">Feed</a>";
+                                                       <a href=\"#\" onclick=\"$catchup_page_link\">".__('Page')."</a>,
+                                                       <a href=\"#\" onclick=\"$catchup_feed_link\">".__('Feed')."</a>";
                                print "</td>";  
 
                        }
                                        <a target=\"_new\" 
                                                href=\"backend.php?op=rss&id=$feed_id&is_cat=$is_cat$search_q\">
                                                <img class=\"noborder\" 
-                                                       alt=\"Generated feed\" src=\"images/feed-icon-12x12.png\">
+                                                       alt=\"".__('Generated feed')."\" src=\"images/feed-icon-12x12.png\">
                                        </a>";
                        }
                                
index 156e46c7f5780517b7449205f5da2233d63ad67e..bd10284b2151465ea1b1032d85a46dd1622b4b9b 100644 (file)
@@ -41,7 +41,7 @@
 
                                                if (db_num_rows($result) == 0) {
 
-                                                       print "Adding category <b>$cat_title</b>...<br>";
+                                                       printf(__("Adding category <b>%s</b>...<br>"), $cat_title);
 
                                                        db_query($link, "INSERT INTO ttrss_feed_categories
                                                                        (title,owner_uid) 
@@ -86,7 +86,7 @@
                                                (<a target='_new' href=\"$feed_url\">rss</a>)</td>";
 
                                        if (db_num_rows($result) > 0) {
-                                               print "<td>Already imported.</td>";
+                                               print "<td>".__('Already imported.')."</td>";
                                        } else {
 
                                                if ($cat_id) {
 
                                                db_query($link, $add_query);
 
-                                               print "<td><b>Done.</b></td>";
+                                               print "<td><b>".__('Done.')."</b></td>";
                                        }
 
                                        print "</tr>";
                                print "</table>";
 
                        } else {
-                               print "<div class=\"error\">Error while parsing document.</div>";
+                               print "<div class=\"error\">".__('Error while parsing document.')."</div>";
                        }
 
                } else {
-                       print "<div class=\"error\">Error: please upload OPML file.</div>";
+                       print "<div class=\"error\">".__('Error: please upload OPML file.')."</div>";
                }
 
 
index dabba789491ed3a80b43b092540de8d3d720a450..8de842c51442274deae8befa58e1b79ed4e93e8e 100644 (file)
@@ -43,7 +43,7 @@
 
                                                        if (db_num_rows($result) == 0) {
 
-                                                               printf(_("Adding category <b>%s</b>."), $cat_title);
+                                                               printf(__("Adding category <b>%s</b>."), $cat_title);
                                                                print "<br>";
 
                                                                db_query($link, "INSERT INTO ttrss_feed_categories
@@ -89,7 +89,7 @@
                                                        (<a target='_new' href=\"$feed_url\">rss</a>)</td>";
 
                                                if (db_num_rows($result) > 0) {
-                                                       print "<td>"._("Already imported.")."</td>";
+                                                       print "<td>".__("Already imported.")."</td>";
                                                } else {
 
                                                        if ($cat_id) {
 
                                                        db_query($link, $add_query);
                                                        
-                                                       print "<td><b>"._('Done.')."</b></td>";
+                                                       print "<td><b>".__('Done.')."</b></td>";
                                                }
 
                                                print "</tr>";
                                        print "</table>";
 
                                } else {
-                                       print "<div class=\"error\">"._("Error: can't find body element.")."</div>";
+                                       print "<div class=\"error\">".__("Error: can't find body element.")."</div>";
                                }
                        } else {
-                               print "<div class=\"error\">"._("Error while parsing document.")."</div>";
+                               print "<div class=\"error\">".__("Error while parsing document.")."</div>";
                        }
 
                } else {
-                       print "<div class=\"error\">"._("Error: please upload OPML file.")."</div>";
+                       print "<div class=\"error\">".__("Error: please upload OPML file.")."</div>";
                }
 
        }
index 0113fe9e0463413024c13596b09ebec0617c3501..0b1f4915bd5c329e67bb0872841d5050fd5bde89 100644 (file)
--- a/opml.php
+++ b/opml.php
                print "<html>
                        <head>
                                <link rel=\"stylesheet\" href=\"utility.css\" type=\"text/css\">
-                               <title>OPML Utility</title>
+                               <title>".__("OPML Utility")."</title>
                        </head>
                        <body>
                        <div class=\"floatingLogo\"><img src=\"images/ttrss_logo.png\"></div>
                        <h1>".__('OPML Utility')."</h1>";
 
                if (function_exists('domxml_open_file')) {
-                       print "<p>Importing OPML (using DOMXML extension)...</p>";
+                       print __("<p>Importing OPML (using DOMXML extension)...</p>");
                        require_once "modules/opml_domxml.php";
                        opml_import_domxml($link, $owner_uid);
                } else {
-                       print "<p>Importing OPML (using DOMDocument extension)...</p>";
+                       print __("<p>Importing OPML (using DOMDocument extension)...</p>");
                        require_once "modules/opml_domdoc.php";
                        opml_import_domdoc($link, $owner_uid);
                }
 
                print "<br><form method=\"GET\" action=\"prefs.php\">
-                       <input type=\"submit\" value=\"Return to preferences\">
+                       <input type=\"submit\" value=\"".__("Return to preferences")."\">
                        </form>";
 
                print "</body></html>";
index 337b7b690c76fc396ceeb020e46464a7f7dfd64e..94638bae2a18746786d91ab9c9c42bc01b72b248 100644 (file)
--- a/prefs.php
+++ b/prefs.php
@@ -2,9 +2,6 @@
        error_reporting(E_ERROR | E_WARNING | E_PARSE);
 
        require_once "functions.php"; 
-       
-       startup_gettext();
-
        require_once "sessions.php";
        require_once "sanity_check.php";
        require_once "version.php"; 
index f7514b65cd1de304dda019647aa9ed49e504d0df..5361c7aa9f2808db9e61b109e792986417e04364 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+       require_once "functions.php";
+
        define('EXPECTED_CONFIG_VERSION', 5);
 
        if (!file_exists("config.php")) {
index d93531375334221f58612f57fedeee3adf133b2f..c170cefd7c377e859ae67e64a0c16065e9524789 100644 (file)
@@ -2,9 +2,6 @@
        error_reporting(E_ERROR | E_WARNING | E_PARSE);
 
        require_once "functions.php"; 
-
-       startup_gettext();
-
        require_once "sessions.php";
        require_once "sanity_check.php";
        require_once "version.php"; 
index 860d6c29456b8b34c90408078dfdcdbdf61b406d..f20390e1906f8176f5b0cc2d96deb6e80f691694 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh
 TEMPLATE=messages.pot
 
-xgettext -kT_ngettext:1,2 -kT_ -k_ -k__ -L PHP -o $TEMPLATE *.php modules/*.php
+xgettext -kT_ngettext:1,2 -k__ -L PHP -o $TEMPLATE *.php modules/*.php
 
 if [ "$1" = "-p" ]; then
        msgfmt --statistics $TEMPLATE