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 ) );