Add german translation

This commit is contained in:
Laurenz 2024-03-12 09:47:41 +01:00
parent fba4a1f643
commit 1558c5a6b1
No known key found for this signature in database
GPG key ID: FF04836F2CF8C139
5 changed files with 154 additions and 75 deletions

View file

@ -4,7 +4,14 @@
As an example and guide how to use this template, As an example and guide how to use this template,
check out [this PDF document](./Template-Example-guide.pdf). check out [this PDF document](./Template-Example-guide.pdf).
As you can see, it is obviously in english, The template can be configured to English or German language.
but feel free to translate it ;).
To compile your document,
you need to take the `thesis.typ` file as the input file.
To use the CLI, compile using `typst watch thesis.typ`
or `typst compile thesis.typ`.
If you intend to use the VS Code plug-in "Typst-LSP",
make sure it is either configured to only take the `thesis.typ` as input
or not to perform compilation at all (to use the CLI).
This is a adapted version of a template by [@satoqz](https://github.com/satoqz/). This is a adapted version of a template by [@satoqz](https://github.com/satoqz/).

Binary file not shown.

View file

@ -10,6 +10,9 @@ Also, make sure to read the #link("https://typst.app/docs/")[Typst documentation
This template is for english documents only (for now), This template is for english documents only (for now),
but one could translate it... but one could translate it...
To configure your the language of your thesis,
set the `language` parameter to either `en` (default) or `de`.
*Note* that the template needs to know your first chapter, *Note* that the template needs to know your first chapter,
you can supply it if it is not "Introduction" using the `first_chapter_title` parameter. you can supply it if it is not "Introduction" using the `first_chapter_title` parameter.
@ -17,16 +20,18 @@ you can supply it if it is not "Introduction" using the `first_chapter_title` pa
#show: thesis.with( #show: thesis.with(
... ...
first_chapter_title = "Introduction but with another title", first_chapter_title = "Introduction but with another title",
language: "en",
) )
```, kind: "code", supplement: "Code example", ```, kind: "code", supplement: "Code example",
caption: [Code example explaining how to configure a different first chapter] caption: [Code example explaining how to configure language and a different first chapter]
) )
== Bibliography == Bibliography
As for bibliography / reference listing, As for bibliography / reference listing,
you may decide whether to use Hayagriva, a yaml-based format format designed for Typst you may decide whether to use "Hayagriva", a yaml-based format format designed for Typst
or BibTeX (`.bib`) format, which is well supported by other platforms since it is commonly used by LaTeX. or BibTeX (`.bib`) format, which is _well supported by other platforms
and tooling_ since it is commonly used by LaTeX.
To switch between bibliography formats, change the above to the following: To switch between bibliography formats, change the above to the following:
#figure(```typ #figure(```typ

View file

