[aur-dev] patch for AUR about setting the DEFAULT_LANG

Athurg Gooth athurg at gooth.cn
Mon Nov 30 04:27:11 EST 2009

Loui Chang, and other guys:

When i port a chinese version AUR,  I fount this bug. That once i setting a
default language to sth(eg: zh_CN) by change DEFAULT_LANG macr define in
web/lib/config.inc, it won't work, and this language page(here is zh_CN)
could not show its native strings.

Then i turn back to check if i got a wrong spelling. But i fount the
developer have told us that options couldn't be change(in
web/lib/config.inc, line 48). So I think maybe its a bug which havn't been

After i check all the code about language setting, i think i got  the
reason. We have two problems which cause that bug.

First, in .../web/lib/aur.inc, between line 296 to line 298. Even the
$LANG==DEFAULT_LANG, we should include the $LANG.po file. Because once the
DEFAULT_LANG isn't english, we also need translate the strings.
So i just suggest add an 'else' branch after line 298 to include
DEFAULT_LANG.po.such as"else{include_once(DEFAULT_LANG.".po";)}"

Second, in .../web/lib/translator.inc, between line 52 to line 62. The
reason is as the same as i said above. If we havn't set a $LANG var, the
$LANG will be set to DEFAULT_LANG. But the DEFAULT_LANG doesn't mean
english. Even the $LANG havn't been set, the $_t maybe setting (see  Firest
above) when include from DEFAULT_LANG.po. We should also translate them.
So i think we should remove the 'else' identify. make the 'else' branch work
for ever.

By the way if the function "include_lang()" in .../web/lib/translator.inc,
between line 32 to line 40 is an old function to make the lang func? Maybe
we should remove them.


I prepare to make a mirror for our AUR to chinese people, how could i got
the databases an files from aur.archlinux.org. OR i couldn't make a mirror
for that.

Your know as a chinese ,my english is very pool. If you guys don't know what
i say, welcome to send me a mail.

Athurg Gooth
-------------- next part --------------
A non-text attachment was scrubbed...
Name: default-language-setting.patch
Type: text/x-patch
Size: 1113 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/aur-dev/attachments/20091130/0c394112/attachment.bin>

More information about the aur-dev mailing list