Module: tools Branch: master Commit: f100c34cc9f317c5b8cb85565c53d1d47bdb403b URL: http://source.winehq.org/git/tools.git/?a=commit;h=f100c34cc9f317c5b8cb85565...
Author: Paul Vriens Paul.Vriens.Wine@gmail.com Date: Fri Aug 14 14:39:04 2009 +0200
transl: Add the ability to pass a pedantic parameter around.
---
transl/index.php | 2 ++ transl/lang.php | 1 + transl/lib.php | 24 +++++++++++++++++------- transl/resfile.php | 1 + transl/resource.php | 1 + 5 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/transl/index.php b/transl/index.php index 51d7f9c..f442594 100644 --- a/transl/index.php +++ b/transl/index.php @@ -2,6 +2,8 @@ include_once("config.php"); include_once("lib.php");
+$pedantic = isset($_REQUEST['pedantic']); + $summary = fopen("$DATAROOT/summary", "r"); $transl = array(); $sum = 0; diff --git a/transl/lang.php b/transl/lang.php index 29b0692..c008049 100644 --- a/transl/lang.php +++ b/transl/lang.php @@ -3,6 +3,7 @@ include_once("config.php") ; include_once("lib.php");
$lang = validate_lang($_REQUEST['lang']); +$pedantic = isset($_REQUEST['pedantic']);
$transl = array(); $notransl = array(); diff --git a/transl/lib.php b/transl/lib.php index 5f0580e..11f3d52 100644 --- a/transl/lib.php +++ b/transl/lib.php @@ -6,6 +6,15 @@ $WINE_WIKI_TRANSLATIONS = "<a href="redirect.php?url=http://wiki.winehq.org/Tra
static $LOCALE_NAMES = array();
+function is_pedantic() +{ + global $pedantic; + + if ($pedantic) + return TRUE; + return FALSE; +} + // These resources are retrieved as a sequence of words that need to be converted to a string function convert_to_unicode($words) { @@ -227,28 +236,29 @@ function update_lang_from_resfile($lang, $resfile)
function gen_lang_a($lang) { - return "<a href="lang.php?lang=".urlencode($lang)."">"; + $extra = is_pedantic() ? "&pedantic=" : ""; + return "<a href="lang.php?lang=".urlencode($lang)."$extra">"; }
function gen_resfile_a($lang, $resfile) { - return "<a href="resfile.php?lang=".urlencode($lang)."&resfile=".urlencode($resfile)."">"; + $extra = is_pedantic() ? "&pedantic=" : ""; + return "<a href="resfile.php?lang=".urlencode($lang)."&resfile=".urlencode($resfile)."$extra">"; }
function gen_resource_a($lang, $resfile, $type, $id, $compare=FALSE) { - if ($compare) - $extra = "&compare="; - else - $extra = ""; + $extra = ($compare) ? "&compare=" : ""; + $extra .= is_pedantic() ? "&pedantic=" : ""; return "<a href="resource.php?lang=".urlencode($lang)."&resfile=".urlencode($resfile). "&type=".urlencode($type)."&id=".urlencode($id)."$extra">"; }
function dump_menu_root($link = TRUE) { + $extra = is_pedantic() ? "?pedantic=" : ""; if ($link) - echo "<a href="index.php">"; + echo "<a href="index.php$extra">"; echo "Wine translations"; if ($link) echo "</a>"; diff --git a/transl/resfile.php b/transl/resfile.php index 5e38dfc..191ac65 100644 --- a/transl/resfile.php +++ b/transl/resfile.php @@ -4,6 +4,7 @@ include("lib.php");
$lang = validate_lang($_REQUEST['lang']); $resfile = validate_resfile($_REQUEST['resfile']); +$pedantic = isset($_REQUEST['pedantic']);
$msgs = array(); ?> diff --git a/transl/resource.php b/transl/resource.php index 9197210..c5652ca 100644 --- a/transl/resource.php +++ b/transl/resource.php @@ -8,6 +8,7 @@ $resfile = validate_resfile($_REQUEST['resfile']); $type = validate_type($_REQUEST['type']); $id = validate_id($_REQUEST['id']); $compare = isset($_REQUEST['compare']); +$pedantic = isset($_REQUEST['pedantic']);
?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">