mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Add a new DEFAULT_LANG constant.
DEFAULT_LANG will essentially be used to specify what language strings are initially written in. This will eliminate the need for English translation arrays in AUR and make adding or changing the English strings a lot easier. DEFAULT_LANG may be required for strings to display properly. Also change the output when a translation isn't found. Eliminate the <b> which can cause validation errors depending on where the string is placed. Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
parent
1deb924674
commit
1a1a6eb36e
3 changed files with 17 additions and 11 deletions
|
@ -311,12 +311,11 @@ function set_lang() {
|
|||
$LANG = $row[0];
|
||||
}
|
||||
$update_cookie = 1;
|
||||
} else {
|
||||
$LANG = "en";
|
||||
}
|
||||
|
||||
# Set $LANG to default if nothing is valid.
|
||||
if (!array_key_exists($LANG, $SUPPORTED_LANGS)) {
|
||||
$LANG = "en"; # default to English
|
||||
$LANG = DEFAULT_LANG;
|
||||
}
|
||||
|
||||
if ($update_cookie) {
|
||||
|
@ -336,7 +335,7 @@ function html_header($title="") {
|
|||
global $SUPPORTED_LANGS;
|
||||
|
||||
$login = try_login();
|
||||
$login_error = $login['error'];
|
||||
$login_error = $login['error'];
|
||||
|
||||
$title = htmlspecialchars($title, ENT_QUOTES);
|
||||
|
||||
|
@ -410,4 +409,3 @@ function uid_from_username($username="")
|
|||
return $row[0];
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue