From cc17c20574dbc0d2756bd6f75ca68588867eac25 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 5 Mar 2007 10:24:13 +0100 Subject: [PATCH] more I18N work, new option: ENABLE_TRANSLATIONS --- config.php-dist | 6 ++- functions.php | 7 ++- modules/popup-dialog.php | 92 ++++++++++++++++++++-------------------- prefs.php | 2 +- sanity_check.php | 4 +- tt-rss.css | 4 ++ tt-rss.php | 2 +- 7 files changed, 64 insertions(+), 53 deletions(-) diff --git a/config.php-dist b/config.php-dist index 6ccd0d8c..f0471833 100644 --- a/config.php-dist +++ b/config.php-dist @@ -138,7 +138,11 @@ // If update daemon and update_feeds should send digests // Disable if you prefer querying special URL (see wiki) - define('CONFIG_VERSION', 6); + define('ENABLE_TRANSLATIONS', false); + // Enable experimental support for interface translations + // based on PHP-Gettext. This is of no much use right now. + + define('CONFIG_VERSION', 7); // Expected config version. Please update this option in config.php // if necessary (after migrating all new options from this file). diff --git a/functions.php b/functions.php index f7a0cc54..7554ad9b 100644 --- a/functions.php +++ b/functions.php @@ -9,9 +9,12 @@ require_once "accept-to-gettext.php"; require_once "gettext/gettext.inc"; - startup_gettext(); - require_once 'config.php'; + + if (ENABLE_TRANSLATIONS == true) { + startup_gettext(); + } + require_once 'db-prefs.php'; require_once 'compat.php'; require_once 'errors.php'; diff --git a/modules/popup-dialog.php b/modules/popup-dialog.php index a8753472..6ac80be7 100644 --- a/modules/popup-dialog.php +++ b/modules/popup-dialog.php @@ -5,11 +5,11 @@ if ($id == "explainError") { - print "
Notice
"; + print "
".__('Notice')."
"; print "
"; if ($param == 1) { - print _("Update daemon is enabled in configuration, but daemon + print __("Update daemon is enabled in configuration, but daemon process is not running, which prevents all feeds from updating. Please start the daemon process or contact instance owner."); } @@ -18,7 +18,7 @@ $msg = check_for_update($link, false); if (!$msg) { - print _("You are running the latest version of Tiny Tiny RSS. The + print __("You are running the latest version of Tiny Tiny RSS. The fact that you are seeing this dialog is probably a bug."); } else { print $msg; @@ -32,7 +32,7 @@ print ""; + value=\"".__('Close this window')."\">"; print "
"; @@ -40,7 +40,7 @@ if ($id == "quickAddFeed") { - print "
Subscribe to feed
"; + print "
".__('Subscribe to feed')."
"; print "
"; print "
"; @@ -58,7 +58,7 @@ onfocus=\"javascript:disableHotkeys()\" name=\"feed_url\">"; if (get_pref($link, 'ENABLE_FEED_CATS')) { - print "Category:"; + print "".__('Category:').""; print_feed_cat_select($link, "cat_id"); print ""; } @@ -69,15 +69,15 @@ print "
+ type=\"submit\" onclick=\"return qafAdd()\" value=\"".__('Subscribe')."\">
"; + value=\"".__('Cancel')."\">
"; } if ($id == "search") { - print "
Search
"; + print "
".__('Search')."
"; print "
"; print ""; @@ -89,7 +89,7 @@ $active_feed_id = sprintf("%d", $params[0]); $is_cat = $params[1] == "true"; - print "
Search:"; + print ""; - print ""; - print "
".__('Search:').""; print "
Where:"; + print "
".__('Where:').""; print "
Match on:"; + print "
".__('Match on:').""; $search_fields = array( - "title" => "Title", - "content" => "Content", - "both" => "Title or content"); + "title" => __("Title"), + "content" => __("Content"), + "both" => __("Title or content")); print_select_hash("match_on", 3, $search_fields); @@ -146,17 +146,17 @@ + value=\"".__('Search')."\"> "; + value=\"".__('Cancel')."\">"; print ""; } if ($id == "quickAddLabel") { - print "
Create label
"; + print "
".__('Create label')."
"; print "
"; print ""; @@ -166,7 +166,7 @@ print ""; - print " + print ""; print ""; - print ""; + print ""; $result = db_query($link, "SELECT DISTINCT tag_name FROM ttrss_tags WHERE owner_uid = '".$_SESSION["uid"]."' ORDER BY tag_name"); @@ -370,11 +370,11 @@ print " "; + value=\"".__('Save')."\"> "; print ""; + value=\"".__('Cancel')."\">"; print ""; diff --git a/prefs.php b/prefs.php index 94638bae..1f0a97a8 100644 --- a/prefs.php +++ b/prefs.php @@ -87,7 +87,7 @@ window.onload = init;
- (Logout) + ()
Tiny Tiny RSS diff --git a/sanity_check.php b/sanity_check.php index 5361c7aa..721c7140 100644 --- a/sanity_check.php +++ b/sanity_check.php @@ -1,7 +1,7 @@ Fatal Error: You forgot to copy @@ -12,7 +12,7 @@ require_once "config.php"; if (CONFIG_VERSION != EXPECTED_CONFIG_VERSION) { - return __("config: your config file version is incorrect. See config.php-dist.\n"); + $err_msg = __("config: your config file version is incorrect. See config.php-dist.\n"); } if (defined('RSS_BACKEND_TYPE')) { diff --git a/tt-rss.css b/tt-rss.css index d6d81777..8eb51e15 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -1499,3 +1499,7 @@ ul.headlineDropdownMenu ul li:hover { a.helpLinkPic { float : right; } + +a.helpLinkPic img { + border-width : 0px; +} diff --git a/tt-rss.php b/tt-rss.php index c170cefd..e7c28f03 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -105,7 +105,7 @@ window.onload = init;
- (Logout) + ()
Caption:
".__('Caption:')."
-

SQL Expression:

"; +

".__('SQL Expression:')."

"; print ""; @@ -188,25 +188,25 @@ print "
"; - print " + print " "; print " "; + value=\"".__('Create')."\"> "; print ""; + value=\"".__('Cancel')."\">"; } if ($id == "quickAddFilter") { $active_feed_id = db_escape_string($_GET["param"]); - print "
Create filter
"; + print "
".__('Create filter')."
"; print "
"; print ""; @@ -229,24 +229,24 @@ print ""; - print " + print ""; - print ""; - print ""; + print ""; print ""; - print ""; + print ""; print ""; - print ""; + "; print "
Match:
".__('Match:')." "; - print "
On field:"; + print "
".__('On field:').""; print_select_hash("filter_type", 1, $filter_types, "class=\"_iedit\""); print "
Feed:"; + print "
".__('Feed:').""; print_feed_select($link, "feed_id", $active_feed_id); print "
Action:
".__('Action:')."
Params:
".__('Params:')."
Options:"; + print "
".__('Options:').""; print " -
"; @@ -280,11 +280,11 @@ print " "; + disabled=\"true\" value=\"".__('Create')."\"> "; print ""; + value=\"".__('Cancel')."\">"; print "
"; @@ -294,10 +294,10 @@ if ($id == "feedUpdateErrors") { - print "
Update Errors
"; + print "
".__('Update Errors')."
"; print "
"; - print "These feeds have not been updated because of errors:"; + print __("These feeds have not been updated because of errors:"); $result = db_query($link, "SELECT id,title,feed_url,last_error FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]); @@ -316,7 +316,7 @@ print ""; + value=\"".__('Close')."\">"; print "
"; @@ -324,12 +324,12 @@ if ($id == "editArticleTags") { - print "
Edit Tags
"; + print "
".__('Edit Tags')."
"; print "
"; print ""; - print "Tags for this article (separated by commas):
"; + print __("Tags for this article (separated by commas):")."
"; $tags = get_article_tags($link, $param); @@ -341,7 +341,7 @@ print "
Add existing tag:
".__('Add existing tag:')."