Added proper pronouns support for English variants
This commit is contained in:
11
data.js
11
data.js
@@ -134,7 +134,7 @@ const languages = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const pronounss = {
|
const pronouns_cs = {
|
||||||
"masculine": {
|
"masculine": {
|
||||||
name: "Mužský rod"
|
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": *
|
const typst_header = `#import "template/template.typ": *
|
||||||
|
|
||||||
#show: tultemplate2.with(
|
#show: tultemplate2.with(
|
||||||
|
12
ui.js
12
ui.js
@@ -76,13 +76,19 @@ async function thesis_title_layout(content, result) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function author_info_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;
|
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)
|
.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) => {
|
.on_click((key) => {
|
||||||
result.pronouns = key;
|
result.pronouns = key;
|
||||||
document.querySelector("#next-button").disabled = false;
|
document.querySelector("#next-button").disabled = false;
|
||||||
|
Reference in New Issue
Block a user