Make DEFAULT_LANG mean the default language for displayed messages.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
Athurg Gooth 2010-01-08 17:23:09 -05:00 committed by Loui Chang
parent 55dcf5ce87
commit 8eab9ed462
3 changed files with 13 additions and 11 deletions

View file

@ -295,6 +295,8 @@ function set_lang() {
if ($LANG != DEFAULT_LANG ) { if ($LANG != DEFAULT_LANG ) {
include_once("$LANG.po"); include_once("$LANG.po");
} else {
include_once(DEFAULT_LANG.".po");
} }
return; return;

View file

@ -1,6 +1,7 @@
<?php <?php
# NOTE: modify these variables if your MySQL setup is different # NOTE: modify these variables if your MySQL setup is different
#
define( "AUR_db_host", "localhost:/var/run/mysqld/mysqld.sock" ); define( "AUR_db_host", "localhost:/var/run/mysqld/mysqld.sock" );
define( "AUR_db_name", "AUR" ); define( "AUR_db_name", "AUR" );
define( "AUR_db_user", "aur" ); define( "AUR_db_user", "aur" );
@ -16,8 +17,7 @@ define( "USERNAME_MAX_LEN", 16 );
define( "PASSWD_MIN_LEN", 4 ); define( "PASSWD_MIN_LEN", 4 );
define( "PASSWD_MAX_LEN", 128 ); define( "PASSWD_MAX_LEN", 128 );
# Language that messages are initially written in. # Default language for displayed messages in the web interface.
# This should never change.
define("DEFAULT_LANG", "en"); define("DEFAULT_LANG", "en");
# Languages we have translations for # Languages we have translations for

View file

@ -49,9 +49,10 @@ function __() {
# First argument is always string to be translated # First argument is always string to be translated
$tag = $args[0]; $tag = $args[0];
if (empty($LANG) || $LANG == DEFAULT_LANG) if (empty($LANG) || $LANG == DEFAULT_LANG){
$translated = $tag; $translated = $tag;
else { }
# If there is no translation, just print the given string. # If there is no translation, just print the given string.
if (empty($_t[$tag])) { if (empty($_t[$tag])) {
$translated = $tag; $translated = $tag;
@ -59,7 +60,6 @@ function __() {
else { else {
$translated = $_t[$tag]; $translated = $_t[$tag];
} }
}
$translated = htmlspecialchars($translated, ENT_QUOTES); $translated = htmlspecialchars($translated, ENT_QUOTES);