View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0010118 | mantisbt | documentation | public | 2009-02-06 08:25 | 2014-09-23 18:05 |
Reporter | phu | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | PC/XAMPP | OS | WinNT | ||
Product Version | 1.2.0a3 | ||||
Target Version | 1.2.15 | Fixed in Version | 1.2.15 | ||
Summary | 0010118: lang_get_current() returns wrong language if $g_default_language overwritten | ||||
Description | having the configuration in config_inc.php: $g_default_language = 'german'; and set the personal language of my account to 'english' still causes the function lang_get_current() to return 'german' while evaluated in custom_strings_inc.php when uncommented $g_default_language = 'german'; in config_inc.php it works fine. | ||||
Tags | No tags attached. | ||||
Can you please describe a scenario in more detail? I am having trouble following the actual consequences of the bug you are reporting. |
|
I'm experiencing the same issue. Here's a (lengthy) account of what happened for me:
<?php Everything worked fine under this setup.
I have tried to locate where the error lies, and it seems that when lang_get_current() is evaluated in custom_strings_inc.php, it returns 'french' instead of 'english' for English-speaking users (just as phu reported).
This snipped returns the correct language most of the time, but in this particular issue, it fails to return 'english' when evaluating the current language in custom_strings_inc.php. The default language ('french') is then chosen as a fallback, causing the custom fields to be translated into the wrong language. |
|
I have the same problem with 1.2.8 I think. Will test the issue with 1.2.10 and post again, if problem still exists. |
|
The problem is caused by using an incorrect method to determine the current language in custom_strings_inc.php. The example in the MantisBT documentation advised to use lang_get_current() to determine the current language, but this function resets the active language, and therefore returns an incorrect value when the default language ($g_default_language) is different from English. The proper method is to use the global variable $g_active_language, as per the example below:
The documentation has been updated accordingly. |
|
Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch |
|
MantisBT: master-1.2.x 4490a54b 2013-02-06 11:24 Details Diff |
Documentation: custom fields localization The indications in the Custom Fields localization section contained an incorrect reference to lang_get_current() to determine the current language in custom_strings_inc.php. Using this function will cause the code to return incorrect translations if the default language is different from English. Fixes 0010118 |
Affected Issues 0010118 |
|
mod - docbook/administration_guide/en/customizing_mantis.sgml | Diff File | ||
MantisBT: master da3362de 2013-02-06 11:24 Details Diff |
Documentation: custom fields localization The indications in the Custom Fields localization section contained an incorrect reference to lang_get_current() to determine the current language in custom_strings_inc.php. Using this function will cause the code to return incorrect translations if the default language is different from English. Fixes 0010118 |
Affected Issues 0010118 |
|
mod - docbook/Admin_Guide/en-US/Customizing.xml | Diff File |