From 8b46d34004aef51932ede6f3ed7195fe3c4717e8 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Tue, 21 May 2013 17:33:10 +0530 Subject: [PATCH] Allow ULS language settings accessed from user preference screen. Adds a link in 'personal/i18n' section of user preferences Bug: 47240 Change-Id: I04d1ea7d36db45f9a0af04e11dade9ae0b524e8e --- UniversalLanguageSelector.hooks.php | 10 ++++++++++ i18n/en.json | 3 ++- i18n/qqq.json | 1 + resources/js/ext.uls.interface.js | 13 +++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/UniversalLanguageSelector.hooks.php b/UniversalLanguageSelector.hooks.php index 5660f0b0..132d046b 100644 --- a/UniversalLanguageSelector.hooks.php +++ b/UniversalLanguageSelector.hooks.php @@ -308,6 +308,16 @@ class UniversalLanguageSelectorHooks { 'type' => 'api', ); + // A link shown for accessing ULS language settings from preferences screen + $preferences['languagesettings'] = array( + 'type' => 'info', + 'raw' => true, + 'section' => 'personal/i18n', + 'default' => "", + // The above link will have text set from javascript. Just to avoid + // showing the link when javascript is disabled. + ); + return true; } diff --git a/i18n/en.json b/i18n/en.json index feb91264..08fac1d6 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -46,5 +46,6 @@ "ext-uls-input-disable-notification": "Input tools have been disabled", "ext-uls-input-disable-notification-undo": "Undo", "ext-uls-input-disable-notification-info-personal": "You can enable the input tools at any time from the language settings.", -"ext-uls-input-disable-notification-info-interlanguage": "You can enable the input tools at any time from the language settings next to the language list." +"ext-uls-input-disable-notification-info-interlanguage": "You can enable the input tools at any time from the language settings next to the language list.", +"ext-uls-language-settings-preferences-link": "More language settings" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 1ca947ad..afba5afc 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -52,4 +52,5 @@ "ext-uls-input-disable-notification-undo": "Undo link text in the input method disable notification bubble", "ext-uls-input-disable-notification-info-personal": "Notification bubble text when input methods are disabled, appears if the ULS is at personal toolbar", "ext-uls-input-disable-notification-info-interlanguage": "Notification bubble text when input methods are disabled, appears if the ULS is at interlanguage toolbar", + "ext-uls-language-settings-preferences-link": "Text for the link showin in user preference screen" } diff --git a/resources/js/ext.uls.interface.js b/resources/js/ext.uls.interface.js index 7516a952..616eb35f 100644 --- a/resources/js/ext.uls.interface.js +++ b/resources/js/ext.uls.interface.js @@ -248,6 +248,7 @@ } } } + // ULS options that are common to all modes of showing ulsOptions = { onReady: function () { @@ -289,6 +290,18 @@ $ulsTrigger.uls( ulsOptions ); } + // Bind language settings to preferences page link + $( '#uls-preferences-link' ) + .text( $.i18n( 'ext-uls-language-settings-preferences-link' ) ) + .click( function () { + if ( $ulsTrigger.length ) { + $ulsTrigger.click(); + } else { + $( '.uls-settings-trigger' ).click(); + } + return false; + } ); + showULSTooltip(); } ); }( jQuery, mediaWiki ) );