From 2ddf7d51a244b84d905249c1581226c285b6ecab Mon Sep 17 00:00:00 2001 From: "S. Kozyr" Date: Mon, 10 Jun 2024 22:46:58 +0300 Subject: [PATCH] Renamed language from "zh" to "zh-Hans". Added Ukrainian FAQ index. Fixed missing FAQ translation errors. Signed-off-by: S. Kozyr --- config.toml | 5 +++++ content/faq/_index.uk.md | 10 ++++++++++ .../map-errors/{index.zh.md => index.zh-Hans.md} | 0 .../{index.zh.md => index.zh-Hans.md} | 0 .../{index.zh.md => index.zh-Hans.md} | 0 .../{index.zh.md => index.zh-Hans.md} | 0 templates/base.html | 8 ++++++-- 7 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 content/faq/_index.uk.md rename content/faq/editing/map-errors/{index.zh.md => index.zh-Hans.md} (100%) rename content/faq/map/can-find-position/{index.zh.md => index.zh-Hans.md} (100%) rename content/faq/map/cant-download-maps/{index.zh.md => index.zh-Hans.md} (100%) rename content/faq/map/search-cannot-find-a-place/{index.zh.md => index.zh-Hans.md} (100%) diff --git a/config.toml b/config.toml index 78d263c0..1c097625 100644 --- a/config.toml +++ b/config.toml @@ -509,6 +509,11 @@ language = "Gallego" language-word = "Idioma" name = "Nome" token = "Token" +[languages.pt] +taxonomies = [ + {name = "faq", feed = false}, + {name = "news", feed = true}, +] [languages.pt.translations] address = "Endereço" back = "Voltar às notícias" diff --git a/content/faq/_index.uk.md b/content/faq/_index.uk.md new file mode 100644 index 00000000..5abf9e62 --- /dev/null +++ b/content/faq/_index.uk.md @@ -0,0 +1,10 @@ +--- +title: Довідка та часті питання +description: Відповіді на поширені запитання стосовно застосунка Organic Maps +extra: + menu_title: Довідка +--- + +### This page is replaced with taxonomy "faq" from templates/faq/list.html template + +This file is needed for top_menu.html and bottom_menu.html templates to show F.A.Q. diff --git a/content/faq/editing/map-errors/index.zh.md b/content/faq/editing/map-errors/index.zh-Hans.md similarity index 100% rename from content/faq/editing/map-errors/index.zh.md rename to content/faq/editing/map-errors/index.zh-Hans.md diff --git a/content/faq/map/can-find-position/index.zh.md b/content/faq/map/can-find-position/index.zh-Hans.md similarity index 100% rename from content/faq/map/can-find-position/index.zh.md rename to content/faq/map/can-find-position/index.zh-Hans.md diff --git a/content/faq/map/cant-download-maps/index.zh.md b/content/faq/map/cant-download-maps/index.zh-Hans.md similarity index 100% rename from content/faq/map/cant-download-maps/index.zh.md rename to content/faq/map/cant-download-maps/index.zh-Hans.md diff --git a/content/faq/map/search-cannot-find-a-place/index.zh.md b/content/faq/map/search-cannot-find-a-place/index.zh-Hans.md similarity index 100% rename from content/faq/map/search-cannot-find-a-place/index.zh.md rename to content/faq/map/search-cannot-find-a-place/index.zh-Hans.md diff --git a/templates/base.html b/templates/base.html index 9ab8c871..e13a5f06 100644 --- a/templates/base.html +++ b/templates/base.html @@ -12,9 +12,13 @@ {%- set resource_title = resource.name %} {%- elif taxonomy %}{# taxonomy has only 'name' and 'slug' properties #} {% if lang == 'en' %} -{% set resource = taxonomy.name ~ "/_index.md" %} + {% set resource = taxonomy.name ~ "/_index.md" %} {% else %} -{% set resource = taxonomy.name ~ "/_index." ~ lang ~ ".md" %} + {% set resource = taxonomy.name ~ "/_index." ~ lang ~ ".md" %} + {%- set translation_exists = load_data(path=resource, required=false) -%} + {%- if not translation_exists -%} + {% set resource = taxonomy.name ~ "/_index.md" %} {# Fallback to English if no translation available #} + {% endif %} {% endif %} {% set resource = get_section(path=resource) %} {%- set resource_title = resource.title %}