diff options
author | Andrew Dolgov <[email protected]> | 2007-03-05 10:04:55 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2007-03-05 10:04:55 +0100 |
commit | 1025ad87633f30d00a3c283b3e8ad2bafa384a5c (patch) | |
tree | 4991677b859501c3a2b5161ebaa92cec0d37e696 | |
parent | d1db26aa1c18130accf6e536a063efadbab65a1d (diff) |
more I18N work
-rw-r--r-- | backend.php | 1 | ||||
-rw-r--r-- | errors.php | 1 | ||||
-rw-r--r-- | functions.php | 52 | ||||
-rw-r--r-- | modules/opml_domdoc.php | 10 | ||||
-rw-r--r-- | modules/opml_domxml.php | 12 | ||||
-rw-r--r-- | opml.php | 8 | ||||
-rw-r--r-- | prefs.php | 3 | ||||
-rw-r--r-- | sanity_check.php | 2 | ||||
-rw-r--r-- | tt-rss.php | 3 | ||||
-rw-r--r-- | update-translations.sh | 2 |
10 files changed, 45 insertions, 49 deletions
diff --git a/backend.php b/backend.php index 1f0cf2e81..03f90e2e1 100644 --- a/backend.php +++ b/backend.php @@ -22,6 +22,7 @@ require_once "functions.php"; no_cache_incantation(); + startup_gettext(); $script_started = getmicrotime(); diff --git a/errors.php b/errors.php index 16efd09a9..c7499a9ce 100644 --- a/errors.php +++ b/errors.php @@ -1,4 +1,5 @@ <?php + $ERRORS[0] = __("Unknown error"); $ERRORS[1] = __("This program requires XmlHttpRequest " . diff --git a/functions.php b/functions.php index a90eed185..f7a0cc54d 100644 --- a/functions.php +++ b/functions.php @@ -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; @@ -2752,28 +2754,24 @@ <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\"> </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\"> </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\"> </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\"> </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>"; } @@ -2785,16 +2783,16 @@ 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> ". - __('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> ". __('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>"; } @@ -2830,7 +2828,7 @@ <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>"; } diff --git a/modules/opml_domdoc.php b/modules/opml_domdoc.php index 156e46c7f..bd10284b2 100644 --- a/modules/opml_domdoc.php +++ b/modules/opml_domdoc.php @@ -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) { @@ -104,7 +104,7 @@ db_query($link, $add_query); - print "<td><b>Done.</b></td>"; + print "<td><b>".__('Done.')."</b></td>"; } print "</tr>"; @@ -115,11 +115,11 @@ 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>"; } diff --git a/modules/opml_domxml.php b/modules/opml_domxml.php index dabba7894..8de842c51 100644 --- a/modules/opml_domxml.php +++ b/modules/opml_domxml.php @@ -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) { @@ -107,7 +107,7 @@ db_query($link, $add_query); - print "<td><b>"._('Done.')."</b></td>"; + print "<td><b>".__('Done.')."</b></td>"; } print "</tr>"; @@ -118,14 +118,14 @@ 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>"; } } @@ -100,24 +100,24 @@ 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>"; @@ -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"; diff --git a/sanity_check.php b/sanity_check.php index f7514b65c..5361c7aa9 100644 --- a/sanity_check.php +++ b/sanity_check.php @@ -1,4 +1,6 @@ <?php + require_once "functions.php"; + define('EXPECTED_CONFIG_VERSION', 5); if (!file_exists("config.php")) { diff --git a/tt-rss.php b/tt-rss.php index d93531375..c170cefd7 100644 --- a/tt-rss.php +++ b/tt-rss.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"; diff --git a/update-translations.sh b/update-translations.sh index 860d6c294..f20390e19 100644 --- a/update-translations.sh +++ b/update-translations.sh @@ -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 |