summaryrefslogtreecommitdiffstats
path: root/web/lib/translator.inc
diff options
context:
space:
mode:
authorelij <elij.mx@gmail.com>2011-05-29 23:33:37 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2011-06-22 15:15:04 +0200
commit888db089c515270fd5cd9a9bedd217110f43bc4c (patch)
treee31d78b517c5b849a91c56883dcff179fd3c3164 /web/lib/translator.inc
parent023d2a2521306be2c68f7cf1514bfc50bb250c04 (diff)
downloadaur-888db089c515270fd5cd9a9bedd217110f43bc4c.tar.gz
aur-888db089c515270fd5cd9a9bedd217110f43bc4c.tar.xz
rename *.inc files to *.inc.php and adjust imports and references
Lukas: Add note to "UPGRADING". Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/translator.inc')
-rw-r--r--web/lib/translator.inc50
1 files changed, 0 insertions, 50 deletions
diff --git a/web/lib/translator.inc b/web/lib/translator.inc
deleted file mode 100644
index 903b061e..00000000
--- a/web/lib/translator.inc
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-set_include_path(get_include_path() . PATH_SEPARATOR . '../lib' . PATH_SEPARATOR . '../lang');
-
-# This file provides support for i18n
-
-# usage:
-# use the __() function for returning translated strings of
-# text. The string can contain escape codes %h for HTML
-# and %s for regular text.
-#
-# examples:
-# print __("%s has %s apples.", "Bill", "5");
-# print __("This is a %hmajor%h problem!", "<b>", "</b>");
-
-include_once('config.inc');
-include_once('gettext.php');
-include_once('streams.php');
-
-global $streamer, $l10n;
-
-function __() {
- global $LANG;
- global $l10n;
-
- # Create the translation.
- $args = func_get_args();
-
- # First argument is always string to be translated
- $tag = $args[0];
-
- # Translate using gettext_reader initialized before.
- $translated = $l10n->translate($tag);
- $translated = htmlspecialchars($translated, ENT_QUOTES);
-
- $num_args = sizeof($args);
-
- # Subsequent arguments are strings to be formatted
- #
- # TODO: make this more robust.
- # '%%' should translate to a literal '%'
-
- if ( $num_args > 1 ) {
- for ($i = 1; $i < $num_args; $i++) {
- $translated = preg_replace("/\%[sh]/", $args[$i], $translated, 1);
- }
- }
-
- return $translated;
-}
-