r84020 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84019‎ | r84020 | r84021 >
Date:14:37, 15 March 2011
Author:purodha
Status:resolved (Comments)
Tags:
Comment:
Add language tagging of inner Babel boxes.
Modified paths:
  • /trunk/extensions/Babel/Babel.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Babel/Babel.class.php
@@ -190,7 +190,8 @@
191191 */
192192 protected static function mGenerateBox( $code, $level ) {
193193 $portal = wfMsgForContent( 'babel-portal', $code );
194 - $header = "[[$portal|" . wfBCP47( $code ) . "]]<span class=\"mw-babel-box-level-$level\">-$level</span>";
 194+ $lang = wfBCP47( $code );
 195+ $header = "[[$portal|" . $lang . "]]<span class=\"mw-babel-box-level-$level\">-$level</span>";
195196
196197 $name = BabelLanguageCodes::getName( $code );
197198 $code = BabelLanguageCodes::getCode( $code );
@@ -204,7 +205,7 @@
205206 <div class="mw-babel-box mw-babel-box-$level" dir="$dir_content">
206207 {| cellspacing="$cellspacing"
207208 ! dir="$dir_content" | $header
208 -| dir="$dir_current" | $text
 209+| dir="$dir_current" lang="$lang" xml:lang="$lang" | $text
209210 |}
210211 </div>
211212 EOT;

Follow-up revisions

RevisionCommit summaryAuthorDate
r97716Partial revert of r84020 - we should not tag language unless we are pretty mu...nikerabbit11:46, 21 September 2011

Comments

#Comment by Nikerabbit (talk | contribs)   15:42, 15 March 2011

The text is not necessarily in the same language what the box depicts.

#Comment by Purodha (talk | contribs)   03:03, 16 March 2011

This is a known deficiency - both lang= and dir= attribute values need to be fixed under certain conditions.

#Comment by Nikerabbit (talk | contribs)   08:03, 16 March 2011

I know, but I think that adding potentially wrong tagging is worse than no tagging.

#Comment by Purodha (talk | contribs)   08:36, 16 March 2011

Mediawiki is full of wrong tagging. "No tagging" was wrong tagging in HTML due to inheritance. Pages are always tagged as being in the wiki language. So the current tagging is much more often correct than ommitted tags were.

The current state is a beginning only. It will be more precise in the future.

Status & tagging log