Extension talk:Multilang

works for 1.6.8 --M2mtech 18:51, 6 January 2007 (UTC)
 * First, sorry for my late answer. Nice to hear that it works as well on 1.6.8. (which I definitely also want to support, as not everyone wants or is able to switch to PHP 5). Can you have a look if the new (0.11) version also works on 1.6.8? Arnomane 01:45, 17 January 2007 (UTC)

Yes, works also with 1.6.9 --M2mtech 17:52, 5 February 2007 (UTC)

Broken download link
--195.177.247.202 13:58, 9 December 2008 (UTC) The download provided no longer works, is there another site where the files can be downloaded?
 * You may download form the SVN, link provided in extension's infobox--Venia 18:06, 19 March 2009 (UTC)

multilang breaks NOSECTIONEDIT magic word
To fix this we had to add the following line:

$parser->mOptions->mEditSection = false; --M2mtech 18:51, 6 January 2007 (UTC)


 * Hm I tried to reproduce it with MediaWiki pre-1.9 (SVN-version) and wasn't able triggering the behaviour that it breaks . Can you have a look if the bug is gone in multilang 0.11 with your MediaWiki version (I assume 1.6.8)? Arnomane 01:45, 17 January 2007 (UTC)
 * Ah now I got the trick how to reproduce it. You meant it breaks inside a multilang tag (I did place it outside the multilang on the same page in my first test), right? I will have to look what happens there. Atm I have no clue (and your fix would remove section edit on every multilang text). Hm can you give me an example when it is necessary to place   inside a multilang tag and not outside? Arnomane 01:56, 17 January 2007 (UTC)

Some further update: Multilang 0.11 does the following: If you place sections inside a multilang text and use the magic word like in the following code example it only makes no section edit for this multilanguage part but not on the entire page (so the last section in this example has section edit): @de|

test 1
blubb 1

test 2
blubb 2

test
foo This behaviour is due to the parser. The parser renders the text inside multilang completely independent from the text outside. So I don't see how I could avoid that. On the other hand I also like this behaviour with nested NOEDITSECTION a bit. So can you give me an example, which causes problems with that? Arnomane 02:17, 17 January 2007 (UTC)

Yes, we used 1.6.8 (now 1.6.9) ... and 0.11 did the trick! --M2mtech 17:52, 5 February 2007 (UTC)

manually switching languages
Q: First of all: Thanks a lot for this great extension; it's incredibly useful! However, there's one issue: I need to be able to manually switch between languages without much of a hassle. Is there an easy way to do that?

A: I just found out about the "uselang" URL parameter, so it could be done with a template like this:  [ English] | [ German] -- FND 07:31, 14 February 2007 (UTC)
 * Ups did forget to answer... Hm. Yea switching between displayed languages and expanding the whole thing to show all languages (without chaning the interface language itsef) would be cool. I'll write a TODO-List and hopefully (after a long time) will code again a bit on Multilang. Arnomane 12:47, 27 May 2007 (UTC)

ISO 639-3
would be nice if ISO 639-3 codes could be used and internally matched with the RFC 4646 or RFC 3066 codes or whichever system mediawiki uses. Tobias Conradi 01:16, 13 February 2007 (UTC)
 * Hm current MediaWiki uses ISO 639-1 for languages (with some ad-hoc extensions), see Names.php. ISO 639-3 would be much better in the long run but I want to avoid maintaining myself a match table against the MediaWiki list. However the people of http://omegawiki.org use a MediaWiki branch that uses ISO 639-3. Maybe it would be possible borrowing something from there.
 * However a more important thing related to that is currently on my table: Multilang does not check itself the single "@language" sections if they contain a valid language code. I thought about checking the language sections against the code list and throwing a parser error in case of an invalid language code. That way people could quickly notice typos. Arnomane 21:24, 17 February 2007 (UTC)

Multilang in Sidebar
Is it possible to use tag in the Sidebar in order to have different navigation possibilities for each language? Sébastien 12:49, 10 April 2007 (UTC)
 * No this does not work and Multilang itself can't change that. MediaWiki does not respect any syntax beside * and | on MediaWiki:Sidebar. The I18n of the Sidebar is sadly very confusing and the link target selection "algorithm" at multilingual wikis also has some bugs, see 8188. Arnomane 13:07, 27 May 2007 (UTC) Arnomane 13:07, 27 May 2007 (UTC)

