Last modified: 2006-11-18 18:46:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T9972, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 7972 - Language.php $fallback overridden without warning, comment
Language.php $fallback overridden without warning, comment
Product: MediaWiki
Classification: Unclassified
Documentation (Other open bugs)
All All
: Normal trivial (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch
Depends on:
  Show dependency treegraph
Reported: 2006-11-18 18:41 UTC by Edward Z. Yang
Modified: 2006-11-18 18:46 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

Adds a short comment explaining the bheavior (409 bytes, patch)
2006-11-18 18:42 UTC, Edward Z. Yang
Fixes it without nuking tabs (354 bytes, patch)
2006-11-18 18:44 UTC, Edward Z. Yang

Description Edward Z. Yang 2006-11-18 18:41:29 UTC
I was puzzling over this segment of code for some time:

if ( $code != 'en' ) {
  $fallback = 'en';
} else {
  $fallback = false;

...wondering: "Hmm... doesn't that mean that English is the only possible
fallback language?" After all, looking at the immediately following code,
$fallback was not every set to a different value.

Then, it hit me: "Of course! This include did it:

  require( $filename );

$fallback was a variable in the actual file, so 'en' would get nicely
overwritten if necessary.

So... perhaps a short comment would help elucidate the meaning of that block for
anyone else who might have gotten confused. Patch coming.
Comment 1 Edward Z. Yang 2006-11-18 18:42:21 UTC
Created attachment 2733 [details]
Adds a short comment explaining the bheavior

Adds the comment "Default fallback, may be overridden when we include the
messages file" to the code in question.
Comment 2 Edward Z. Yang 2006-11-18 18:44:20 UTC
Created attachment 2734 [details]
Fixes it without nuking tabs

Whoops, murdered a few tabs. New and improved patch.
Comment 3 Rotem Liss 2006-11-18 18:46:18 UTC
Added in r17791.

Note You need to log in before you can comment on or make changes to this bug.