Skip to content

Commit

Permalink
fix for 0004528: [localization] Error on logout page with language=auto
Browse files Browse the repository at this point in the history
added admin check for $g_fallback_language not 'auto'


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2980 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
thraxisp committed Sep 22, 2004
1 parent ff681bd commit 489be95
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
14 changes: 13 additions & 1 deletion admin/check.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: check.php,v 1.13 2004-09-06 00:33:38 thraxisp Exp $
# $Id: check.php,v 1.14 2004-09-22 17:49:18 thraxisp Exp $
# --------------------------------------------------------
?>
<?php
Expand Down Expand Up @@ -289,6 +289,18 @@ function test_bug_attachments_allow_flags()
}
?>
</tr>
<tr>
<td bgcolor="#ffffff">
check language configuration: fallback_language &lt;&gt; 'auto' </>
</td>
<?php
if ( 'auto' == config_get( 'fallback_language' ) ) {
print_test_result( BAD );
} else {
print_test_result( GOOD );
}
?>
</tr>

</table>

Expand Down
12 changes: 7 additions & 5 deletions core/lang_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: lang_api.php,v 1.32 2004-08-31 15:22:30 thraxisp Exp $
# $Id: lang_api.php,v 1.33 2004-09-22 17:49:18 thraxisp Exp $
# --------------------------------------------------------

### Language (Internationalization) API ##
Expand Down Expand Up @@ -65,15 +65,15 @@ function lang_get_default() {
$t_lang = user_pref_get_language( auth_get_current_user_id() );
}

if ( 'auto' == $t_lang ) {
$t_lang = lang_map_auto();
}

# Otherwise fall back to default
if ( false === $t_lang ) {
$t_lang = config_get( 'default_language' );
}

if ( 'auto' == $t_lang ) {
$t_lang = lang_map_auto();
}

# Remember the language
$g_active_language = $t_lang;

Expand Down Expand Up @@ -205,6 +205,8 @@ function lang_get( $p_string, $p_lang = null ) {
# because we don't have a concept of falling back on a language. The
# language files actually *contain* English strings if none has been
# defined in the correct language
# @@@ thraxisp - not sure if this is still true. Strings from last language loaded
# may still be in memeory if a new language is loaded.

if ( lang_exists( $p_string, $t_lang ) ) {
return $g_lang_strings[ $t_lang ][ $p_string];
Expand Down
4 changes: 4 additions & 0 deletions doc/ChangeLog
Expand Up @@ -2,6 +2,7 @@ Mantis ChangeLog

2004.10.xx - 0.19.1

- 0004528: [localization] Error on logout page with language=auto (thraxisp)
- 0004393: [feature] Version should be add with advanced options (bpfennig)
- 0004363: [bugtracker] "Add user to project" should have an additional button (bpfennig)
- 0004377: [bugtracker] $g_bug_submit_status should depends on user level (bpfennig)
Expand All @@ -18,6 +19,9 @@ Mantis ChangeLog
- 0004383: [localization] Editing a note has language specific note at end of note (bpfennig)
- 0004526: [other] Spaces needed after colons on main page (vboctor)
- 0004558: [custom fields] Custom Fields doesn't display links (bpfennig)
- New Config: $g_display_errors - controlls error handler display
- Removed config option ($g_show_notices, $g_show_warnings): subsumed into $g_display_errors

Updated Norwegian, Serbian, Chinese Simplified and Estonian translations

2004.09.12 - 0.19.0
Expand Down

0 comments on commit 489be95

Please sign in to comment.