Skip to content

Commit f5a6f6d

Browse files
committed
localization: review; add multilingual
1 parent 24c0ead commit f5a6f6d

File tree

4 files changed

+64
-14
lines changed

4 files changed

+64
-14
lines changed

localization/basic.tex

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,22 @@
2323
%%\catcode`\"=12
2424

2525
\section*{Basic example}%%
26-
27-
Notice the ''Problem'', ''Question'', ''Exercise'', and ''Exploration'' environment titles...
26+
27+
Using \verb|babel| and its \verb|\selectlanguage| command, the labels of the Ximera environments are translated to the current language,
28+
as in the following ''Problem'', ''Question'', ''Exercise'', and ''Exploration''.
2829
\begin{problem}%
29-
This is a problem, and the answer is 1! %$\answer{1}$%%%
30+
This is a problem, and $1+1 = \answer{2}$%%%
3031
\begin{multipleChoice}
3132
\choice{This is a wrong choice}
3233
\choice[correct]{this is a correct choice}
3334
\end{multipleChoice}%%
3435
\end{problem}
3536

3637
\begin{question}
37-
This is a problem, and the answer is 2! %$\answer{2}$
38+
This is a question.
3839
\begin{selectAll}
3940
\choice{This is a wrong choice}
40-
\choice[correct]{This is a correct choice. Note that it does have feedback this time though!}
41+
\choice[correct]{This is a correct choice, with feedback now.}
4142
\end{selectAll}%%%%
4243
\begin{feedback}
4344
Here's some feedback! Note that it is trivial to remove the text, if you don't want it to say ''feedback: '' before the feedback. I only did it here to add/demo the infrastructure for online feedback (since the pdf does include ''feedback: '' by default, so that needed to be translated)%
@@ -47,22 +48,30 @@ \section*{Basic example}%%
4748
\end{feedback}
4849
\end{question}
4950

50-
\begin{exercise}
51+
\begin{exercise} $2+4=\answer[onlinenoinput]{6}$.
5152
\begin{hint}
52-
Here's a hint - the answer is 3!, not 3.
53+
Here's a hint: $2 + 4 = 2 \times 3$.
5354
\end{hint}
54-
Note: ''Hint'' is redefined in this KU Lueven printstyle and replaced by xmHint. Currently this translation works on the ''hint'' environment, but not the ''xmHint'' environment. We need to decide what we are using and I will write the code to support that.
55-
This is a problem: $\answer{6}$
55+
Note: ''Hint'' is redefined in this KU Leuven printstyle and replaced by xmHint. Currently this translation works on the ''hint'' environment, but not the ''xmHint'' environment. We need to decide what we are using and I will write the code to support that.
56+
57+
This is an exporation: $4! = \answer{24}$
5658
\end{exercise}
5759

58-
\begin{exploration}
59-
This is a problem, and the answer is 4! $\answer{24}$
60-
\end{exploration}
6160

61+
% The language can be overwritten locally, e.g with the \verb|\selectlanguage{dutch}|:
62+
% \selectlanguage{dutch}
63+
% \begin{theorem}
64+
% Dit is stelling één: $1+1 = $ \wordChoice{\choice[correct]{twee}\choice{drie}}.
65+
% \end{theorem}
6266

63-
\section*{Extended list of environments}%%
67+
% \selectlanguage{french}
68+
% \begin{theorem}
69+
% Ceci est theorème un: $1+1 = $ \wordChoice{\choice[correct]{deux}\choice{trois}}.
70+
% \end{theorem}
6471

6572

73+
\section*{Extended list of environments}%%
74+
6675
\begin{algorithm}
6776
This is an algorithm Environment.
6877
\end{algorithm}% Used in theorems.dtx

localization/multilingual.tex

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
\documentclass{ximera}
2+
\input{multilingualPreamble.tex}
3+
4+
5+
\title{Multiple languages in one file}
6+
7+
\begin{document}
8+
\begin{abstract}%%
9+
\end{abstract}
10+
\maketitle
11+
12+
\section*{Basic example}%%
13+
14+
\begin{theorem}
15+
This is theorem one: $1+1 = $ \wordChoice{\choice[correct]{two}\choice{three}}.
16+
\end{theorem}
17+
18+
19+
The language can be overwritten locally, e.g with the \verb|\selectlanguage{dutch}|:
20+
\selectlanguage{dutch}
21+
\begin{theorem}
22+
Dit is stelling één: $1+1 = $ \wordChoice{\choice[correct]{twee}\choice{drie}}.
23+
\end{theorem}
24+
25+
\selectlanguage{french}
26+
\begin{theorem}
27+
Ceci est theorème un: $1+1 = $ \wordChoice{\choice[correct]{deux}\choice{trois}}.
28+
\end{theorem}
29+
30+
\selectlanguage{brazil}
31+
\begin{theorem}
32+
$1+1 = $ \wordChoice{\choice[correct]{dos}\choice{tres}}.
33+
\end{theorem}
34+
35+
\end{document}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
\usepackage[dutch,french,brazil,english]{babel}

testXourses/localizationTest.tex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,24 @@
1313
%\activity{testFiles/localization}
1414
\activity{../localization/basic}
1515

16-
\sectionstyle
1716

1817
%
1918
% NOTE: the files dutch/basic etc load a local xmPreamble to set the language
2019
% This is NOT done when inside a xourse,
2120
% and the \selectlanguage (presumable) simulates the loacl xmPreamble.
2221
%
22+
\sectionstyle
23+
2324
\selectlanguage{french}
2425
\activity{../localization/french/basic}
2526
\selectlanguage{dutch}
2627
\activity{../localization/dutch/basic}
2728
\selectlanguage{brazil}
2829
\activity{../localization/brazil/basic}
2930

31+
\chapterstyle
32+
33+
\selectlanguage{english}
34+
\activity{../localization/multilingual}
3035

3136
\end{document}

0 commit comments

Comments
 (0)