Topic on Extension talk:Translate

Does $wgPageLanguageUseDB has any effect? (page language different from $wgLanguageCode)

Summary last edited by Andreas Plank 20:43, 11 November 2016 6 years ago

$wgPageLanguageUseDB does not work as expected in 1.26.

Fixed in 1.27, related to

Andreas Plank (talkcontribs)

I use extension:Translate 2016.01 and MediaWiki 1.26.2 and set $wgPageLanguageUseDB=true;. My wiki is in German ($wgLanguageCode=de;) and I saved a page in Russian, then I changed page language via special page of page information to Russian and so far everything appears OK. But after processing the page into the translation system the translation system regards the page still as being German an not Russian although page information reports the page to be Russian. Somewhere seems a bug to me.

Does extension:translate takes into account a different page language (when enabled via $wgPageLanguageUseDB)? Or has it any effect to the translation system? I perceive no effect whatsoever except that the page info lists it as a different language.

What can I do to force the translation system to take the page language into account?

Nikerabbit (talkcontribs)

I have vague memory that Title::getPageLanguage had a bug that is fixed in master. I'll try to test this later and update with details. Possible workaround is to use the PageContentLanguage hook.

Mboisson (talkcontribs)

Any news on this ? I'm looking to make a wiki in which source language of pages can vary. I can't figure out how to use the PageContentLanguage hook, and wgPageLanguageUseDB does not seem to work as it should... 

Do we know if it is fixed in 1.27 ?

Andreas Plank (talkcontribs)

Yes it is fixed with 1.27, but I can't remember where and when I confirmed this. I thought I had a Github- or phabricator-Bug-discussion with Nikerabbit, but I can't find it. Nevertheless I use MW 1.27.1 and it works now: switch the page language first (at link page information) and then the translation works as expected for that particular page language to be the original language.

Mboisson (talkcontribs)

Thank you. I have tested it on our development server (which runs 1.27.1). I guess we now have a reason to upgrade from 1.26 to 1.27.1.