|
83 | 83 | \newcommand*{\statementfilename}[1]{\def\@statementfilename{#1}} |
84 | 84 | \newcommand*{\problemparentpath}[1]{\def\@problemparentpath{#1}} |
85 | 85 | % \problemlanguge is solely for backwards compatibility on the off chance someone external uses problemset.cls. Probably not needed |
86 | | -\newcommand*{\problemlanguage}[1]{\def\@problemlanguage{#1}\statementfilename{problem#1.tex}} |
| 86 | +\newcommand*{\problemlanguage}[1]{% |
| 87 | + \statementfilename{problem#1.tex}% |
| 88 | + \setproblemlanguagestrings{#1}% |
| 89 | +} |
87 | 90 | \contestname{} |
88 | 91 | \contestshortname{} |
89 | 92 | \contestlogo{} |
|
92 | 95 | \statementdirectory{problem_statement} % Default to the old standard directory on the off chance someone external uses problemset.cls |
93 | 96 | \statementfilename{} |
94 | 97 | \problemparentpath{} |
95 | | -\problemlanguage{} |
96 | 98 |
|
97 | 99 | \newcommand{\@problempath}[1]{\ifx\@problemparentpath\@empty#1\else\@problemparentpath/#1\fi} |
98 | 100 |
|
|
250 | 252 |
|
251 | 253 | %% Commands related to sample data |
252 | 254 |
|
253 | | -\newcommand{\sampleinputname}{Sample Input} |
254 | | -\newcommand{\sampleoutputname}{Sample Output} |
255 | | -\newcommand{\sampleinteractname}{Sample Interaction} |
256 | | -\newcommand{\sampleinteractreadname}{Read} |
257 | | -\newcommand{\sampleinteractwritename}{Write} |
| 255 | +% --- Translations --- |
| 256 | +% English (default) |
| 257 | +\newcommand{\@translation@en@sampleinputname}{Sample Input} |
| 258 | +\newcommand{\@translation@en@sampleoutputname}{Sample Output} |
| 259 | +\newcommand{\@translation@en@sampleinteractname}{Sample Interaction} |
| 260 | +\newcommand{\@translation@en@sampleinteractreadname}{Read} |
| 261 | +\newcommand{\@translation@en@sampleinteractwritename}{Write} |
| 262 | + |
| 263 | +% Swedish |
| 264 | +\newcommand{\@translation@sv@sampleinputname}{Exempel på indata} |
| 265 | +\newcommand{\@translation@sv@sampleoutputname}{Exempel på utdata} |
| 266 | +\newcommand{\@translation@sv@sampleinteractname}{Exempel på interaktion} |
| 267 | +\newcommand{\@translation@sv@sampleinteractreadname}{Läs} |
| 268 | +\newcommand{\@translation@sv@sampleinteractwritename}{Skriv} |
| 269 | + |
| 270 | +% Icelandic |
| 271 | +\newcommand{\@translation@is@sampleinputname}{Sýniinntak} |
| 272 | +\newcommand{\@translation@is@sampleoutputname}{Sýniúttak} |
| 273 | +\newcommand{\@translation@is@sampleinteractname}{Sýnisamskipti} |
| 274 | +\newcommand{\@translation@is@sampleinteractreadname}{Lestur} |
| 275 | +\newcommand{\@translation@is@sampleinteractwritename}{Skrif} |
| 276 | +% --- End Translations --- |
| 277 | + |
| 278 | +\newcommand{\setproblemlanguagestrings}[1]{% |
| 279 | + \expandafter\ifx\csname @translation@#1@sampleinputname\endcsname\relax |
| 280 | + % Language not found, default to English |
| 281 | + \def\problemlanguageis{en}% |
| 282 | + \else |
| 283 | + % Language found |
| 284 | + \def\problemlanguageis{#1}% |
| 285 | + \fi |
| 286 | + \expandafter\let\expandafter\sampleinputname\csname @translation@\problemlanguageis @sampleinputname\endcsname |
| 287 | + \expandafter\let\expandafter\sampleoutputname\csname @translation@\problemlanguageis @sampleoutputname\endcsname |
| 288 | + \expandafter\let\expandafter\sampleinteractname\csname @translation@\problemlanguageis @sampleinteractname\endcsname |
| 289 | + \expandafter\let\expandafter\sampleinteractreadname\csname @translation@\problemlanguageis @sampleinteractreadname\endcsname |
| 290 | + \expandafter\let\expandafter\sampleinteractwritename\csname @translation@\problemlanguageis @sampleinteractwritename\endcsname |
| 291 | +} |
| 292 | +\setproblemlanguagestrings{en} |
258 | 293 |
|
259 | 294 | \newcommand{\formatsampleheader}[1]{\textsf{\textbf{#1}}} |
260 | 295 |
|
|
0 commit comments