Last modified: 2014-03-10 01:51:19 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 T58920, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56920 - wgPageContentLanguage broken on Incubator, returns "en" always
wgPageContentLanguage broken on Incubator, returns "en" always
Status: RESOLVED WORKSFORME
Product: MediaWiki extensions
Classification: Unclassified
WikimediaIncubator (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-12 00:15 UTC by Yair Rand
Modified: 2014-03-10 01:51 UTC (History)
4 users (show)

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


Attachments

Description Yair Rand 2013-11-12 00:15:51 UTC
On Incubator, wgPageContentLanguage is no longer returning the language of the test project being viewed. Instead, it is always returning "en".
Comment 1 Yair Rand 2013-11-13 04:03:14 UTC
I'm not sure whether this was the case before, but right now it seems that it's only broken for languages not localized in Mediawiki. Other languages have wgPageContentLanguage set correctly.
Comment 2 Hydriz Scholz 2014-01-11 09:57:45 UTC
It seems to me that it is an intended behavior. If the language isn't localized in MediaWiki, MediaWiki doesn't know what the language is, it wouldn't be able to display wgPageContentLanguage correctly. Do correct me if I am wrong.
Comment 3 Aravind K N 2014-02-04 12:51:15 UTC
function testOnPageContentLanguage() {
		$title = Title::newFromText( 'Wp/nl/Test' );
		$this->assertEquals( $title->getPageLanguage()->getCode(), 'nl');
		$title = Title::newFromText( 'Template:Wp/be-tarask/Test' );
	  $this->assertEquals($title->getPageLanguage()->getCode()'betarask' );
		$title = Title::newFromText( 'Project:Wp/nl/Test' );
		$this->assertEquals( $title->getPageLanguage()->getCode(), 'en');
	}

Is it the last line which is creating the problem? This is on WikimediaIncubator/IncubatorUnitTests.php
Comment 4 Robin Pepermans (SPQRobin) 2014-03-10 01:51:19 UTC
(In reply to Aravind K N from comment #3)
> Is it the last line which is creating the problem? This is on
> WikimediaIncubator/IncubatorUnitTests.php

Those are unit tests, i.e. meant to test the actual code but is not part of the actual code so cannot create any problems.


(In reply to Hydriz Scholz from comment #2)
> It seems to me that it is an intended behavior. If the language isn't
> localized in MediaWiki, MediaWiki doesn't know what the language is, it
> wouldn't be able to display wgPageContentLanguage correctly. Do correct me
> if I am wrong.

Indeed, the code tries to make a language object for xyz in Wx/xyz/Title, but MediaWiki only does that if it recognizes the language. There is some inconsistency however, because the lang attribute in the mw-content-text div tag is always set to the language code. E.g. on Wp/grc the page content language is always "grc", but on e.g. Wp/lkt it's "en" except for the mentioned attribute (maybe more). Since we expect active languages to be localized, there "shouldn't" be any issue.

Closing as WORKSFORME, feel free to reopen if needed.

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


Navigation
Links