meso-web

Sources of the |Méso|Star> website
git clone git://git.meso-star.fr/meso-web.git
Log | Files | Refs | README | LICENSE

commit 381ee33cf853f84f24ae07e7dea72645bfb2db54
parent 7f9d24325abb093edcda0310202bdb9d134cc603
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu, 21 Aug 2025 14:13:19 +0200

Correct indexing of multilingual content

The menu entry for multilingual content could link to an unavailable
translation, assuming that the same language as the current content was
available for the targeted multilingual content.

Diffstat:
Mgenerate_header.sh | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/generate_header.sh b/generate_header.sh @@ -122,7 +122,7 @@ print_menu1() # Print the list of translation choices # Available langs are submitted on standard input -print_translations() +print_translations() # uri_template (i.e. URI generic to the lang) ( _uri_template="$1" @@ -158,6 +158,7 @@ print_menu2() _label="$(echo "${_i}" | cut -d' ' -f1)" _uri_template="$(echo "${_i}" | cut -d' ' -f2)" _langs="$(echo "${_i}" | cut -d' ' -f3)" + _lang_default="$(echo "${_langs}" | cut -d ':' -f1)" _uri="$(echo "${_uri_template}" | sed "s/@LANG@/${lang}/g")" @@ -180,6 +181,7 @@ print_menu2() else # The entry links to a local web page for the section + _uri="$(echo "${_uri_template}" | sed "s/@LANG@/${_lang_default}/g")" printf ' <a href="%s%s/%s">%s</a>\n' \ "${root}" "${section}" "${_uri}" "${_label}" fi