@ -2,6 +2,88 @@
#let acronyms = yaml("acronyms.yml"); #let acronyms = yaml("acronyms.yml");
#let acroStates = state("acronymStates", ()); #let acroStates = state("acronymStates", ());
#let english_pack = (
degree_1: "for the",
degree_2: "from the Course of Studies Computer Science",
by: "by",
time_period: "Time Period",
student_id_course: "Student ID, Course",
company: "Company",
supervisor: "Supervisor in the Company",
decleration: (type, title) => [
= Author's Declaration
Hereby I solemnly declare:
+ that this #type, titled #text(style: "italic")[#title] is entirely the product of my own scholarly work, unless otherwise indicated in the text or references, or acknowledged below;
+ I have indicated the thoughts adopted directly or indirectly from other sources at the appropriate places within the document;
+ this #type has not been submitted either in whole or part, for a degree at this or any other university or institution;
+ I have not published this #type in the past;
// + the printed version is equivalent to the submitted one.
I am aware that a dishonest declaration will entail legal consequences.
],
abstract: "Abstract",
contents: "Contents",
list_of_figures: "List of Figures",
acronyms: "Acronyms",
bibliography: "Bibliography",
chapter: "Chapter",
section: "Section",
confidentiality_clause: [
= Confidentiality Clause
The content of this work may not be made accessible to people outside of the
testing process and the evaluation process neither as a whole nor as excerpts,
unless an authorization stating otherwise is presented by the training facility.
]
)
// TODO: Check alignment to LaTeX template
#let german_pack = (
degree_1: "für den",
degree_2: "im Studiengang Informatik an der Dualen Hochschule Baden-Württemberg Stuttgart",
by: "von",
time_period: "Bearbeitungszeitraum",
student_id_course: "Matrikelnummer, Kurs",
company: "Ausbildungsfirma",
supervisor: "Betreuer",
decleration: (type, title) => [
== Erklärung
Ich erkläre hiermit ehrenwörtlich:
+ dass ich meine #type mit dem Thema #title ohne fremde Hilfe
angefertigt habe;
+ dass ich die Übernahme wörtlicher Zitate aus der Literatur sowie die Verwendung
der Gedanken anderer Autoren an den entsprechenden Stellen innerhalb der
Arbeit gekennzeichnet habe;
+ dass ich meine T1000 bei keiner anderen Prüfung vorgelegt habe;
Ich bin mir bewusst, dass eine falsche Erklärung rechtliche Folgen haben wird.
#title
*a big & fat _TODO_!*
],
abstract: "Abstract",
contents: "Inhaltsverzeichnis",
list_of_figures: "Abbildungsverzeichnis",
acronyms: "Abkürzungsverzeichnis",
bibliography: "Literaturverzeichnis",
chapter: "Kapitel",
section: "Abschnitt",
confidentiality_clause: [
= Sperrvermerk
Der Inhalt dieser Arbeit darf weder als Ganzes noch in Auszügen Personen außerhalb des
Prüfungs- und des Evaluationsverfahrens zugänglich gemacht werden, sofern keine anders
lautende Genehmigung des Dualen Partners vorliegt.
]
)
#let thesis( #let thesis(
// the title of your thesis // the title of your thesis
title: none, title: none,
@ -27,6 +109,8 @@
degree: "Bachelor of Science", degree: "Bachelor of Science",
// your major, such as "Computer Science" // your major, such as "Computer Science"
major: "Computer Science", major: "Computer Science",
// Change the language to `de` if desired
language: "en",
// Details on your university // Details on your university
university: ( university: (
@ -69,6 +153,9 @@
#assert.ne(time_period, none) #assert.ne(time_period, none)
#assert.ne(supervisor, none) #assert.ne(supervisor, none)
// Use english by default
#let selected_lang = if language == "de" {german_pack} else {english_pack}
#set document( #set document(
title: title, title: title,
author: author, author: author,
@ -86,7 +173,7 @@
// font: "Linux Biolinum O", // font: "Linux Biolinum O",
size: 12pt, size: 12pt,
hyphenate: false, hyphenate: false,
lang: "en", lang: language,
ligatures: true, ligatures: true,
) )
@ -170,9 +257,9 @@
// rename level 1 headings to "Chapter", otherwise "Section" // rename level 1 headings to "Chapter", otherwise "Section"
#set ref(supplement: it => { #set ref(supplement: it => {
if it.func() == heading and it.level == 1 { if it.func() == heading and it.level == 1 {
"Chapter" selected_lang.chapter
} else { } else {
"Section" selected_lang.section
} }
}) })
@ -200,14 +287,14 @@
#text(16pt)[*#type*] #text(16pt)[*#type*]
#v(16pt) #v(16pt)
#text(14pt)[for the] #text(14pt, selected_lang.degree_1)
#text(14pt)[*#degree*] #text(14pt)[*#degree*]
#text(14pt)[from the Course of Studies #major] #text(14pt)[#selected_lang.degree_2 #major]
#v(32pt) #v(32pt)
#text(14pt)[by] #text(14pt, selected_lang.by)
#text(16pt)[*#author*] #text(16pt)[*#author*]
#v(16pt) #v(16pt)
@ -219,10 +306,10 @@
#grid( #grid(
columns: (1fr, 0.5fr, 1fr), columns: (1fr, 0.5fr, 1fr),
align(left)[ align(left)[
*Time Period* \ *#selected_lang.time_period* \
*Student ID, Course* \ *#selected_lang.student_id_course* \
*Company* \ *#selected_lang.company* \
*Supervisor in the Company* *#selected_lang.supervisor*
], ],
none, none,
align(left)[ align(left)[
@ -242,27 +329,17 @@
#counter(page).update(1) #counter(page).update(1)
// https://www.dhbw.de/fileadmin/user_upload/Dokumente/Broschueren_Handbuch_Betriebe/Infoblatt_Vertraulichkeit.pdf // https://www.dhbw.de/fileadmin/user_upload/Dokumente/Broschueren_Handbuch_Betriebe/Infoblatt_Vertraulichkeit.pdf
#if confidentiality_clause [ // English by default
== Confidentiality Clause #if confidentiality_clause {
selected_lang.confidentiality_clause
The content of this work may not be made accessible to people outside of the pagebreak(weak: true)
testing process and the evaluation process neither as a whole nor as excerpts, }
unless an authorization stating otherwise is presented by the training facility.
// #text(lang: "de")[
// Der Inhalt dieser Arbeit darf weder als Ganzes noch in Auszügen Personen außerhalb des
// Prüfungs- und des Evaluationsverfahrens zugänglich gemacht werden, sofern keine anders
// lautende Genehmigung des Dualen Partners vorliegt.
// ]
#pagebreak()
]
// render the abstract aligned to the center of the page // render the abstract aligned to the center of the page
#set align(horizon) #set align(horizon)
#set align(center) #set align(center)
== Abstract #heading(outlined: true, selected_lang.abstract)
#block(width: 70%)[#abstract] #block(width: 70%)[#abstract]
@ -271,21 +348,8 @@
#set align(top) #set align(top)
#set align(start) #set align(start)
= Author's Declaration #(selected_lang.decleration)(type, title)
Hereby I solemnly declare:
+ that this #type, titled #text(style: "italic")[#title] is entirely the product of my own scholarly work, unless otherwise indicated in the text or references, or acknowledged below;
+ I have indicated the thoughts adopted directly or indirectly from other sources at the appropriate places within the document;
+ this #type has not been submitted either in whole or part, for a degree at this or any other university or institution;
+ I have not published this #type in the past;
// - the printed version is equivalent to the submitted one.
I am aware that a dishonest declaration will entail legal consequences.
#v(48pt) #v(48pt)
#university.location, #date #university.location, #date
@ -310,7 +374,7 @@
#pagebreak() #pagebreak()
= Contents = #selected_lang.contents
#locate(loc => { #locate(loc => {
let headings = query(heading, loc) let headings = query(heading, loc)
@ -324,7 +388,7 @@
} }
// similarly, track the end of the main content by the position of the "Bibliography" chapter // similarly, track the end of the main content by the position of the "Bibliography" chapter
if elem.body == [Bibliography] { if elem.body == [#selected_lang.bibliography] {
after_content = true after_content = true
} }
@ -363,7 +427,8 @@
// non-chapter headings have their line filled with dots // non-chapter headings have their line filled with dots
let spacer = if is_chapter { " " } else { " . " } let spacer = if is_chapter { " " } else { " . " }
if elem.body != [Abstract] and elem.body != [Confidentiality Clause] { // if elem.body != [#selected_lang.abstract] and elem.outlined != false {
if elem.outlined != false {
link( link(
location, location,
[ [
@ -397,17 +462,17 @@
// start adding headings to the outline after the table of contents // start adding headings to the outline after the table of contents
#set heading(outlined: true) #set heading(outlined: true)
// = List of Figures
#show outline.entry: it => [ #show outline.entry: it => [
#v(12pt, weak: true) #it #v(12pt, weak: true) #it
] ]
#outline(target: figure, title: "List of Figures", fill: repeat(" . ")) // List of figures
= #selected_lang.list_of_figures
#outline(target: figure, title: none, fill: repeat(" . "))
#pagebreak() #pagebreak()
= Acronyms = #selected_lang.acronyms
#let acroArr = (); #let acroArr = ();
#for (k, v) in acronyms.pairs().sorted(key: s => lower(s.at(0))) { #for (k, v) in acronyms.pairs().sorted(key: s => lower(s.at(0))) {
@ -422,7 +487,7 @@
..acroArr, ..acroArr,
) )
#pagebreak() #pagebreak(weak: true)
// update heading and page numberings to begin the main part of the document // update heading and page numberings to begin the main part of the document
#set heading(numbering: "1.1") #set heading(numbering: "1.1")
@ -434,7 +499,7 @@
// finally, include the bibliography chapter at the end of the document // finally, include the bibliography chapter at the end of the document
#pagebreak() #pagebreak()
#bibliography(bibliography_path, style: "ieee") #bibliography(bibliography_path, title: selected_lang.bibliography, style: "ieee")
] ]
// `pref` if to prefer the long form // `pref` if to prefer the long form

View file

@ -8,6 +8,8 @@
course: "TINF2XA", course: "TINF2XA",
date: "00.00.2024", date: "00.00.2024",
time_period: "01.01.2023 - 00.00.2024", time_period: "01.01.2023 - 00.00.2024",
confidentiality_clause: true,
language: "en",
supervisor: "Someone", supervisor: "Someone",
signature: none, // TODO signature: none, // TODO
) )