diff --git a/ckan/lib/helpers.py b/ckan/lib/helpers.py index 64132e92562..a5ddf98d63a 100644 --- a/ckan/lib/helpers.py +++ b/ckan/lib/helpers.py @@ -357,6 +357,9 @@ def full_current_url(): for sharing etc ''' return (url_for(request.environ['CKAN_CURRENT_URL'], qualified=True)) +def current_url(): + ''' Returns current url unquoted''' + return urllib.unquote(request.environ['CKAN_CURRENT_URL']) def lang(): ''' Return the language code for the current locale eg `en` ''' @@ -2224,6 +2227,7 @@ def get_translated(data_dict, field): 'debug_inspect', 'dict_list_reduce', 'full_current_url', + 'current_url', 'popular', 'debug_full_info_as_list', 'get_facet_title', diff --git a/ckan/templates/snippets/language_selector.html b/ckan/templates/snippets/language_selector.html index dfe62c1686a..917833ab894 100644 --- a/ckan/templates/snippets/language_selector.html +++ b/ckan/templates/snippets/language_selector.html @@ -1,10 +1,9 @@ -{% set current_url = request.environ.CKAN_CURRENT_URL %} {% set current_lang = request.environ.CKAN_LANG %}