For logged-in user the change of language lasts only for the current page. Display of next page brings the language back to the wiki language.
Is this intended behaviour?
2011-01-02: for w3c xhtml 1.0 validation, replace in LanguageSelector.php:
'id' => 'n-languageselector',
with:
'id' => 'n-languageselector-' . $ln,
Hello,
I have install this very interresting extension on my Wiki. And I wanted to use the value "LANGUAGE_SELECTOR_AS_PORTLET" for "$wgLanguageSelectorLocation" but it doesn't run. I use a Skin based on Monbook. Only values LANGUAGE_SELECTOR_AT_TOP_OF_TEXT and LANGUAGE_SELECTOR_IN_TOOLBOX can run on my Wiki. I don't know if I have to change some values on LanguageSelector.php?
(I'm sorry for my english, but I'm a french student!) Sébastien 14:22, 6 April 2007 (UTC)
// original version by hansm if( !wfRunHooks( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) { wfDebug( __METHOD__ . ': Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!' ); }
wfRunHooks( 'SkinTemplateOutputPageBeforeExec', array( $this, $tpl );
LANGUAGE_SELECTOR_INTO_TITLE does not work with MediaWiki 1.10alpha (r19865). It just displays the raw HTML data instead of the box itself. The source code of the page contains things like:
<span id="languageselector-box-1" class="languageselector " style="">
instead of
<span id="languageselector-box-1" class="languageselector " style="">
Please look into the page source in order to see the difference. ;-) I couldn't find out what is going wrong in the extensions. :-( Arnomane 18:06, 27 May 2007 (UTC)
Same problem happens with 1.11alpha (r22507) too (SVN checkout from today). So I guess it is not an incompatibility in an older MediaWiki version but a bug in the extension. Arnomane 14:18, 28 May 2007 (UTC)
Extension is broken, at least since r23511.
Invalid NULL return from broken hook wfLanguageSelectorSkinTemplateOutputPageBeforeExec
Backtrace:
LanguageSelector.php, line 215:
- return; + return true;
fixs this.
Hello, I think this extension is really good for my wiki. but, It doesn't work.
Here is the way i was installed.
1. copied languageselector.php to extentions/LanguageSelector/
2. add require_once( "$IP/extensions/LanguageSelector/LanguageSelector.php" ); to my localsetting.php
and I have some error messages above the wiki like,
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/webhost/hansco/public_html/wiki-en/extensions/LanguageSelector/LanguageSelector.php on line 82
Warning: Invalid argument supplied for foreach() in /home/webhost/hansco/public_html/wiki-en/extensions/LanguageSelector/LanguageSelector.php on line 290
Warning: Invalid argument supplied for foreach() in /home/webhost/hansco/public_html/wiki-en/extensions/LanguageSelector/LanguageSelector.php on line 339'
is there anyawy to make it work correctly?
I saw the way to configure the detail option about it.
but I don't know exactly how...
I thought I can use default setting (without any edit except add "require_once" line into Localsetting.php) ...
Is there any simple way to use this extension??
Sorry about my poor English..
Hi, great extension! It works fine for my wiki with the default settings (all languages, and at top of text) but when I try to make a shorter list (English and Spanish only) it says:
Warning: Invalid argument supplied for foreach() in /home/.munchie/mansalva/estigmergia.net/w/extensions/LanguageSelector.php on line 290
And the same for line 339
This happens when I've tried $wgLanguageSelectorLanguages = 'English','Spanish'; (and 'en','es';) but it doesn't work :(
Also, I wonder how to call the menu only when needed in the wiki: is it with LANGUAGE_SELECTOR_MANUAL ? What code would I have to write in the content of the page where I need it to appear? --Esenabre 23:39, 22 July 2007 (UTC)
Hello, with regards to the shorter list, I've managed to make it work by adding the following at the end of my LocalSettings.php. (Everything else is default installation - Only worked using monobook skin.)
$wgLanguageSelectorLocation = LANGUAGE_SELECTOR_IN_TOOLBOX;
$wgLanguageSelectorLanguages = array("en", "es", "fr");
--200.89.181.5 04:12, 2 August 2007 (UTC)
Is it possible to set "LANGUAGE_SELECTOR_AS_PORTLET" only for one page? Thank you, SPQRobin 13:21, 27 September 2007 (UTC)
I've got two problems with the LanguageSelector. It's a great extension, but I'm not sure what I'm doing wrong...
First I get the Error "Fatal error: Call to undefined function wfLoadExtensionMessages() in ...\extensions\LanguageSelector\LanguageSelector.php on line 82
I've downloaded the file "ExtensionFunctions.php" and copied it in my extensions-folder. Still the error. So I tried just to comment this line 82 out. Now the extension works pretty fine. Now I've got another problem, I has to click twice on the language to change it, oder reload after choosing a language. Is this the problem of the cache you indicated or is this because I uncommented line 82 or another problem? How can I make it working correctly?
Thanks for help, would be a great extension!
bluerouse
It seems that I have found a bug on LanguageSelector
When used with this browser settings: Accept-Language es,es-es;q=0.8,en;q=0.6,en-us;q=0.4,de;q=0.2 the webpage is shown in german instead of Spanish.
All the languages are enabled.
I was using a LanguageSelector downloaded from the bundle directory with this data: 03-Mar-2008 03:21 8.5K
adrian15
My problem is that the actual LanguageSelector does not translate its own interface.
For example, in portlet mode, the title above the portlet stays as "language", regardless of what language you set. And in dropdown-box mode, the set button still says "set".
The only time the LanguageSelector interface translates is if you use the "uselang=XX" in the address bar, or you are logged in.
So, apparently, MediaWiki hardcodes locales which do not have a value in MediaWiki: namespace.
Is there any fix for this? Perhaps making this into a MediaWiki: namespace page? Or maybe having this extension run before the hook is added?
I will experiment with this. If I find a fix I will post it here.
Thanks, Harold.
$wgLanguageSelectorLanguages=explode(" ", "de en fr be bs bg ca cy cs da es et eu el ga gd hr hu is it lv lt mk mo nl nn no pl pt ro ru sk fi sv tr uk");
well i want to inject this selector in personal bar on monobook skin.
simpliest way for it - set
$wgLanguageSelectorLocation = LANGUAGE_SELECTOR_MANUAL;
and after this text in monobook.php
<div class="portlet" id="p-personal"> <h5><?php $this->msg('personaltools') ?></h5> <div class="pBody"> <ul>
add
<?php echo wfLanguageSelectorHTML(); ?>
--Schthaxe 00:15, 7 February 2009 (UTC)
Pretty self explanatory, is there a way to inject the portlet above the search bar in the sidebar?
That would be awesome, because some of our users are... special.
This is a simple idea to get a custom translated sidebar. I don't know how to do it in another way, so I thinked to put a patch in includes/Skin.php.
With this patch, the sidebar source pages with translations are accessible at Mediawiki:Sidebar-LANG, where LANG=en,de,it,etc. The patch is tested in 1.15.1.
Apply patch: add the code in includes/Skin.php as shown below.
function buildSidebar() {
global $parserMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry;
global $wgLang;
wfProfileIn( __METHOD__ );
$key = wfMemcKey( 'sidebar', $wgLang->getCode() );
if ( $wgEnableSidebarCache ) {
$cachedsidebar = $parserMemc->get( $key );
if ( $cachedsidebar ) {
wfProfileOut( __METHOD__ );
return $cachedsidebar;
}
}
$bar = array();
//Insert patch here -->
$sidebar_name='sidebar' . '-' . $wgLang->getCode();
$sidebar_content = wfMsgForContent( $sidebar_name );
if ( wfEmptyMsg ( $sidebar_name, $sidebar_content) ) {
$sidebar_name='sidebar';
}
//End patch <--
$lines = explode( "\n", wfMsgForContent( $sidebar_name ) );
Custom translated sidebar? How it should perform? I havent figured out it.--Juan de Vojníkov 13:59, 4 July 2011 (UTC)
I've download the last version of this extension but it don't work with 1.18 in my wiki. I choose the language but it don't brings me to the pages with this language, only changes the interface texts. The wiki is in catalan (base language and /ca) and spanish (/es). I use also the last version of Plyglot, and the Vector skin. --Dvdgmz 12:27, 7 February 2012 (UTC)
I still have some bug with Monobook theme at least.
From line 237 of LanguageSelector.php there is an error $html = wfLanguageSelectorHTML( $skin->getTitle() ); Now if I change the code like this: $html = ""; //wfLanguageSelectorHTML( $skin->getTitle() ); The error is gone.
Error text says:
Fatal error: Call to undefined method MonoBookTemplate::getTitle() in /home/iocellco/public_html/iocellnetworks.com/manuals/extensions/LanguageSelector/LanguageSelector.php on line 237
I downloaded and overwrote both Polyglot and LanguageSelector version 18x from the extensions pages.
Product Version MediaWiki 1.18.0 PHP 5.2.17 (litespeed) MySQL 5.1.52-cll
$html = wfLanguageSelectorHTML( $skin->getTitle() );
global $wgTitle;
$html = wfLanguageSelectorHTML( $wgTitle );
I've copied files in extensions/LanguageSelector and included require_once( "$IP/extensions/LanguageSelector/LanguageSelector.php" ); in LocaleSettings.php, but it doesn't work. I got message Fatal error: Call to undefined method Language::fetchLanguageNames() in /var/www/wiki/extensions/LanguageSelector/LanguageSelector.php on line 127 Help please, I really need this extension!
How can I insert Language Selector into Personal_URL Bar? I tried this:
$wgLanguageSelectorLocation = LANGUAGE_SELECTOR_MANUAL; and after this text in vector.php
<div class="portlet" id="p-personal"> <h5><?php $this->msg('personaltools') ?></h5> <div class="pBody"> <ul>
add
<?php echo wfLanguageSelectorHTML(); ?>
But doesn't work. It said: Catchable fatal error: Argument 1 passed to wfLanguageSelectorHTML() must be an instance of Title, none given,
any suggestion?
thx!
<?php echo wfLanguageSelectorHTML( $this->getSkin()->getTitle() ); ?>
[SOLVED] Thx!! ULS is better, but annoymous user cannot change language yet.. :-(
$wgULSAnonCanChangeLanguage = true;
I have two languages (en and es) in Language Selector. 'en' appears as English but 'es' appears as español (without first capital letter). Where I can change it?
Thx!!
[SOLVED] Perfect!! I just rewrite the name in Names.php. Thx!!
The thing I most want to do is to permit anonymous users to see a different language (more below). The ULS documentation says that this isn't possible. However, documentation on this page (a couple of topics up) says explicitly that it is possible with ULS, and also with LanguageSelector. This is very confusing. Is one of these extensions preferred over the other?
My actual goal, which may not be possible, is to have the interface language for anonymous users depend on the domain of the URL used to access the wiki, at least for the home page. I'm hoping to do this via appropriate mod_rewrite rules once I know how to set the interface language for anonymous users. But even if this doesn't work out I'd like anonymous users to be able to set the language! Which extension should I use?
For logged-in user the change of language lasts only for the current page. Display of next page brings the language back to the wiki language.
Is this intended behaviour?
Sorry for the poor English, it is not my first language. As is, LanguageSelector doesn't automatically convert page contents to Chinese variants using the built-in ZhConversion.php. I added the following line below $user->setOption( 'language', $requestedLanguage );
in LanguageSelector.php:
$user->setOption( 'variant', $requestedLanguage );
Now the extension should convert the page content between Chinese variants, in addition to the UI elements. In theory it should also work for other languages with built-in language conversion.
Good day, I use {{#switch:{{int:Lang}}|en=blabla|fr=blabla}} to have the same page displays in the language chosen by the visitor. With &setlang=fr or en in the url, it works for log-in user. However, for visitor not logged in, even if they add &setlang=fr in the url, the page remains in English and only the title is in French. It had been tested on Google Chrome. And the tested page is http://wikimedia.ca/w/index.php?title=Projects/National_Contribution_Month&setlang=en or http://wikimedia.ca/w/index.php?title=Projets/Mois_national_de_la_contribution&setlang=fr. How come? Thanks,
setlang is a parameter used by certain extensions (Language Selector? maybe) where uselang is part of core
Possibly the language selector extension is configured to not work for anons to prevent issues with squid caching.
All I know is that their site did change the displayed page when I altered the URL to uselang instead of setlang.
Hmm, yeah. Something looks borked with that extension. Only about half the messages seem to change with setlang. I would guess that whatever hook Language selector extension is using to muck about with $wgLang is being called to late (or the extension only changes some of the RequestContext objects (not all) or something like that).
"setlang" is a URL parameter provided by Extension:UniversalLanguageSelector. In all wiki's hosted by Wikimedia Foundation, persistent language selection for anonymous users is disabled. This feature is enabled by default in ULS, but disabled in Wikimedia wikis because of worries about cache fragmentation. "uselang" is a URL parameter provided by core, that only works for a single page view.