Per Brions review on r45512. I need a bit more time to fix it.
&$result: Set this and return false to override the internal checks
$user: User the password is being validated for
-'LanguageGetLocalizedLanguageNames': Use to get localized language names
-&$languageNames: localized language names (array)
-$lang: laguage code (string)
-
'LanguageGetMagic': Use this to define synonyms of magic words depending of the language
$magicExtensions: associative array of magic words synonyms
$lang: laguage code (string)
if ( $nt ) {
$language_urls[] = array(
'href' => $nt->getFullURL(),
- 'text' => ( $wgContLang->getLanguageName( $nt->getInterwiki() ) != ''
- ? $wgContLang->getLanguageName( $nt->getInterwiki() )
- : $l ),
- 'class' => $class,
- 'title' => ( $wgLang->getLanguageNameLocalized( $nt->getInterwiki() ) != ''
- ? $wgLang->getLanguageNameLocalized( $nt->getInterwiki() )
- : $l )
+ 'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l),
+ 'class' => $class
);
}
}
class Language {
var $mConverter, $mVariants, $mCode, $mLoaded = false;
var $mMagicExtensions = array(), $mMagicHookDone = false;
- var $mLocalizedLanguagesNames = null;
static public $mLocalisationKeys = array(
'fallback', 'namespaceNames', 'mathNames', 'bookstoreList',
return $names;
}
- /**
- * Get localized language names
- *
- * @return array
- */
- function getLocalizedLanguageNames() {
- if( !is_array( $this->mLocalizedLanguagesNames ) ) {
- $this->mLocalizedLanguagesNames = array();
- wfRunHooks( 'LanguageGetLocalizedLanguageNames', array( &$this->mLocalizedLanguagesNames, $this->getCode() ) );
- }
- return $this->mLocalizedLanguagesNames;
- }
-
/**
* Get a message from the MediaWiki namespace.
*
return wfMsgExt( $msg, array( 'parsemag', 'language' => $this ) );
}
- /**
- * Get a language name
- *
- * @param $code String language code
- * @return $localized boolean gets the localized language name
- */
- function getLanguageName( $code, $localized = false ) {
+ function getLanguageName( $code ) {
$names = self::getLanguageNames();
if ( !array_key_exists( $code, $names ) ) {
return '';
}
- if( $localized ) {
- $languageNames = $this->getLocalizedLanguageNames();
- return isset( $languageNames[$code] ) ? $languageNames[$code] : $names[$code];
- } else {
- return $names[$code];
- }
- }
-
- function getLanguageNameLocalized( $code ) {
- return self::getLanguageName( $code, true );
+ return $names[$code];
}
function getMonthName( $key ) {
<h5><?php $this->msg('otherlanguages') ?></h5>
<div class="pBody">
<ul>
-<?php foreach($this->data['language_urls'] as $langlink) {
- // Add title tag only if differ from shown text
- $titleTag = $langlink['title'] == $langlink['text']
- ? ''
- : 'title="' . htmlspecialchars( $langlink['title'] ) . '"';
- ?>
+<?php foreach($this->data['language_urls'] as $langlink) { ?>
<li class="<?php echo htmlspecialchars($langlink['class'])?>"><?php
- ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"
- <? echo $titleTag ?> > <?php echo $langlink['text'] ?></a></li>
+ ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"><?php echo $langlink['text'] ?></a></li>
<?php } ?>
</ul>
</div><!-- pBody -->
<h5><?php $this->msg('otherlanguages') ?></h5>
<div class="pBody">
<ul>
-<?php foreach($this->data['language_urls'] as $langlink) {
- // Add title tag only if differ from shown text
- $titleTag = $langlink['title'] == $langlink['text']
- ? ''
- : 'title="' . htmlspecialchars( $langlink['title'] ) . '"';
- ?>
+<?php foreach($this->data['language_urls'] as $langlink) { ?>
<li class="<?php echo htmlspecialchars($langlink['class'])?>"><?php
- ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"
- <? echo $titleTag ?> > <?php echo $langlink['text'] ?></a></li>
+ ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"><?php echo $langlink['text'] ?></a></li>
<?php } ?>
</ul>
</div>