diff --git a/bedrock/base/templates/includes/canonical-url.html b/bedrock/base/templates/includes/canonical-url.html index 52543fbcd47..23184079041 100644 --- a/bedrock/base/templates/includes/canonical-url.html +++ b/bedrock/base/templates/includes/canonical-url.html @@ -4,10 +4,12 @@ file, You can obtain one at https://mozilla.org/MPL/2.0/. #} +{%- set available_languages = get_locale_options(request, translations) -%} + - {% if translations -%} - {%- for code, label in translations|dictsort -%} + {% if available_languages -%} + {%- for code, label in available_languages|dictsort -%} {%- set alt_url = alternate_url(canonical_path, code) -%} {%- if alt_url -%} {%- set loop_canonical_path = alt_url -%} diff --git a/bedrock/base/templates/includes/protocol/lang-switcher-refresh.html b/bedrock/base/templates/includes/protocol/lang-switcher-refresh.html index ad4c9254c50..1c960da965a 100644 --- a/bedrock/base/templates/includes/protocol/lang-switcher-refresh.html +++ b/bedrock/base/templates/includes/protocol/lang-switcher-refresh.html @@ -4,12 +4,14 @@ file, You can obtain one at https://mozilla.org/MPL/2.0/. #} - {% if translations|length > 1 %} + {%- set available_languages = get_locale_options(request, translations) -%} + + {% if available_languages|length > 1 %}