From 155fabc4b98af2049f43ed30419a0de8655388c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Proch=C3=A1zka?= Date: Mon, 6 Oct 2025 20:39:07 +0200 Subject: [PATCH] Added proper pronouns support for English variants --- data.js | 11 ++++++++++- ui.js | 12 +++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/data.js b/data.js index 98a9a10..5cebb22 100644 --- a/data.js +++ b/data.js @@ -134,7 +134,7 @@ const languages = { } } -const pronounss = { +const pronouns_cs = { "masculine": { name: "Mužský rod" }, @@ -146,6 +146,15 @@ const pronounss = { } } +const pronouns_en = { + "me": { + name: "Jednotné čislo" + }, + "we": { + name: "Množné číslo" + } +} + const typst_header = `#import "template/template.typ": * #show: tultemplate2.with( diff --git a/ui.js b/ui.js index 81b722f..4c814aa 100644 --- a/ui.js +++ b/ui.js @@ -76,13 +76,19 @@ async function thesis_title_layout(content, result) { } async function author_info_layout(content, result) { - if(!Object.keys(pronounss).includes(result.pronouns)) { + let pronouns = pronouns_cs; + + if(steps.language.result.lang === "en") { + pronouns = pronouns_en; + } + + if(!Object.keys(pronouns).includes(result.pronouns)) { document.querySelector("#next-button").disabled = true; } - let pronouns_buttons = new ButtonListBuilder(Object.keys(pronounss)) + let pronouns_buttons = new ButtonListBuilder(Object.keys(pronouns)) .should_be_pressed((key) => result.pronouns == key) - .modify((b, key) => b.class("expand").text(pronounss[key].name)) + .modify((b, key) => b.class("expand").text(pronouns[key].name)) .on_click((key) => { result.pronouns = key; document.querySelector("#next-button").disabled = false;