Bugs item #3266874, was opened at 2011-04-01 02:09
Message generated for change (Comment added) made by i18ner
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3266874&group_id=191583
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Vacation
Group: v2.3.2
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Gabriele Vivinetto (gabrielev)
Assigned to: Nobody/Anonymous (nobody)
Summary: Translation is not applied in squirrelmail plugin options
Initial Comment:
Althoug the mo files are generated via build.sh, and the main options menu items are translated, in wvry plugin options page, language is resetted to English
----------------------------------------------------------------------
Comment By: I18N (i18ner)
Date: 2013-01-15 20:00
Message:
I of course meant to say "In common.php, comment out the line that calls
include_if_exists()".
----------------------------------------------------------------------
Comment By: I18N (i18ner)
Date: 2013-01-15 19:56
Message:
I can reproduce this bug in FreeBSD 9.1-RELEASE using the latest ports;
squirrelmail 1.4.22 and squirrelmail-postfixadmin-plugin (2.3.0).
The steps to reproduce are:
1. Set your browser's preffered language to en_US.
2. Set the default squirrelmail language to something other than en_US and
make sure it's supported by both squirrelmail and the postfix
squirrelmail-plugin.
3. Open squirrelmail and look at the main options menu, try to set up
forwarding/vacation/password. Compare with the screenshots.
Technical conclusions (I'm a php noob, please bear with me):
This is a problem with dependencies and scope in the function
include_if_exists() in functions.inc.php that is being called around line
13 in common.php with the parameter "SM_PATH . 'include/validate.php'".
Validate.php depends on "SM_PATH . 'functions/i18n.php'", which has an
undocumented dependency on the global variable
$squirrelmail_default_language (declared in "SM_PATH . 'config/config.php'
) inside the set_up_language() function. This variable is not in the scope
of include_if_exists(), which will cause it to appear as empty when
set_up_language() is called.
When set_up_language() doesn't see the default language, it will try to get
the preferred language from the HTTP_ACCEPT_LANGUAGE header instead. That
is fine and explained in the squirrelmail documentation. However, our
browser is set to en_US and squirrelmail is set to something different,
hence we get this bug.
NOTE: In the plugin's common.php, there's a conditional statement after the
call to include_if_exists(), which will make no difference, due to the
static variable $Setup_Already, declared in set_up_language().
How to fix:
In common.php, uncomment the line that calls include_if_exists(). The
conditional statement which follows it will make sure that validate.php is
included in the global scope.
To make things as clear as possible, here's some diff output.
Common.php.old is identical to the latest common.php.
--- common.php.old 2013-01-14 03:02:33.000000000 +0100
+++ common.php.new 2013-01-14 03:01:52.000000000 +0100
@@ -10,7 +10,7 @@
}
include_once(SM_PATH . 'plugins/postfixadmin/config.php');
include_once(SM_PATH . 'plugins/postfixadmin/functions.inc.php');
-include_if_exists(SM_PATH . 'include/validate.php');
+//include_if_exists(SM_PATH . 'include/validate.php');
if (file_exists(SM_PATH . 'include/validate.php'))
{
include_once(SM_PATH . 'include/validate.php');
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3266874&group_id=191583
|