From 76859b49d35229a6597399ea2797eeb54be7e7f7 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Wed, 3 Jan 2024 18:17:56 +0100 Subject: [PATCH] better lang switchign rendering in the menu --- src/template.ml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/template.ml b/src/template.ml index abb300f..54714cb 100644 --- a/src/template.ml +++ b/src/template.ml @@ -86,9 +86,19 @@ let generic request ~title:title_txt ~scripts ~styles ~h1 content = ; txt_anylang " | " ; a ~a:[ a_href Sitemap.contact ] [ txt ~fr:"Contact" ~en:"Contact" ] ; txt_anylang " | " - ; a ~a:[ a_href @@ Sitemap.set_english current_page ] [ txt_anylang "en" ] + ; ( match Lang.of_request request with + | English -> txt_anylang "en" + | French -> + a + ~a:[ a_href @@ Sitemap.set_english current_page ] + [ txt_anylang "en" ] ) ; txt_anylang " / " - ; a ~a:[ a_href @@ Sitemap.set_french current_page ] [ txt_anylang "fr" ] + ; ( match Lang.of_request request with + | English -> + a + ~a:[ a_href @@ Sitemap.set_french current_page ] + [ txt_anylang "fr" ] + | French -> txt_anylang "fr" ) ] in