def split_locale_from_request(self, request): if localeurl.settings.URL_TYPE == 'domain': raise AssertionError("URL_TYPE 'domain' not yet supported") elif localeurl.settings.URL_TYPE == 'domain_component': locale, _ = utils.strip_domain(request.get_host()) path_info = request.path_info else: locale, path_info = utils.strip_path(request.path_info) return locale, path_info
def split_locale_from_request(self, request): if localeurl.settings.URL_TYPE == 'domain': raise AssertionError("URL_TYPE 'domain' not yet supported") elif localeurl.settings.URL_TYPE == 'domain_component': locale, _ = utils.strip_domain(request.get_host()) path_info = request.path_info else: locale, path_info = utils.strip_path(request.path_info) """ If no locale returned from path get next best from request """ if not locale: locale = translation.get_language_from_request(request) return locale, path_info