From 1025ad87633f30d00a3c283b3e8ad2bafa384a5c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 5 Mar 2007 10:04:55 +0100 Subject: [PATCH] more I18N work --- backend.php | 1 + errors.php | 1 + functions.php | 52 ++++++++++++++++++++--------------------- modules/opml_domdoc.php | 10 ++++---- modules/opml_domxml.php | 12 +++++----- opml.php | 8 +++---- prefs.php | 3 --- sanity_check.php | 2 ++ tt-rss.php | 3 --- 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 @@
  • Select: - All, - Unread, - None
  • + ".__('All').", + ".__('Unread').", + ".__('None')."
  •  
  • Selection
  • +
  • ".__('Toggle unread')."
  • +
  • ".__('Toggle starred')."
  •  
  • -
  • Mark as read
  • -
  •  
  • - "; +
  • ".__('Mark as read')."
  • +
  •  
  • "; if ($limit != 0) { print " -
  • Next page
  • +
  • ".__('Next page')."
  • "; } @@ -2785,16 +2783,16 @@ print "". __('Select:')." - All, - Unread, - None + ".__('All').", + ".__('Unread').", + ".__('None')."   ". - __('Toggle:')." Unread, - Starred + __('Toggle:')." ".__('Unread').", + ".__('Starred')."   ". __('Mark as read:')." - Page, - Feed"; + ".__('Page').", + ".__('Feed').""; print ""; } @@ -2830,7 +2828,7 @@ \"Generated + alt=\"".__('Generated feed')."\" src=\"images/feed-icon-12x12.png\"> "; } 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 $cat_title...
    "; + printf(__("Adding category %s...
    "), $cat_title); db_query($link, "INSERT INTO ttrss_feed_categories (title,owner_uid) @@ -86,7 +86,7 @@ (rss)"; if (db_num_rows($result) > 0) { - print "Already imported."; + print "".__('Already imported.').""; } else { if ($cat_id) { @@ -104,7 +104,7 @@ db_query($link, $add_query); - print "Done."; + print "".__('Done.').""; } print ""; @@ -115,11 +115,11 @@ print ""; } else { - print "
    Error while parsing document.
    "; + print "
    ".__('Error while parsing document.')."
    "; } } else { - print "
    Error: please upload OPML file.
    "; + print "
    ".__('Error: please upload OPML file.')."
    "; } 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 %s."), $cat_title); + printf(__("Adding category %s."), $cat_title); print "
    "; db_query($link, "INSERT INTO ttrss_feed_categories @@ -89,7 +89,7 @@ (rss)"; if (db_num_rows($result) > 0) { - print ""._("Already imported.").""; + print "".__("Already imported.").""; } else { if ($cat_id) { @@ -107,7 +107,7 @@ db_query($link, $add_query); - print ""._('Done.').""; + print "".__('Done.').""; } print ""; @@ -118,14 +118,14 @@ print ""; } else { - print "
    "._("Error: can't find body element.")."
    "; + print "
    ".__("Error: can't find body element.")."
    "; } } else { - print "
    "._("Error while parsing document.")."
    "; + print "
    ".__("Error while parsing document.")."
    "; } } else { - print "
    "._("Error: please upload OPML file.")."
    "; + print "
    ".__("Error: please upload OPML file.")."
    "; } } diff --git a/opml.php b/opml.php index 0113fe9e0..0b1f4915b 100644 --- a/opml.php +++ b/opml.php @@ -100,24 +100,24 @@ print " - OPML Utility + ".__("OPML Utility")."

    ".__('OPML Utility')."

    "; if (function_exists('domxml_open_file')) { - print "

    Importing OPML (using DOMXML extension)...

    "; + print __("

    Importing OPML (using DOMXML extension)...

    "); require_once "modules/opml_domxml.php"; opml_import_domxml($link, $owner_uid); } else { - print "

    Importing OPML (using DOMDocument extension)...

    "; + print __("

    Importing OPML (using DOMDocument extension)...

    "); require_once "modules/opml_domdoc.php"; opml_import_domdoc($link, $owner_uid); } print "
    - +
    "; print ""; diff --git a/prefs.php b/prefs.php index 337b7b690..94638bae2 100644 --- 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"; 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 @@