diff --git a/tex-packages.txt b/tex-packages.txt index 8429b5f..fc6afed 100644 --- a/tex-packages.txt +++ b/tex-packages.txt @@ -40,3 +40,4 @@ bookmark epstopdf-pkg grfext hyphen-german +translations diff --git a/thesis.tex b/thesis.tex index 6aca056..8ea9c46 100755 --- a/thesis.tex +++ b/thesis.tex @@ -31,9 +31,12 @@ \usepackage{fontspec} \defaultfontfeatures{Ligatures=TeX} % -- becomes en-dash etc. -% load english (for abstract) and ngerman language -% the main language has to come last -\usepackage[american, ngerman]{babel} +% load all used languages +% and set the main language of this thesis +% use this if this thesis is written in German: +\usepackage[english, ngerman]{babel} +% use this if this thesis is written in English: +%\usepackage[ngerman, english]{babel} % intelligent quotation marks, language and nesting sensitive \usepackage[autostyle]{csquotes} @@ -68,11 +71,13 @@ %------------------------------------------------------------------------------ \usepackage[ - locale=DE, separate-uncertainty=true, per-mode=symbol-or-fraction, ]{siunitx} \sisetup{math-micro=\text{µ},text-micro=µ} +% automatically choose the right locale +\addto\extrasngerman{\sisetup{locale = DE}} +\addto\extrasenglish{\sisetup{locale = UK}} %------------------------------------------------------------------------------ %-------------------------------- tables ------------------------------------- diff --git a/tudothesis.cls b/tudothesis.cls index bfa126e..a13ddeb 100644 --- a/tudothesis.cls +++ b/tudothesis.cls @@ -61,6 +61,29 @@ \let\oldtitle\title% \renewcommand{\title}[1]{\oldtitle{#1}\newcommand{\thetitle}{#1}} +% Provide all translations through the "translations" package +\RequirePackage{translations} + +\DeclareTranslation{German}{thesisclass}{Arbeit zur Erlangung des akademischen Grades} +\DeclareTranslation{English}{thesisclass}{Thesis for obtaining the academic degree} + +\DeclareTranslation{German}{birthplace}{geboren in} +\DeclareTranslation{English}{birthplace}{born in} + +\DeclareTranslation{German}{firstcorrector}{Erstgutachter} +\DeclareTranslation{English}{firstcorrector}{Reviewer} + +\DeclareTranslation{German}{secondcorrector}{Zweitgutachter} +\DeclareTranslation{English}{secondcorrector}{Co-reviewer} + +\DeclareTranslation{German}{submissiondate}{Abgabedatum} +\DeclareTranslation{English}{submissiondate}{Submission date} + +\DeclareTranslation{German}{university}{Technische Universität Dortmund} +\DeclareTranslation{English}{university}{Technische Universität Dortmund} +% For now, the name of the university is not translated into English, +% but this could be changed in the future + % initialize commands: \newcommand\thebirthplace{} \newcommand\thechair{} @@ -71,7 +94,7 @@ \newcommand\thesecondcorrector{} % new commands for information about the thesis -\newcommand\birthplace[1]{\renewcommand\thebirthplace{geboren in #1}} +\newcommand\birthplace[1]{\renewcommand\thebirthplace{#1}} \newcommand\chair[1]{\renewcommand\thechair{#1}} \newcommand\division[1]{\renewcommand\thedivision{#1}} \newcommand\thesisclass[1]{\renewcommand\thethesisclass{#1}} @@ -80,17 +103,17 @@ \newcommand\secondcorrector[1]{\renewcommand\thesecondcorrector{#1}} % set title page elements -\subject{Arbeit zur Erlangung des akademischen Grades\\ \thethesisclass} -\publishers{\thechair \\ \thedivision \\ Technische Universität Dortmund} +\subject{\GetTranslation{thesisclass} \\ \thethesisclass} +\publishers{\thechair \\ \thedivision \\ \GetTranslation{university}} % page for the correctors \newcommand{\makecorrectorpage}{% \thispagestyle{empty} \vspace*{\fill} \begin{tabular}{@{}l@{\hspace{2em}}l@{}} - Erstgutachter: & \thefirstcorrector \\ - Zweitgutachter: & \thesecondcorrector \\ - Abgabedatum: & \thesubmissiondate + \GetTranslation{firstcorrector}: & \thefirstcorrector \\ + \GetTranslation{secondcorrector}: & \thesecondcorrector \\ + \GetTranslation{submissiondate}: & \thesubmissiondate \end{tabular} \newpage } @@ -98,5 +121,5 @@ % add birthplace to author \let\oldauthor\author \renewcommand\author[1]{% - \oldauthor{#1 \\ \thebirthplace} + \oldauthor{#1 \\ \GetTranslation{birthplace} \thebirthplace} }