Extension talk:Polyglot

From MediaWiki.org
Jump to navigation Jump to search

Bug report[edit]

I tried to use your extension by creating a page XYZ/de in addition to a page called XYZ, and the link I get in the 'in other languages' is showing the text "De:XYZ/de", and points to the "De:XYZ/de" page, which obviously is wrong.

Note that I am using MW 1.9.2.


Yes, this will not work in 1.9; I'm overriding MediaWiki's default handling of interlanguage-links using a hook that doesn't yet exist in 1.9 -- Duesentrieb 20:32, 25 April 2007 (UTC)

Warning related to $wgPolyglotLanguages[edit]

Hi, the extension give me a Warning if $wgPolyglotLanguages=NULL (default setting). The warning is:

Warning:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in mywikipath/extensions/Polyglot/Polyglot.php  on line 80

Using MW 1.15.1 --Dvdgmz 09:12, 24 July 2009 (UTC)

So try $wgPolyglotLanguages=array() instead. --Eric Myers 14:59, 24 July 2009 (UTC)

Switching vom Events/de to Events/th[edit]

If I for example select a page "Events" with language "de" it is redirected to "Events/de" as expected, but if I than change the the language to "th" I expect to see page "Events/th", but that doesn't work. I have to return to "Events" to get "Events/th". Is it possible to automatically cut off the language code if it already exist to allow a switch from one language to another?

No, because that would make it impossible to look at, say, the th page when your interface is de. All pages must be accessible somehow to everyone, otherwise things get confusing, and hard to maintain. The "main" page basically serves as a magic redirect that simply "knows" where the user wants to go. Treat it like that and all should be fine. -- Duesentrieb 13:11, 8 June 2007 (UTC)
I made a patchfile, which tries to solve this thing. It relies on Extension:LanguageSelector, maybe another extension will solve this too. It detects a languagechange und removes the old language extension of the page. http://paste-it.net/public/v7b0a57/ (I know this is an old topic but I had the same problem) CKing --89.246.44.23 11:19, 2 November 2010 (UTC)

Display all possible Languages?[edit]

For a multi-language wiki with a limited number of available languages, it would be nice to have the language selector appear all the time, with all languages, non-exitant pages in red. This way we would know what articles in which language are still missing and could simply click the red link to create them.

To do this, modify polyglot.php as follows:

find

$links[$lang] = $t->getFullText();

and remove the if clause in front of it This does cancle the check for existing sites, all links to all possibly available languages are added.

ToDo[edit]

1 Missing languages are not yet displayed red:

'class' => 'new'

has to be added to the links, if

if (!$nt->exists())

2 All languages, including the main language are linked with /language to a subpage. Polyglot displays a link to Main_page/de and Main_Page/en on the main Page, even if Main_Page is english and no link to a sub-page is needed.

MediaWiki 1.12[edit]

To bring this to live in 1.12 you've to replace MWNAMESPACE by MAMESPACE (see http://www.mediawiki.org/wiki/Release_notes/1.13) --Venia 07:25, 11 February 2009 (UTC)

If you use the Version of Polyglot designated fopr 1.12, that should automatically be the case. Or did I get confused somewhere? -- 217.234.233.168 09:22, 11 February 2009 (UTC)
Ok, if I'd realized this it would work without a patch... --Venia 10:37, 11 February 2009 (UTC)

Transclusion[edit]

When transcluding the language is not taken in account.

If I have articles "page one" and "page one/en" each one with the contents for portuguese (original wiki language) and english (for our english speaker customers). And yes they both have the same name in portuguese and english so redirects will not solve this problem.

Then I have this article "all pages" which transcludes all the pages kinda like:

 ==Page one==
 {{:page one}}

 ==Page two==
 {{:page two}}

 and so on...
 

But when showing the page in english(the other language) the transcluded contents are the original(portuguese) ones, to have the page in english I would have to write the "all pages/en" with:

 ==Page one==
 {{:page one/en}}

 ==Page two==
 {{:page two/en}}

 and so on...
 

Is there another way? A flag or hack inside the extension code to handle transcluded article translation?

Rafael Vargas 14:27, 30 September 2009 (UTC)

Rafael, if you have ParserFunction installed and Subpages enabled you can try to do this:
 ==Page one==
{{#if:{{SUBPAGENAME}}|{{PAGENAME}}
 |{{:page one}}
 | {{#if:{{SUBPAGENAME}}|en
   |{{:page one/en}}
 }}
}}
Where you are making a transclusion or other depending on the subpagename of the page where your code is placed.
--Dvdgmz 07:55, 1 October 2009 (UTC)

mediawiki user language recognition[edit]

added some code so that it redirects the user based on its browsers language settings: http://thomasfischer.biz/?p=347

Title l10n[edit]

G'day, and thx a lot for this really useful extension. I have an issue with the title localisation: I have set up $wfPolyglotFollowRedirects, but I don't see any difference with a normal #redirect. My main wiki is in french, and I'd like to redirect Accueil/en to Main_Page, and when I'm in Main_Page, have an automatique link to the french page Accueil (and other languages if available). Is it possible ?
For the moment, I have a normal redirect: so I have an automatic link to Accueil/en wich redirect to Main_Page, but when I'm in Main_Page it's like a normal french article (i.e.: without automatic link to Accueil). Not sure to be clear enough ^^

Goffi 15:16, 10 December 2010 (UTC)

MediaWiki 1.17 using vector-Skin: Undefined index: title[edit]

I got a PHP Notice: Undefined index: title in mediawiki-1.17.0\skins\Vector.php on line 646 and added in the function wfPolyglotSkinTemplateOutputPageBeforeExec($skin, $tpl) in Polyglot.php:

		$language_urls[] = array(
			'href' => $nt->getFullURL(),
			'text' => $wgContLang->getLanguageName( $lang ),
			'class' => 'interwiki-' . $lang, // THE COMMATA IS ALREADY THERE
			'title' => $nt // THIS LINE IS NEW
                );
Yes, this line fixes the error message. --Fomafix 12:55, 24 August 2011 (UTC)
I reported this problem as bug 30545. --Fomafix 15:10, 24 August 2011 (UTC)

For 1.18 use the SVN version[edit]

Hi, Polyglot and LanguageSelector didn't work in my wiki after upgrading to MW 1.18. Downloading the last SVN version it works. Notice that the last snapshot it is older than the last SVN. To take the SVN write the follow in your command line terminal:

svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Polyglot/

--Dvdgmz 14:37, 7 February 2012 (UTC)

Does it allow dynamic redirects?[edit]

Will it allow me to create a dynamic redirect? Such as:

#REDIRECT [[User_talk:Technical_13/{{#time:Y|now -5 hours}}/{{#expr:ceil({{#time:n|now -5 hours}}/3)}}]]

To redirect the visitor to the correct section of my talk page (which I have decided to divide into quarters). -- ShoeMaker   ( Contributions Message )   17:11, 18 June 2012 (UTC)

Only in svn[edit]

It seems this extension is only in svn, and should not have git-links in the fact box, or am I missing somehitng? rotsee (talk) 16:49, 3 November 2012 (UTC)

I confirm. --Kipmaster (talk) 21:17, 19 December 2012 (UTC)
The extension is now available at git/gerrit. --Kip (talk) 13:53, 31 May 2013 (UTC)

How can we solve the issue with Multilang Deprecation?[edit]

Since Extension Multilang is deprecated how can we solve now the issue with template translations?