diff --git a/src/search.py b/src/search.py index 1dd13c6..3ed09af 100644 --- a/src/search.py +++ b/src/search.py @@ -102,6 +102,10 @@ def _get_search_terms(self, text): text = terms[1] else: text = '' + elif ':' in text: + for available_lang in languages.wikilangs.keys(): + if text.startswith(available_lang + ':'): + lang, text = text.split(':', 1) return text, lang # When search stoped with ESC hide suggestions diff --git a/src/wike-sp.in b/src/wike-sp.in index 004e199..e9f479f 100755 --- a/src/wike-sp.in +++ b/src/wike-sp.in @@ -83,6 +83,10 @@ class WikeSearchService: text = text.split(' ', 1)[1] else: text = '' + elif ':' in text: + for available_lang in languages.wikilangs.keys(): + if text.startswith(available_lang + ':'): + lang, text = text.split(':', 1) if len(text) > 2: if settings.get_boolean('search-desktop'):