From 89cb787edd1c9d3c2fa2616c98986b130fcaf930 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 10 Aug 2007 17:16:43 +0100 Subject: [PATCH] more translation work --- functions.js | 4 +- functions.php | 10 +- locale/fr_FR/LC_MESSAGES/messages.mo | Bin 26832 -> 27002 bytes locale/fr_FR/LC_MESSAGES/messages.po | 224 +++++++++++++++++--------- locale/ru_RU/LC_MESSAGES/messages.mo | Bin 19008 -> 19008 bytes locale/ru_RU/LC_MESSAGES/messages.po | 227 ++++++++++++++++++--------- locale/zh_CN/LC_MESSAGES/messages.mo | Bin 21073 -> 21073 bytes locale/zh_CN/LC_MESSAGES/messages.po | 227 ++++++++++++++++++--------- localized_js.php | 25 +++ localized_schema.php | 21 +++ modules/popup-dialog.php | 12 +- modules/pref-feed-browser.php | 8 +- modules/pref-filters.php | 4 +- modules/pref-prefs.php | 19 +-- prefs.js | 20 +-- tt-rss.css | 4 +- tt-rss.js | 14 +- 17 files changed, 559 insertions(+), 260 deletions(-) create mode 100644 localized_schema.php diff --git a/functions.js b/functions.js index 11f3cf39..4798c3c2 100644 --- a/functions.js +++ b/functions.js @@ -1518,7 +1518,7 @@ function addFilter() { var reg_exp = form.reg_exp.value; if (reg_exp == "") { - alert("Can't add filter: nothing to match on."); + alert(__("Can't add filter: nothing to match on.")); return false; } @@ -1554,7 +1554,7 @@ function qaddFeed() { var feed_url = form.feed_url.value; if (feed_url == "") { - alert("Can't subscribe: no feed URL given."); + alert(__("Can't subscribe: no feed URL given.")); return false; } diff --git a/functions.php b/functions.php index 25a8913a..7c162be1 100644 --- a/functions.php +++ b/functions.php @@ -16,7 +16,11 @@ # Get locale from Accept-Language header $lang = al2gt(array("en_US", "ru_RU", "zh_CN", "fr_FR"), "text/html"); - + + if (defined('_TRANSLATION_OVERRIDE_DEFAULT')) { + $lang = _TRANSLATION_OVERRIDE_DEFAULT; + } + if ($lang) { _setlocale(LC_MESSAGES, $lang); _bindtextdomain("messages", "locale"); @@ -2207,7 +2211,7 @@ print ""; print " - "; + print ""; // print " // "; @@ -349,9 +350,9 @@ $def_value = $line["def_value"]; $help_text = $line["help_text"]; - print ""; @@ -384,11 +385,11 @@ print ""; print "

"; + name=\"subop\" value=\"".__('Save configuration')."\">"; print " 

"; + value=\"".__('Reset to defaults')."\">

"; print ""; diff --git a/prefs.js b/prefs.js index 071bb8a4..6609bcac 100644 --- a/prefs.js +++ b/prefs.js @@ -279,12 +279,12 @@ function addLabel() { var description = form.description.value; if (sql_exp == "") { - alert("Can't create label: missing SQL expression."); + alert(__("Can't create label: missing SQL expression.")); return false; } if (description == "") { - alert("Can't create label: missing caption."); + alert(__("Can't create label: missing caption.")); return false; } @@ -356,7 +356,7 @@ function addUser() { var sqlexp = document.getElementById("uadd_box"); if (sqlexp.value.length == 0) { - alert("Can't add user: no login specified."); + alert(__("Can't add user: no login specified.")); } else { notify_progress("Adding user..."); @@ -546,7 +546,7 @@ function removeSelectedLabels() { xmlhttp.send(null); } } else { - alert("No labels are selected."); + alert(__("No labels are selected.")); } return false; @@ -575,7 +575,7 @@ function removeSelectedUsers() { } } else { - alert("No users are selected."); + alert(__("No users are selected.")); } return false; @@ -603,7 +603,7 @@ function removeSelectedFilters() { xmlhttp.send(null); } } else { - alert("No filters are selected."); + alert(__("No filters are selected.")); } return false; @@ -635,7 +635,7 @@ function removeSelectedFeeds() { } else { - alert("No feeds are selected."); + alert(__("No feeds are selected.")); } @@ -666,7 +666,7 @@ function removeSelectedFeedCats() { } else { - alert("No categories are selected."); + alert(__("No categories are selected.")); } @@ -900,7 +900,7 @@ function userEditSave() { var login = document.forms["user_edit_form"].login.value; if (login.length == 0) { - alert("Login field cannot be blank."); + alert(__("Login field cannot be blank.")); return; } @@ -1488,7 +1488,7 @@ function feedBrowserSubscribe() { xmlhttp.onreadystatechange=feedlist_callback; xmlhttp.send(null); } else { - alert("No feeds are selected."); + alert(__("No feeds are selected.")); } } catch (e) { diff --git a/tt-rss.css b/tt-rss.css index 61ae3fa1..a0ef19ce 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -1545,7 +1545,7 @@ ul.headlineDropdownMenu { ul.headlineDropdownMenu li.top { float : left; - width : 9em; + width : 11em; background-image : url("images/down_arrow.png"); background-position : center right; background-repeat : no-repeat; @@ -1597,7 +1597,7 @@ ul.headlineDropdownMenu ul { padding : 0px; display : none; background-color : white; - width : 9em; + width : 11em; z-index : 3; top : auto; left : auto; diff --git a/tt-rss.js b/tt-rss.js index cf68a0f5..e7a21a73 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -491,18 +491,20 @@ function quickMenuGo(opid) { var actid = getActiveFeedId(); if (activeFeedIsCat()) { - alert("You can't unsubscribe from the category."); + alert(__("You can't unsubscribe from the category.")); return; } if (!actid) { - alert("Please select some feed first."); + alert(__("Please select some feed first.")); return; } var fn = getFeedName(actid); - - if (confirm("Unsubscribe from " + fn + "?")) { + + var pr = __("Unsubscribe from %s?").replace("%s", fn); + + if (confirm(pr)) { qfdDelete(actid); } @@ -667,12 +669,12 @@ function editFeedDlg(feed) { disableHotkeys(); if (!feed) { - alert("Please select some feed first."); + alert(__("Please select some feed first.")); return; } if (feed <= 0 || activeFeedIsCat() || tagsAreDisplayed()) { - alert("You can't edit this kind of feed."); + alert(__("You can't edit this kind of feed.")); return; } -- 2.39.5
Feed URL: +
".__('Feed URL:')."
Click here if this feed requires authentication."; + \"fadd_login_prompt\")'>".__('Click here if this feed requires authentication.').""; print "
- - +
Login:
Password:".__('Login:')."
".__('Password:')."
"; @@ -259,7 +259,7 @@ while ($line = db_fetch_assoc($result)) { //array_push($filter_types, $line["description"]); - $filter_types[$line["id"]] = $line["description"]; + $filter_types[$line["id"]] = __($line["description"]); } print ""; @@ -290,7 +290,7 @@ ORDER BY name"); while ($line = db_fetch_assoc($result)) { - printf("", $line["id"], $line["description"]); + printf("", $line["id"], __($line["description"])); } print ""; diff --git a/modules/pref-feed-browser.php b/modules/pref-feed-browser.php index 104dd93f..4759a5f6 100644 --- a/modules/pref-feed-browser.php +++ b/modules/pref-feed-browser.php @@ -2,7 +2,7 @@ function module_pref_feed_browser($link) { if (!ENABLE_FEED_BROWSER) { - print "Feed browser is administratively disabled."; + print __("Feed browser is administratively disabled."); return; } @@ -12,7 +12,7 @@ $id = db_escape_string($_GET["id"]); print "
"; - print "Feed information:"; + print "".__('Feed information:').""; print "
"; $result = db_query($link, "SELECT @@ -48,7 +48,7 @@ if (db_num_rows($result) > 0) { - print "Last headlines:
"; + print "".__('Last headlines:')."
"; print "
"; print "
    "; @@ -149,7 +149,7 @@ } if ($feedctr == 0) { - print "
  • No feeds found to subscribe.
  • "; + print "
  • ".__('No feeds found to subscribe.')."
  • "; } print "
"; diff --git a/modules/pref-filters.php b/modules/pref-filters.php index 3c0f6129..e043323e 100644 --- a/modules/pref-filters.php +++ b/modules/pref-filters.php @@ -37,7 +37,7 @@ while ($line = db_fetch_assoc($result)) { //array_push($filter_types, $line["description"]); - $filter_types[$line["id"]] = $line["description"]; + $filter_types[$line["id"]] = __($line["description"]); } print "
"; @@ -69,7 +69,7 @@ while ($line = db_fetch_assoc($result)) { $is_sel = ($line["id"] == $action_id) ? "selected" : ""; - printf("", $line["id"], $line["description"]); + printf("", $line["id"], __($line["description"])); } print ""; diff --git a/modules/pref-prefs.php b/modules/pref-prefs.php index 036a7607..7ade0391 100644 --- a/modules/pref-prefs.php +++ b/modules/pref-prefs.php @@ -56,7 +56,7 @@ return; - } else if ($subop == "Save configuration") { + } else if ($subop == __("Save configuration")) { $_SESSION["prefs_op_result"] = "save-config"; @@ -124,7 +124,7 @@ return; - } else if ($subop == "Reset to defaults") { + } else if ($subop == __("Reset to defaults")) { $_SESSION["prefs_op_result"] = "reset-to-defaults"; @@ -282,7 +282,7 @@ print ""; print ""; print ""; print "

".__("Themes")."

".__("Select theme")."
"; print ""; + print ""; print "

"; + value=\"".__('Change theme')."\">"; print ""; } @@ -332,7 +333,7 @@ $active_section = $line["section_name"]; - print "

$active_section

".__($active_section)."

OptionValue
" . $line["short_desc"]; + print "" . __($line["short_desc"]); - if ($help_text) print "
$help_text
"; + if ($help_text) print "
".__($help_text)."
"; print "