Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Marcus Andersson
aurweb
Commits
8eab9ed4
Commit
8eab9ed4
authored
Jan 08, 2010
by
Athurg Gooth
Committed by
Loui Chang
Jan 08, 2010
Browse files
Make DEFAULT_LANG mean the default language for displayed messages.
Signed-off-by:
Loui Chang
<
louipc.ist@gmail.com
>
parent
55dcf5ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
web/lib/aur.inc
View file @
8eab9ed4
...
...
@@ -295,6 +295,8 @@ function set_lang() {
if
(
$LANG
!=
DEFAULT_LANG
)
{
include_once
(
"
$LANG
.po"
);
}
else
{
include_once
(
DEFAULT_LANG
.
".po"
);
}
return
;
...
...
web/lib/config.inc.proto
View file @
8eab9ed4
<
?
php
#
NOTE
:
modify
these
variables
if
your
MySQL
setup
is
different
#
define
(
"AUR_db_host"
,
"localhost:/var/run/mysqld/mysqld.sock"
);
define
(
"AUR_db_name"
,
"AUR"
);
define
(
"AUR_db_user"
,
"aur"
);
...
...
@@ -16,8 +17,7 @@ define( "USERNAME_MAX_LEN", 16 );
define
(
"PASSWD_MIN_LEN"
,
4
);
define
(
"PASSWD_MAX_LEN"
,
128
);
#
Language
that
messages
are
initially
written
in.
#
This
should
never
change.
#
Default
language
for
displayed
messages
in
the
web
interface.
define
(
"DEFAULT_LANG"
,
"en"
);
#
Languages
we
have
translations
for
...
...
web/lib/translator.inc
View file @
8eab9ed4
...
...
@@ -49,16 +49,16 @@ function __() {
# First argument is always string to be translated
$tag
=
$args
[
0
];
if
(
empty
(
$LANG
)
||
$LANG
==
DEFAULT_LANG
)
if
(
empty
(
$LANG
)
||
$LANG
==
DEFAULT_LANG
)
{
$translated
=
$tag
;
}
# If there is no translation, just print the given string.
if
(
empty
(
$_t
[
$tag
]))
{
$translated
=
$tag
;
}
else
{
# If there is no translation, just print the given string.
if
(
empty
(
$_t
[
$tag
]))
{
$translated
=
$tag
;
}
else
{
$translated
=
$_t
[
$tag
];
}
$translated
=
$_t
[
$tag
];
}
$translated
=
htmlspecialchars
(
$translated
,
ENT_QUOTES
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment