r107063 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107062‎ | r107063 | r107064 >
Date:13:02, 22 December 2011
Author:robin
Status:ok (Comments)
Tags:
Comment:
Include page content language so their fonts show up in the menu, per e-mail with Gerard and Santhosh.
Modified paths:
  • /trunk/extensions/WebFonts/resources/ext.webfonts.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WebFonts/resources/ext.webfonts.js
@@ -179,7 +179,8 @@
180180
181181 var fonts = [],
182182 languages = mw.webfonts.config.languages,
183 - requested = [mw.config.get( 'wgUserVariant' ), mw.config.get( 'wgContentLanguage' ), mw.config.get( 'wgUserLanguage' )],
 183+ requested = [mw.config.get( 'wgUserVariant' ), mw.config.get( 'wgContentLanguage' ),
 184+ mw.config.get( 'wgUserLanguage' ), mw.config.get( 'wgPageContentLanguage' )],
184185 i, j;
185186
186187 for ( i = 0; i < requested.length; i++ ) {
@@ -229,7 +230,8 @@
230231 */
231232 loadFontsForLangAttr: function() {
232233 var languages = mw.webfonts.config.languages;
233 - var requested = [mw.config.get( 'wgUserVariant' ), mw.config.get( 'wgContentLanguage' ), mw.config.get( 'wgUserLanguage' )];
 234+ var requested = [mw.config.get( 'wgUserVariant' ), mw.config.get( 'wgContentLanguage' ),
 235+ mw.config.get( 'wgUserLanguage' ), mw.config.get( 'wgPageContentLanguage' )];
234236 var fontFamily = false;
235237 // If there are tags with lang attribute,
236238 $( 'body' ).find( '*[lang]' ).each( function( i, el) {

Sign-offs

UserFlagDate
Nikerabbitinspected14:10, 22 December 2011

Comments

#Comment by SPQRobin (talk | contribs)   13:06, 22 December 2011

If it is deployed to 1.18wmf1, it needs the javascript variable wgPageContentLanguage which I added in r104483 (in a larger commit).

#Comment by Nikerabbit (talk | contribs)   13:09, 22 December 2011

Does it degrade gracefully if the config is not set? mw.config.get returns null in that case.

#Comment by SPQRobin (talk | contribs)   13:12, 22 December 2011

Yes, it seems to work correctly without wgPageContentLanguage.

Status & tagging log