diff options
| author | Jieiku | 2023-05-26 16:35:44 -0700 |
|---|---|---|
| committer | Jieiku | 2023-05-26 16:35:44 -0700 |
| commit | a0c7ba1f2ec82d9d27b8ef6bee0bf1151ed008d8 (patch) | |
| tree | fd2d4ad46c14a5cf5fd64008ea49edca91c42461 | |
| parent | b978e20c61e43e54972b4b287268de685a56f650 (diff) | |
| download | abridge-a0c7ba1f2ec82d9d27b8ef6bee0bf1151ed008d8.tar.gz abridge-a0c7ba1f2ec82d9d27b8ef6bee0bf1151ed008d8.tar.bz2 abridge-a0c7ba1f2ec82d9d27b8ef6bee0bf1151ed008d8.zip | |
Finish 404 page for multi-lingual
| -rw-r--r-- | config.toml | 6 | ||||
| -rw-r--r-- | templates/404.html | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/config.toml b/config.toml index a1da403..f5fc2b7 100644 --- a/config.toml +++ b/config.toml @@ -51,6 +51,12 @@ Tags = "Mots-clés" Contact = "Contact" Privacy = "Confidentialité" Sitemap = "Plan du site" +### Page not found, maybe moved or not in this language +404_not_found = "Page introuvable, peut-être déplacée ou non dans cette langue" +### Try searching or +404_try_search = "Essayez de rechercher ou" +### go to homepage +404_go_home = "allez à la page d'accueil" #[languages.es.translations] #flag = "🇪🇸" diff --git a/templates/404.html b/templates/404.html index f26dafb..8c57830 100644 --- a/templates/404.html +++ b/templates/404.html @@ -18,7 +18,14 @@ {%- block content %} <div> <h1>404 :(</h1> - <p>The page you are looking for doesn't exist or has been moved. Try using the search, or <a href="{{ config.base_url | safe }}/{%- if config.extra.uglyurls %}index.html{%- endif %}">go home</a>.</p> - <p>La page que vous recherchez n'existe pas ou a été déplacée. Essayez d'utiliser la recherche, ou <a href="{{ config.base_url | safe }}/fr/{%- if config.extra.uglyurls %}index.html{%- endif %}">rentrez chez vous</a>.</p> + {#- Default English message #} + <p>Page not found, maybe moved{% if config.languages | length > 0 %} or not in this language{% endif %}. {% if config.build_search_index %}Try searching or{% endif %} <a href="{{ config.base_url | safe }}/{%- if config.extra.uglyurls %}index.html{%- endif %}">go to homepage</a>.</p> + + {# Iterate through each language and display the localised 404 message #} + {%- for language_name, language in config.languages -%} + {%- if language_name != config.default_language -%} + <p>{{ trans(key="404_not_found", lang=language_name) }}. {% if config.build_search_index %}{{ trans(key="404_try_search", lang=language_name) }}{% endif %} <a href="{{ config.base_url }}/{{ language_name }}/{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ trans(key="404_go_home", lang=language_name) }}</a>.</p> + {%- endif -%} + {%- endfor -%} </div> {%- endblock content %} |
