From db5dc235ad34aacf9033e26cb5c76099e5591409 Mon Sep 17 00:00:00 2001 From: "S. Kozyr" Date: Tue, 11 Jun 2024 12:07:09 +0300 Subject: [PATCH] Added debug page `/faq/translation_status` with the table of all FAQ pages with translations. Signed-off-by: S. Kozyr --- content/faq/translation_status.md | 7 ++++ templates/faq/translation_status.html | 59 +++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 content/faq/translation_status.md create mode 100644 templates/faq/translation_status.html diff --git a/content/faq/translation_status.md b/content/faq/translation_status.md new file mode 100644 index 00000000..1d9af56e --- /dev/null +++ b/content/faq/translation_status.md @@ -0,0 +1,7 @@ +--- +title: FAQ translation status +description: FAQ translation status +extra: + menu_title: FAQ translation status +template: "faq/translation_status.html" +--- diff --git a/templates/faq/translation_status.html b/templates/faq/translation_status.html new file mode 100644 index 00000000..843d0ab6 --- /dev/null +++ b/templates/faq/translation_status.html @@ -0,0 +1,59 @@ + + + + + + + F.A.Q. translation status + + + +{% set all_categories = get_taxonomy(kind='faq', lang = 'en') %} {# Use English as list of all FAQ categories and questions #} +{% set faq_languages = ["ru", "de", "fr", "it", "pl", "pt", "pt-BR", "tr", "uk", "zh-Hans"] %} {# Predefined list of translation languages #} + + + + + {% for lang in faq_languages %} + + {%- endfor -%} + + {% for faq_category in all_categories | get(key="items") %} + + + + {%- for faq_page in faq_category.pages | sort(attribute="extra.order") -%} + + + {% for lang in faq_languages %} + {% set page_trans = faq_page.translations | filter(attribute="lang", value=lang) %} + {% if page_trans | length == 0 %} + + {% else %} + {# __tera_context #} + + {% endif %} + {% endfor %} + + {%- endfor -%} + {% endfor %} +
Category / page{{ lang }}
{{ faq_category.name }}
{{ faq_page.title }} {{ page_trans | first | get(key="title") }}
+ +