summaryrefslogtreecommitdiffstats
path: root/web/lib/translator.inc
diff options
context:
space:
mode:
authorLoui Chang <louipc.ist@gmail.com>2008-11-04 03:52:07 +0100
committerLoui Chang <louipc.ist@gmail.com>2008-11-04 03:52:07 +0100
commita6147ab5ab297728adefdb97aaeedc93114b896d (patch)
tree49b508439ab2aa0cf4bd039d3b2d2d53e8860df0 /web/lib/translator.inc
parentc85dfacc747387b9be6c53b4518ac680b505e0f7 (diff)
parent100451a9665cb387eeae2cb06cc22870cfd57c82 (diff)
downloadaur-a6147ab5ab297728adefdb97aaeedc93114b896d.tar.gz
aur-a6147ab5ab297728adefdb97aaeedc93114b896d.tar.xz
Merge branch 'testing'
Conflicts: web/html/pkgsubmit.php Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Diffstat (limited to 'web/lib/translator.inc')
-rw-r--r--web/lib/translator.inc13
1 files changed, 9 insertions, 4 deletions
diff --git a/web/lib/translator.inc b/web/lib/translator.inc
index 41ece89b..fb9ed635 100644
--- a/web/lib/translator.inc
+++ b/web/lib/translator.inc
@@ -25,7 +25,6 @@
include_once("common_po.inc");
-
function __() {
global $_t;
global $LANG;
@@ -37,14 +36,20 @@ function __() {
# First argument is always string to be translated
$tag = $args[0];
- $translated = $_t[$LANG][$tag];
+ if (empty($LANG) || $LANG == DEFAULT_LANG)
+ $translated = $tag;
+ else
+ $translated = $_t[$LANG][$tag];
+
if (empty($translated)) {
# if it's a supported language, but there isn't a translation,
# alert the visitor to the missing translation.
#
- $translated = "<b style=\"color: red\">_${tag}_</b>";
+ $translated = "_${tag}_";
}
+ $translated = htmlspecialchars($translated, ENT_QUOTES);
+
# This condition is to reorganise the arguments in case of
# deprecated usage. __("string", array("string","string"))
if (!empty($args[1]) && is_array($args[1])) {
@@ -60,7 +65,7 @@ function __() {
$translated = preg_replace("/\%[sh]/", $args[$i], $translated, 1);
}
}
+
return $translated;
}
-?>