mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
finished tweaking language selection
This commit is contained in:
parent
74594e516d
commit
22e8556691
17 changed files with 303 additions and 20 deletions
|
@ -25,23 +25,8 @@ include_once("common_po.inc");
|
|||
|
||||
function __($tag, $args=array()) {
|
||||
global $_t;
|
||||
global $_REQUEST;
|
||||
global $LANG;
|
||||
|
||||
$supported_langs = array(
|
||||
"en" => 1, # English
|
||||
"es" => 1, # Español
|
||||
"de" => 1, # Deutsch
|
||||
"fr" => 1, # Français
|
||||
);
|
||||
|
||||
# default to English if the lang hasn't been provided or isn't supported
|
||||
#
|
||||
$LANG = $_REQUEST['LANG'];
|
||||
if (!$LANG || !array_key_exists($LANG, $supported_langs)) {
|
||||
$LANG = "en";
|
||||
}
|
||||
|
||||
# create the translation, if it doesn't exist, highlight it
|
||||
#
|
||||
$translated = $_t[$LANG][$tag];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue