r52017 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52016‎ | r52017 | r52018 >
Date:04:26, 17 June 2009
Author:rememberthedot
Status:ok (Comments)
Tags:
Comment:
Follow-up to r49331: Moved decapitalization code to "a Messages*.php property, a <body>
class and a descendant selector, like we do for RTL", as requested by Tim Starling in r51924
Modified paths:
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesDe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesPdt.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesPfl.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)
  • /trunk/phase3/skins/monobook/main.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/monobook/main.css
@@ -884,53 +884,13 @@
885885 }
886886
887887 /* Override text-transform on languages where capitalization is significant */
888 -.portlet h5[lang|=bar],
889 -.portlet h6[lang|=bar],
890 -#p-personal ul[lang|=bar],
891 -#p-cactions ul[lang|=bar] li a,
892 -.portlet h5[lang|=de],
893 -.portlet h6[lang|=de],
894 -#p-personal ul[lang|=de],
895 -#p-cactions ul[lang|=de] li a,
896 -.portlet h5[lang|=gsw],
897 -.portlet h6[lang|=gsw],
898 -#p-personal ul[lang|=gsw],
899 -#p-cactions ul[lang|=gsw] li a,
900 -.portlet h5[lang|=ksh],
901 -.portlet h6[lang|=ksh],
902 -#p-personal ul[lang|=ksh],
903 -#p-cactions ul[lang|=ksh] li a,
904 -.portlet h5[lang|=lb],
905 -.portlet h6[lang|=lb],
906 -#p-personal ul[lang|=lb],
907 -#p-cactions ul[lang|=lb] li a,
908 -.portlet h5[lang|=nds],
909 -.portlet h6[lang|=nds],
910 -#p-personal ul[lang|=nds],
911 -#p-cactions ul[lang|=nds] li a,
912 -.portlet h5[lang|=pdc],
913 -.portlet h6[lang|=pdc],
914 -#p-personal ul[lang|=pdc],
915 -#p-cactions ul[lang|=pdc] li a,
916 -.portlet h5[lang|=pdt],
917 -.portlet h6[lang|=pdt],
918 -#p-personal ul[lang|=pdt],
919 -#p-cactions ul[lang|=pdt] li a
920 -.portlet h5[lang|=pfl],
921 -.portlet h6[lang|=pfl],
922 -#p-personal ul[lang|=pfl],
923 -#p-cactions ul[lang|=pfl] li a {
 888+.capitalize_all_nouns .portlet h5,
 889+.capitalize_all_nouns .portlet h6,
 890+.capitalize_all_nouns #p-personal ul,
 891+.capitalize_all_nouns #p-cactions ul li a {
924892 text-transform: none;
925893 }
926894
927 -/* What matches for nds must not match for nds-nl - bug 19209 */
928 -.portlet h5[lang|=nds-nl],
929 -.portlet h6[lang|=nds-nl],
930 -#p-personal ul[lang|=nds-nl],
931 -#p-cactions ul[lang|=nds-nl] li a {
932 - text-transform: lowercase;
933 -}
934 -
935895 /* TODO: #t-iscite is only used by the Cite extension, come up with some
936896 * system which allows extensions to add to this file on the fly
937897 */
Index: trunk/phase3/skins/MonoBook.php
@@ -109,7 +109,7 @@
110110 </head>
111111 <body<?php if($this->data['body_ondblclick']) { ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
112112 <?php if($this->data['body_onload']) { ?> onload="<?php $this->text('body_onload') ?>"<?php } ?>
113 - class="mediawiki <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
 113+ class="mediawiki <?php $this->text('dir'); $this->text('capitalizeallnouns') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
114114 <div id="globalWrapper">
115115 <div id="column-content">
116116 <div id="content">
Index: trunk/phase3/includes/SkinTemplate.php
@@ -270,6 +270,7 @@
271271 $tpl->setRef( 'lang', $wgContLanguageCode );
272272 $tpl->set( 'dir', $wgContLang->isRTL() ? 'rtl' : 'ltr' );
273273 $tpl->set( 'rtl', $wgContLang->isRTL() );
 274+ $tpl->set( 'capitalizeallnouns', $wgLang->capitalizeAllNouns() ? ' capitalize_all_nouns' : '' );
274275 $tpl->set( 'langname', $wgContLang->getLanguageName( $wgContLanguageCode ) );
275276 $tpl->set( 'showjumplinks', $wgUser->getOption( 'showjumplinks' ) );
276277 $tpl->set( 'username', $wgUser->isAnon() ? NULL : $this->username );
Index: trunk/phase3/languages/messages/MessagesPfl.php
@@ -11,6 +11,8 @@
1212 * @author SPS
1313 */
1414
 15+$fallback = 'de';
 16+
1517 $messages = array(
1618 'underline-always' => 'Immer',
1719 'underline-never' => 'Garnet',
Index: trunk/phase3/languages/messages/MessagesPdt.php
@@ -11,6 +11,8 @@
1212 * @author Wikipeeta
1313 */
1414
 15+$fallback = 'de';
 16+
1517 $messages = array(
1618 # User preference toggles
1719 'tog-underline' => 'Links unjastritje:',
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -29,6 +29,12 @@
3030 $rtl = false;
3131
3232 /**
 33+ * Should all nouns (not just proper ones) be capitalized?
 34+ * Enabling this property will add the capitalizeAllNouns class to the <body> tag
 35+ */
 36+$capitalizeAllNouns = false;
 37+
 38+/**
3339 * Optional array mapping ASCII digits 0-9 to local digits.
3440 */
3541 $digitTransformTable = null;
Index: trunk/phase3/languages/messages/MessagesDe.php
@@ -34,6 +34,8 @@
3535 * @author לערי ריינהארט
3636 */
3737
 38+$capitalizeAllNouns = true;
 39+
3840 $namespaceNames = array(
3941 NS_MEDIA => 'Media',
4042 NS_SPECIAL => 'Spezial',
Index: trunk/phase3/languages/Language.php
@@ -59,7 +59,7 @@
6060
6161 static public $mLocalisationKeys = array(
6262 'fallback', 'namespaceNames', 'mathNames', 'bookstoreList',
63 - 'magicWords', 'messages', 'rtl', 'digitTransformTable',
 63+ 'magicWords', 'messages', 'rtl', 'capitalizeAllNouns', 'digitTransformTable',
6464 'separatorTransformTable', 'fallback8bitEncoding', 'linkPrefixExtension',
6565 'defaultUserOptionOverrides', 'linkTrail', 'namespaceAliases',
6666 'dateFormats', 'datePreferences', 'datePreferenceMigrationMap',
@@ -1792,6 +1792,11 @@
17931793 return $this->isRTL() ? "\xE2\x80\x8F" : "\xE2\x80\x8E";
17941794 }
17951795
 1796+ function capitalizeAllNouns() {
 1797+ $this->load();
 1798+ return $this->capitalizeAllNouns;
 1799+ }
 1800+
17961801 /**
17971802 * An arrow, depending on the language direction
17981803 *
@@ -2482,7 +2487,7 @@
24832488 $cache = compact( self::$mLocalisationKeys );
24842489 wfDebug( "Language::loadLocalisation(): got localisation for $code from source\n" );
24852490 }
2486 -
 2491+
24872492 # Load magic word source file
24882493 global $IP;
24892494 $filename = "$IP/includes/MagicWord.php";

Follow-up revisions

RevisionCommit summaryAuthorDate
r52018Follow-up to r52017: corrected documentationrememberthedot04:28, 17 June 2009
r52029Fix for r52017: use hyphens not underscores in CSS classes.tstarling08:58, 17 June 2009
r52030Update $wgStyleVersion for r52017/r52029tstarling09:06, 17 June 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r49331(bug 1553) Lowercase navigation headings in Germanrememberthedot05:27, 9 April 2009
r51924(bug 19209) Follow-up to r49331: CSS for nds should not apply for nds-nl.siebrand20:37, 15 June 2009

Comments

#Comment by Nikerabbit (talk | contribs)   05:50, 17 June 2009
+ $tpl->set( 'capitalizeallnouns', $wgLang->capitalizeAllNouns() ? ' capitalize_all_nouns' :  );

Why underscores? Don't most of ids and classes use dash instead?

#Comment by Tim Starling (talk | contribs)   08:59, 17 June 2009

Done in r52029.

Status & tagging log