Paul Vriens : transl: Add the possibility to switch between 'Normal' and ' Pedantic'.
Alexandre Julliard
julliard at winehq.org
Tue Aug 18 10:29:50 CDT 2009
Module: tools
Branch: master
Commit: b730ab459a41acdb1cef34026130aad04a26e086
URL: http://source.winehq.org/git/tools.git/?a=commit;h=b730ab459a41acdb1cef34026130aad04a26e086
Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date: Fri Aug 14 16:25:44 2009 +0200
transl: Add the possibility to switch between 'Normal' and 'Pedantic'.
---
transl/index.php | 9 +++++----
transl/lib.php | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/transl/index.php b/transl/index.php
index 3249265..66071ad 100644
--- a/transl/index.php
+++ b/transl/index.php
@@ -40,10 +40,11 @@ while ($line = fgets($summary, 1024))
<?php echo $TITLE_DESCR ?>
<p>This page shows the state of the translations of <a href="http://www.winehq.org/">Wine</a>.
-Note that some resources marked as translated may be in fact in English - sometimes developers
-add new English resources into every language file. This automatic tool doesn't detect this -
-it needs to be found manually by the translators. If you would like to read about how to
-improve Wine translations check <?php echo $WINE_WIKI_TRANSLATIONS ?>.
+Note that some resources marked as translated may in fact still be English. Sometimes developers
+add new English resources into every language file. This automatic tool has a 'Pedantic' mode that
+detects most of these but currently has a lot of false positives. If you would like to read about
+how to improve Wine translations check
+<?php echo $WINE_WIKI_TRANSLATIONS ?>.
</p>
<table class="index">
diff --git a/transl/lib.php b/transl/lib.php
index 11f3d52..aceee55 100644
--- a/transl/lib.php
+++ b/transl/lib.php
@@ -262,6 +262,12 @@ function dump_menu_root($link = TRUE)
echo "Wine translations";
if ($link)
echo "</a>";
+
+ if (strpos($_SERVER['PHP_SELF'], "index.php"))
+ {
+ $url = "index.php";
+ dump_pedantic($url, TRUE);
+ }
}
function dump_menu_lang($lang, $link = TRUE)
@@ -274,6 +280,12 @@ function dump_menu_lang($lang, $link = TRUE)
echo get_lang_name($lang);
if ($link)
echo "</a>";
+
+ if (strpos($_SERVER['PHP_SELF'], "lang.php"))
+ {
+ $url = "lang.php?lang=".urlencode($lang);
+ dump_pedantic($url, FALSE);
+ }
}
function dump_menu_resfile($lang, $resfile, $link = TRUE)
@@ -286,6 +298,12 @@ function dump_menu_resfile($lang, $resfile, $link = TRUE)
echo get_resfile_name($resfile);
if ($link)
echo "</a>";
+
+ if (strpos($_SERVER['PHP_SELF'], "resfile.php"))
+ {
+ $url = "resfile.php?lang=".urlencode($lang)."&resfile=".urlencode($resfile);
+ dump_pedantic($url, FALSE);
+ }
}
function dump_menu_resource($lang, $resfile, $type, $id)
@@ -294,6 +312,28 @@ function dump_menu_resource($lang, $resfile, $type, $id)
echo " > ";
echo get_resource_name($type, $id);
+
+ $url = "resource.php?lang=".urlencode($lang)."&resfile=".urlencode($resfile)."&type=".urlencode($type)."&id=".urlencode($id);
+ dump_pedantic($url, FALSE);
+}
+
+function dump_pedantic($url, $highest_level = FALSE)
+{
+ echo "<a style=\"float: right; margin-top: -13px;\" href=\"".$url;
+ if (is_pedantic())
+ {
+ echo "\" title=\"'Normal' mode will only show errors.\"";
+ echo ">Switch to 'Normal' mode</a>";
+ }
+ else
+ {
+ if ($highest_level)
+ echo "?pedantic=\"";
+ else
+ echo "&pedantic=\"";
+ echo "title=\"'Pedantic' mode will show more potential translation issues.\"";
+ echo ">Switch to 'Pedantic' mode</a>";
+ }
}
?>
More information about the wine-cvs
mailing list