diff --git a/UniversalLanguageSelector.hooks.php b/UniversalLanguageSelector.hooks.php index 367dadaa..4eee8173 100644 --- a/UniversalLanguageSelector.hooks.php +++ b/UniversalLanguageSelector.hooks.php @@ -508,7 +508,8 @@ class UniversalLanguageSelectorHooks { ], 'messages' => [ 'ext-uls-compact-link-count', - 'ext-uls-compact-link-info' + 'ext-uls-compact-link-info', + 'ext-uls-compact-no-results' ], 'localBasePath' => __DIR__ . '/resources', 'remoteExtPath' => 'UniversalLanguageSelector/resources' diff --git a/i18n/en.json b/i18n/en.json index f8b79b26..b0a7346f 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -63,5 +63,6 @@ "ext-uls-compact-link-count": "{{PLURAL:$1|One more|$1 more}}", "ext-uls-compact-link-info": "All languages (initial selection from common choices by you and others)", "prefs-languages": "Languages", - "ext-uls-compact-language-links-preference": "Use a [[$1|compact language list]], with languages relevant to you." + "ext-uls-compact-language-links-preference": "Use a [[$1|compact language list]], with languages relevant to you.", + "ext-uls-compact-no-results": "This page is not available in the language you searched for." } diff --git a/i18n/qqq.json b/i18n/qqq.json index 1d81bae3..ae59bddd 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -67,5 +67,6 @@ "ext-uls-compact-link-count": "Message next to the list of languages which indicates that there are more languages than the ones shown. Parameter $1 is the number of languages.\n\nIf your language has a singular form for number 1, then the number should be explicitly mentioned. If it's possible in your language, please write \"1 more\" or \"one more\". Another option is to write \"more\" in a way that doesn't depend on a particular number.", "ext-uls-compact-link-info": "A tooltip for a button that shows all available languages next to a short list of relevant languages.", "prefs-languages": "Field set legend for user preferences regarding display of language lists\n{{Identical|Language}}", - "ext-uls-compact-language-links-preference": "Label for compact language links user preference" + "ext-uls-compact-language-links-preference": "Label for compact language links user preference", + "ext-uls-compact-no-results": "Message shown when the language search does not have any results." } diff --git a/resources/js/ext.uls.compactlinks.js b/resources/js/ext.uls.compactlinks.js index 5391ed09..d3edf7b7 100644 --- a/resources/js/ext.uls.compactlinks.js +++ b/resources/js/ext.uls.compactlinks.js @@ -191,7 +191,15 @@ }, languages: ulsLanguageList, // Show common languages - quickList: self.getCommonLanguages( languages ) + quickList: self.getCommonLanguages( languages ), + noResultsTemplate: function () { + var $defaultTemplate = $.proxy( $.fn.lcd.defaults.noResultsTemplate, this )(); + // Customize the message + $defaultTemplate + .find( '.uls-no-results-found-title' ) + .text( mw.msg( 'ext-uls-compact-no-results' ) ); + return $defaultTemplate; + } } ); };