Problem with multilang extension
I have a little bug with this extension, a border appear above the chosen text. Example: @fr|bonjour @en|hello @de|guten morgen Have you a solution to do disappear this border Thanks for answer. Toine6654 14:32, 9 August 2007 (UTC)
 * Hm strange this should not happen. I can't reproduce this myself. :-( It looks as if there is somewhere a hidden " " (whitespace) at the beginning of a line. Can you give me a link to your wiki, so that I can have a look at the page in order to isolate the problem and hopefully fix it? Arnomane 21:47, 9 August 2007 (UTC)

Hello, Thanks for your answer. I can't give a link with my wiki, because it is in localhost. There is no " " at the beginning of the line, I verified before to ask my question. I use mediawiki 1.9.3, maybe it is a bad version. the mistake is isolate in the line "$output=$parser($rawtext, $parser->mTitle, $parser->mOptions, true, false);" in the if condition "if (strpos($match[0][$j][0],$userlanguages[$i]) != FALSE)", because if I put this line in comment, the border disappear, but the language display is the default language (normal). Have I need a special extension for work the multilang? Thanks for help. Toine6654 11:59, 10 August 2007 (UTC)
 * Well "$output=$parser($rawtext, $parser->mTitle, $parser->mOptions, true, false);" just renders the text and inserts it into the rest of the page. The error must have happened previous to that. I have used this extension myself on 1.8 up to pre1.11 so it should work with your version to. Can you have a look if the bug disappears with 1.10? Multilang itself does not need any other extension. So sorry that I can't help you more at the moment because I have simply no idea what is going wrong there at your wiki (maybe a strange off-by-one in the three lines after the comment "// cutting out the wanted section"). :-( Arnomane 21:36, 10 August 2007 (UTC)

Ok Thanks for your help!!! I will try this extension in ohters version fo mediawiki, and I tell you the result. Toine6654 07:10, 13 August 2007 (UTC)

All right, I find the mistake. If I use the multilang extension with the AddButtonExtension, the border appear, if you don't have the AddButtonExtension, the border disappear. Your extension don't work if you install AddButtonExtension. Toine6654 09:20, 13 August 2007 (UTC)

multilang extension problem in long pages
I have a page that I must create in English and in French. I have the multilang extension installed on a MediaWiki 1.10. It runs on a Windows 2003 Server with Apache and PHP 5. I tried opening the multilang tag, then inserting the @en| markup before my English text. Then a few paragraphs down I would use the @fr| markup and insert my French text to finally close the multilang tag. When I try to toggle the page to French, the text is still in English. The other problem I ran into was because my page started with a == Level 2 header == and that confused the table of content (ToC) displayed at the top of my page.

I then tried to do one paragraph in English followed by the same paragraph in French and did this for only the first 2 paragraphs. Those first 2 paragraphs ended up showing above my ToC for some reason.

I did create a very simple one-paragraph English and one-paragraph French and it works great...???

Help?
 * Hm well this extension was meant for short multilingual text, especially for templates. So at first I recommend using Extension:Polyglot (which does and will probably never correctly work for templates out of several technical reasons) for this use case.
 * But back to your problem: How did you toggle the language? Currently multilang has no direct toggle feature itself (I'd love if someone can code that). Did you toggle the language by changing the interface language (either via preferences oder via ?uselang= variable in the URL)? If so it may can happen that there is a caching issue. Press Contrl Shift R and if this does not help add ?action=purge (serverside cache refresh) in the URL and press return. How was the TOC confused? It should make everytime a correct TOC (only counting the paragraphs of the current language displayed plus general text outside the multilang tags). Arnomane 11:53, 3 September 2007 (UTC)

Different Approach: Using a template
I did not get this extension running on MW 1.12/1.13. So I deciced to use a template instead, may be of use for others. Wow, just in time, thanks! I was testing this extension yesterday in MW 1.13.2 and it didn't work for me either (no text is output). I was considering a template equivalent when I saw your suggestion here (which, by the way, is quite shorter than the one I imagined :) --Capmo 16:07, 26 March 2009 (UTC)

tag
Is there any fix for this extension to work in the newer versions of MW? Also, does anyone know why it creates a tag and when it should be used? Thanks --Capmo 16:07, 26 March 2009 (UTC)

Extended functionality
Firstly, thank you for this extension. It seems to do (almost) exactly what I was looking to achieve. I have made one relatively small tweak to the code which, i think, makes the extension even more usable. I've actually incorporated the suggestion from above on adding the  section for language selector into the extension itself. Now, the language selector is automatically generated based on the presence of tags. You can see an example at http://docs.unity-linux.org/Unity_Officers. Please let me know if you'd like me to share the code. I think this would be a great addition for upstream releases. --Gri6507 16:03, 31 March 2010 (UTC)