From 45733f5b32fa2e538af0c904d09ee6d614e75f2f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 27 Apr 2021 21:56:41 +0000 Subject: onedown (27apr21) git-svn-id: svn://tug.org/texlive/trunk@59010 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/onedown/onedown.dtx | 486 ++++++++++++--------- 1 file changed, 290 insertions(+), 196 deletions(-) (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/onedown/onedown.dtx b/Master/texmf-dist/source/latex/onedown/onedown.dtx index 89f6d5034b8..92ffa661559 100644 --- a/Master/texmf-dist/source/latex/onedown/onedown.dtx +++ b/Master/texmf-dist/source/latex/onedown/onedown.dtx @@ -24,20 +24,23 @@ \ProvidesFile{onedown.dtx} % %\NeedsTeXFormat{LaTeX2e}[2014/05/01] -%\def\ODwstyleversion{1.4}\def\ODwstyledate{2019/10/15} +%\def\ODwstyleversion{1.6}\def\ODwstyledate{2021/04/27} %\ProvidesPackage{onedown} % [\ODwstyledate\space v\ODwstyleversion\space -% Typeset Bridge Diagrams - Jacob Wiersma (C) 2016-2019] +% Typeset Bridge Diagrams - Jacob Wiersma (C) 2016-2021] % %<*driver> -%\documentclass[a4paper,12pt,draft]{ltxdoc}% with draft no hyperrefs -\documentclass[a4paper,12pt]{ltxdoc} +\PassOptionsToPackage{shorthands=off}{babel} +% +% with draft no hyperrefs +\documentclass[a4paper,12pt,% +german,dutch,french,swedish,english]{ltxdoc} % the package |shortvrb| is auto-loaded, providing |...| as shorthand \usepackage[utf8]{inputenc} % \usepackage[T1]{fontenc} -\usepackage[german,dutch,french,swedish,english,shorthands=]{babel} -\usepackage{onedown}[2019/10/15] +\usepackage{babel} +\usepackage{onedown}[2021/04/27] \usepackage[normalem]{ulem}% for strikeout todos that are done \usepackage{needspace}% keep contiguous lines on one page \usepackage[inline]{enumitem}% Control various parameters of lists @@ -185,7 +188,7 @@ \let\xspaceODwold=\xspace% \def\xspace{}% \foreignlanguage{#3}{% - \IfBooleanTF#1{\GetTranslation{#2-(ODw)}}{#2}% + \IfBooleanTF#1{\translate{#2-(ODw)}}{#2}% }% \let\xspace=\xspaceODwold% }% Translate @@ -209,7 +212,7 @@ % % \fi % -% \CheckSum{3771} +% \CheckSum{3810} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -384,6 +387,18 @@ % I renamed \emph{symbols} into \textbf{ODw@symbols} and \emph{symbolsC} into \textbf{ODw@symbolsC} % to solve this. % } +% \changes{v1.5}{2020/02/02}{\\ +% - Added a check if the etoolbox package is recent enough.\\ +% - Added code to load onedown.symbols (card symbols) and explained in onedown-examples +% (CardSymbols) how to use it. +% } +% \changes{v1.6}{2021/04/25}{\\ +% - Switched to \packname{translator} due to incompatibilities with +% \packname{translations}\\ +% - We now use \cmd{\translate} rather than \cmd{\GetTranslation}\\ +% - Translation files are named like: ODw-German.dict\\ +% - Adapted the code to read them on the fly +% } % ^^A Note: ^^21 denotes the exclamation mark (!) % ^^A Note: Char ' is not allowed within changes % @@ -404,7 +419,7 @@ % \hangafter,\hangindent,\hbadness,\hbox,\heartsuit,\hfill,\ExplSyntaxOn, % \hline,\hsize,\hskip,\hspace,\hss,\ht,\HUGE,\if,\IfBooleanTF,\moveto, % \ifthenelse,\ifx,\itemsep,\kern,\labelsep,\labelwidth,\large, -% \leftmargin,\leftskip,\lengthtest,\LoadDictionaryFor,\lower, +% \leftmargin,\leftskip,\lengthtest,\uselanguage,\lower, % \mathbf,\medskip,\multicolumn,\NeedsTeXFormat,\newboolean,\numexpr, % \newcounter,\newdimen,\NewDocumentCommand,\strokepath,\closepath, % \NewDocumentEnvironment,\newlength,\noindent,\p@,\par,\whiledo, @@ -425,7 +440,7 @@ % \DeclareSymbolFont,\footnotemark,\footnotesize,\footnotetext,\isodd, % \mathalpha,\pgfkeys,\pgfqkeys,\ProcessPgfOptions,\scriptsize, % \shortstack,\superscript,\textcolor,\thinspace,\tiny,\underline,\value} -% \DoNotIndex{\GetTranslation,\ifpdf,\iflanguage,\iffalse,\AfterPackage, +% \DoNotIndex{\translate,\translation,\ifpdf,\iflanguage,\iffalse,\AfterPackage, % \ifbool,\setbool,\newbool,\StrSubstitute,\StrCount,\StrDel,\ifcase, % \ifboolexpr,\ifnumcomp,\or,\overline,\mbox,\@ODw} % \setcounter{IndexColumns}{2} @@ -461,7 +476,7 @@ % ^^A The frustrating ltxdoc also obfuscates this simple thing! % \thispagestyle{empty} % } -% \author{Jacob Wiersma \\ \url{jack@schuli-wirsi.de}} +% \author{Jacob Wiersma \\ \url{jack46@schuli-wirsi.de}} % \date{v\ODwstyleversion~from \ODwstyledate} % % \maketitle @@ -570,7 +585,7 @@ pdflatex --shell-escape onedown.dtx % \fi % Use:\\ % |pdflatex --shell-escape '\AtBeginDocument{\NoColortrue}\input{onedown.dtx}'| -% as last run to get a pdf for printing on a monochrome printer. +% as last run to get a |PDF| for printing on a monochrome printer. % The |--shell-escape| flag is necesary to generate the list of user % commands. If you think this is too dangerous, then run pdflatex without % this flag and you will get the docmentation without the list of user @@ -612,7 +627,7 @@ pdflatex --shell-escape onedown.dtx % friendly package with detailed documentation. For example you don't need % to say |\setlength{\handskip}{5mm}| or |\def\handskip{5mm}| but rather % call the command |\handskip{1em}|. Not only the call is somewhat -% friendlier, more important, setting the width in terms of the +% friendlier, but more important, by setting the width in terms of the % font used, it will automatically adapt its size accordingly to font and % font-size changes. \OneDown features: % \begin{itemize} @@ -629,7 +644,7 @@ pdflatex --shell-escape onedown.dtx % card diagrams with the hands of the \north, \east, etc.\ player can % be defined in several ways. One can select which hands are to be shown. % Bidding diagrams can be shown stand-alone or in connection with one or -% more hands. In |bidding| diagrams annotations are possible. +% more hands. One can add annotations to any bid in a bidding diagrams. % % \section{Usage} % @@ -638,7 +653,7 @@ pdflatex --shell-escape onedown.dtx % \subsubsection{Requirements} % % The package \OneDown depends on several other packages, such as -% \packname{ifthen}, \packname{translations} or \packname{xspace}. All +% \packname{ifthen}, \packname{translator} or \packname{xspace}. All % these packages get loaded automatically if not already used in your % document. For a complete overview of all required packages, refer to page % \pageref{RequirePackage}. All the packages are loaded without any option, @@ -648,12 +663,15 @@ pdflatex --shell-escape onedown.dtx % Furthermore, for the several languages that \OneDown supports, there are % the dictionary files with translations of the specific bridge terms. % These dictionaries follow the naming convention: -% \texttt{ODw-\meta{language}.trsl} and are included in the bundle. The -% name of the \meta{language} is generally the same as the name that you -% use as option for \packname{babel}. There is one exception: the +% |ODw-.dict| and are included in the bundle. The +% name of the || is generally the same as the name that you +% use as option for \packname{babel}, but starting with a capital. +% \iffalse +% There is one exception: the % Norwegian language uses |norsk| for \packname{babel} and |norwegian| for -% \packname{translations}. But all the same, the |norwegian| dictionary is +% \packname{translator}. But all the same, the |norwegian| dictionary is % automatically loaded when |norsk| is used. +% \fi % % Should you make a dictionary for a language that is not provided yet, or % have corrections for an existing one, please send it to the maintainer, @@ -665,13 +683,13 @@ pdflatex --shell-escape onedown.dtx % your document if you want to load \OneDown with its default settings. % % \textbf{Warning:} \OneDown loads all necessary |ODw|-dictionaries -% automatically at the begin of the document. In order to know which +% automatically. In order to know which % languages must be loaded, these must be specified \emph{before} package % \packname{onedown} is loaded. In general this means that if you use % \packname{babel} (or \packname{polyglossia}) you must % load it before package \OneDown. If for some reason you cannot % or do not want to do that, you can load any |ODw|-dictionary if you put -% the command: |\LoadDictionaryFor{|\marg{language}|}{ODw}| in your +% the command: |\uselanguage{}| in your % preamble, provided that the dictionary is in the \TeX-path. For a % discussion about the caveats of using e.g.\ babel, refer to section% % \ref{Languages}. @@ -679,15 +697,15 @@ pdflatex --shell-escape onedown.dtx % \subsubsection{Options}\label{Options} % % To change the behaviour of \OneDown one can load the package with certain -% options: |\usepackage[|\meta{options}|]{onedown}|. Of course this 'option +% options: |\usepackage[]{onedown}|. Of course this 'option % loading' takes place in the preamble. But it is also possible to set (or % change) options within the document by calling the macro |\setdefaults|. -% This macro uses the same \meta{key}=\meta{val} syntax as is used for the +% This macro uses the same |key=val| syntax as is used for the % options and offers some more keys that cannot be used when loading the % package. Refer to page~\pageref{Defaults} for details. % % As said before, the package loads its options using the -% \meta{key}=\meta{val} syntax. These options deal with: +% |key=val| syntax. These options deal with: % \begin{itemize} % \item[colors] \verb:colors=0|1|2|3|4A|4B:\\ % The color in which the card symbols will @@ -733,16 +751,21 @@ pdflatex --shell-escape onedown.dtx % option. % \end{itemize} % -% \subsubsection{Active Characters: a Warning}\label{Languages} +% \subsubsection{Languages \& Dictionaries}\label{Languages} % -% \OneDown uses the \packname{tranlation} package to automatically +% \OneDown uses the \packname{tranlator} package to automatically % translate often appearing brigde terms like e.g.\ \emph{declarer}. It does % so by looking up these terms in the special |ODw|-dictionary for the % active language. The current \OneDown version supports English, German, -% Dutch, French, most Scadinavian languages and Turkish. Some dictionaries -% may not be complete or may contain errors, please send +% Dutch, French, Spanish, most Scandinavian languages and Turkish. Some +% dictionaries may not be complete or may contain errors, please send % corrections/additions to the maintainer. % +% In order to make \packname{translator} do its job (automatically select the +% right translation when the current language switches to another), it is +% necessary to specify the languages with the |documentclass|, and not with +% |babel|! +% % \needspace{5\baselineskip} % % \paragraph*{\textcolor{red}{\centering Warning for people using active @@ -773,7 +796,27 @@ pdflatex --shell-escape onedown.dtx % So babel-Turkish makes the equal sign and exlamation mark active. This % leads to errors when you call e.g.\ |\setdefaults{warn=on}| or |\hand!|. % If you do not need any character to be active, then load this language -% with |\usepackage[turkish,shorthands=]{babel}|. If you do need the +% with |\usepackage[turkish,shorthands=]{babel}|. +% +% You can also put |\PassOptionsToPackage{shorthands=off}{babel}| +% above your |documentclass| line. Here is a complete example: +% % \iffalse +%<*verb> +% \fi +\begin{verbnobox}[\small] +\PassOptionsToPackage{shorthands=off}{babel} +\documentclass[a4paper,fontsize=11pt,% + dutch,% + german,% + english,% this is the default language +]{scrartcl} +\usepackage{babel} +\end{verbnobox} +% \iffalse +% +% \fi +% +% If you do need the % shorthand then you must disable it every time you have to use e.g.\ the % |=|~character as a normal character by: % @@ -802,6 +845,7 @@ pdflatex --shell-escape onedown.dtx % page layout of this document too much, we scaled them down to % |footnotesize|. % \gamefont{\bfseries\sffamily\footnotesize} +% % Sometimes the output of a command is shown as an example. This output is % framed in this document like \example{this}, just to recognize it easily % as an output example. In an accompanying @@ -941,7 +985,7 @@ pdflatex --shell-escape onedown.dtx % % \subsubsection{The hands of the players} % Before a card diagram can be shown, one must specify the cards that -% each player holds. With the various \meta{player}|hand|-commands one can +% each player holds. With the various |hand|-commands one can % do this. The suits they define are only shown when a |show|-command is % issued after they have been defined. The |show|-commands are discussed on % page \pageref{ShowCommands}. @@ -1014,7 +1058,7 @@ pdflatex --shell-escape onedown.dtx % \example{\onesuitAll{AQ6}{J3}{T54}{K2}}. % \par\noindent % Please note the order of the -% players in the arguments: the first 2 denote the \north and \south hand. +% players in the arguments: the first two denote the \north and \south hand. % The last 2 denote the \east and \west hand. We choose it this way so you % can easily cut and paste one pair from the |\onesuitAll|, or extend % |\onesuitNS| to showing all hands. @@ -1223,7 +1267,7 @@ pdflatex --shell-escape onedown.dtx % code for an abbreviated form, i.e.\ |\Lead[*!]|, because it produces only % the variants \Lead and \Lead*. But remember that we also support automatic % translations into other languages and that in another language an -% abreviationt might be feasible: With the german language active |\Lead*| +% abreviation might be feasible: With the german language active |\Lead*| % and |\Lead*!| produce \foreignlanguage{german}{\example{\Lead*}} and % \foreignlanguage{german}{\example{\Lead*!}} respectively. @@ -1733,19 +1777,21 @@ pdflatex --shell-escape onedown.dtx % % \label{RequirePackage} % \begin{macrocode} +% Warn if a too old expl3 package is used. +\RequirePackage{expl3}[2019/09/21]% needed for LaTeX3 packages (xparse) \RequirePackage{% xcolor,% colorizing symbols \Sp etc. textcomp,% for the numbersign in environment play. moresize,% add \HUGE and \ssmall to font-sizes relsize,% relative font-sizes. (e.g. \smaller) makecmds,% needed for provideenvironment - expl3,% needed for LaTeX3 packages (xparse) +% expl3,% needed for LaTeX3 packages (xparse) xparse,% optional params and starred commands xspace,% handling of spacing behind a command calc,% makes calculations and lengths easier ifthen,% easy booleans, tests and loops adjustbox,% stacked boxes in L-/R-Lower captions - translations,% auto-translate terms (e.g. East->Ost) + translator,% auto-translate terms (e.g. East->Ost) array,% actions for tabular column cells collcell,% macro calls for tabular column cells pgfopts,% for keyval opts, loads also pgfkeys @@ -1759,21 +1805,14 @@ pdflatex --shell-escape onedown.dtx % Add exceptions for xspace % \begin{macrocode} \xspaceaddexceptions{% - = \markit \, \suit \GetTranslation + = \markit \, \suit \translate 2 3 4 5 6 7 8 9 T J Q K A } % \end{macrocode} -% Load the fallback dictionary. This is the default one and equals the -% English dictionary. All other dictionaries are loaded on the fly, when -% needed, provided they are in the \TeX-path. -% -% \begin{macrocode} -\LoadDictionaryFor{fallback}{ODw} -% \end{macrocode} % % \subsubsection{Options} % -% We use the \packname{pgf} \meta{key}=\meta{val} system for our +% We use the \packname{pgf} |=| system for our % options: |colors|, |warn| and |err|. % \begin{macrocode} \pgfkeys{/ODw/.is family} @@ -2197,7 +2236,7 @@ pdflatex --shell-escape onedown.dtx % \NT) that are used in the game of bridge. % We define the international version with the English shortcuts. We use % the |xcolor| package to colorize the suit symbols. The color can be set -% as an \meta{key}=\meta{val} option when loading the package. The option +% as an |=| option when loading the package. The option % |colors=0| means mono-color (black only), synonyms of key 0 are |mono| % and |black|. |colors=1| means black and white, a synonym is |b+w|. % |colors=2| means bi-color (black and red), with synonym |b+r|. @@ -2326,12 +2365,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF#1{% \IfBooleanTF#2 - {\,[0.3]\GetTranslation{NT-(ODw)}}% - {\GetTranslation{No Trump-(ODw)}}% + {\,[0.3]\translate{NT-(ODw)}}% + {\translate{No Trump-(ODw)}}% }{% \IfBooleanTF#2 - {\,[0.3]\GetTranslation{nt-(ODw)}}% - {\GetTranslation{no trump-(ODw)}}% + {\,[0.3]\translate{nt-(ODw)}}% + {\translate{no trump-(ODw)}}% }% \egroup% \xspace% @@ -2745,20 +2784,20 @@ pdflatex --shell-escape onedown.dtx % \begin{macro}{\ODw@W} % \begin{macrocode} \def\ODw@N{% - \@ifstar{\GetTranslation{N-(ODw)}}% - {\GetTranslation{n-(ODw)}}% + \@ifstar{\translate{N-(ODw)}}% + {\translate{n-(ODw)}}% } \def\ODw@E{% - \@ifstar{\GetTranslation{E-(ODw)}}% - {\GetTranslation{e-(ODw)}}% + \@ifstar{\translate{E-(ODw)}}% + {\translate{e-(ODw)}}% } \def\ODw@S{% - \@ifstar{\GetTranslation{S-(ODw)}}% - {\GetTranslation{s-(ODw)}}% + \@ifstar{\translate{S-(ODw)}}% + {\translate{s-(ODw)}}% } \def\ODw@W{% - \@ifstar{\GetTranslation{W-(ODw)}}% - {\GetTranslation{w-(ODw)}}% + \@ifstar{\translate{W-(ODw)}}% + {\translate{w-(ODw)}}% } % \end{macrocode} % \end{macro} @@ -2783,20 +2822,20 @@ pdflatex --shell-escape onedown.dtx % \begin{macro}{\ODw@West} % \begin{macrocode} \def\ODw@North{% - \@ifstar{\GetTranslation{North-(ODw)}}% - {\GetTranslation{north-(ODw)}}% + \@ifstar{\translate{North-(ODw)}}% + {\translate{north-(ODw)}}% } \def\ODw@East{% - \@ifstar{\GetTranslation{East-(ODw)}}% - {\GetTranslation{east-(ODw)}}% + \@ifstar{\translate{East-(ODw)}}% + {\translate{east-(ODw)}}% } \def\ODw@South{% - \@ifstar{\GetTranslation{South-(ODw)}}% - {\GetTranslation{south-(ODw)}}% + \@ifstar{\translate{South-(ODw)}}% + {\translate{south-(ODw)}}% } \def\ODw@West{% - \@ifstar{\GetTranslation{West-(ODw)}}% - {\GetTranslation{west-(ODw)}}% + \@ifstar{\translate{West-(ODw)}}% + {\translate{west-(ODw)}}% } % \end{macrocode} % \end{macro} @@ -2815,12 +2854,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{Pass!-(ODw)}}% - {\GetTranslation{Pass-(ODw)}}% + {\translate{Pass!-(ODw)}}% + {\translate{Pass-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{pass!-(ODw)}}% - {\GetTranslation{pass-(ODw)}}% + {\translate{pass!-(ODw)}}% + {\translate{pass-(ODw)}}% }% TF#1 \egroup% \xspace% @@ -2839,12 +2878,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF#1{% \IfBooleanTF{#2}% - {\GetTranslation{AP-(ODw)}}% - {\GetTranslation{All pass-(ODw)}}% + {\translate{AP-(ODw)}}% + {\translate{All pass-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{ap-(ODw)}}% - {\GetTranslation{all pass-(ODw)}}% + {\translate{ap-(ODw)}}% + {\translate{all pass-(ODw)}}% }% TF#1 \egroup% \xspace% @@ -2863,12 +2902,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF#1{% \IfBooleanTF{#2}% - {\GetTranslation{Dbl-(ODw)}}% - {\GetTranslation{Double-(ODw)}}% + {\translate{Dbl-(ODw)}}% + {\translate{Double-(ODw)}}% }{% \IfBooleanTF{#2}% {X}% - {\GetTranslation{double-(ODw)}}% + {\translate{double-(ODw)}}% }% TF#1 \egroup% \xspace% @@ -2887,12 +2926,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF#1{% \IfBooleanTF{#2}% - {\GetTranslation{ReDbl-(ODw)}}% - {\GetTranslation{ReDouble-(ODw)}}% + {\translate{ReDbl-(ODw)}}% + {\translate{ReDouble-(ODw)}}% }{% \IfBooleanTF{#2}% {\mbox{X\kern-0.1em X}}% - {\GetTranslation{redouble-(ODw)}}% + {\translate{redouble-(ODw)}}% }% TF#1 \egroup% \xspace% @@ -4049,7 +4088,7 @@ pdflatex --shell-escape onedown.dtx % board number. |\boardtext*| outputs something like 'Board:~23'. % \begin{macrocode} \NewDocumentCommand\boardtext{s}{% - \IfBooleanTF#1{\GetTranslation{Board-(ODw)}:\,\ODw@BoardText}% + \IfBooleanTF#1{\translate{Board-(ODw)}:\,\ODw@BoardText}% {\ODw@BoardText}% }% boardtext % \end{macrocode} @@ -4066,7 +4105,7 @@ pdflatex --shell-escape onedown.dtx \gdef\ODw@BoardText{% \bgroup% \ODw@OtherFont% -% \GetTranslation{Board-(ODw)} #1% +% \translate{Board-(ODw)} #1% #1% \egroup% }% @@ -4250,7 +4289,7 @@ pdflatex --shell-escape onedown.dtx % \end{macro} % % \begin{macro}{\handskip}\MacroDef{handskip}[\marg{length}] -% |\handskip| adds \meta{length} to |SkipWidth|, i.e.\ the distance between +% |\handskip| adds || to |SkipWidth|, i.e.\ the distance between % the card diagram (with or without the east hand) and the |bidding| % diagram. % \begin{macrocode} @@ -4266,7 +4305,7 @@ pdflatex --shell-escape onedown.dtx % \begin{macrocode} \def\ODw@DealerText{% \bgroup% - \ODw@OtherFont\GetTranslation{Dealer-(ODw)}% + \ODw@OtherFont\translate{Dealer-(ODw)}% \egroup% }% ODw@DealerText % \end{macrocode} @@ -4283,11 +4322,11 @@ pdflatex --shell-escape onedown.dtx \bgroup% \ODw@OtherFont% \IfBooleanTF#1{% - \IfBooleanTF#2{\GetTranslation{Vul-(ODw)}}% - {\GetTranslation{Vulnerable-(ODw)}}% + \IfBooleanTF#2{\translate{Vul-(ODw)}}% + {\translate{Vulnerable-(ODw)}}% }{% - \IfBooleanTF#2{\GetTranslation{vul-(ODw)}}% - {\GetTranslation{vulnerable-(ODw)}}% + \IfBooleanTF#2{\translate{vul-(ODw)}}% + {\translate{vulnerable-(ODw)}}% }% \egroup% \xspace% @@ -4298,7 +4337,7 @@ pdflatex --shell-escape onedown.dtx % \begin{macro}{\ODw@AwardText} Typesets the text to be put as 'title' in % the \emph{award} part of a expert quiz. % \begin{macrocode} -\def\ODw@AwardText{\textsf{\GetTranslation{Award-(ODw)}}} +\def\ODw@AwardText{\textsf{\translate{Award-(ODw)}}} % \end{macrocode} % \end{macro} % @@ -4726,7 +4765,7 @@ pdflatex --shell-escape onedown.dtx \def\ODw@Tricks{% \setcounter{ODw@PlayerNr}{0}% \gdef\ODw@Last{\ODw@NextLead}% - \expandafter\GetTranslation% + \expandafter\translate% \expandafter{\ODw@NextLead-(ODw)}:\,% % write a colon and a thin space in the table, % as separator between lead player and lead card. @@ -4833,10 +4872,10 @@ pdflatex --shell-escape onedown.dtx % \provideenvironment{TableII}{% \begin{tabular}[b]{FPPP}% - \multicolumn{1}{c}{\GetTranslation{Lead!-(ODw)}} &% - \cci{\GetTranslation{2nd-(ODw)}} &% - \cci{\GetTranslation{3rd-(ODw)}} &% - \cci{\GetTranslation{4th-(ODw)}} \\[0.3em]\hline% + \multicolumn{1}{c}{\translate{Lead!-(ODw)}} &% + \cci{\translate{2nd-(ODw)}} &% + \cci{\translate{3rd-(ODw)}} &% + \cci{\translate{4th-(ODw)}} \\[0.3em]\hline% \multicolumn{4}{c}{}\\[-\ODw@EXtra]% }{% \end{tabular}% @@ -4866,7 +4905,7 @@ pdflatex --shell-escape onedown.dtx % \begin{macrocode} % \begin{tabular}[b]{r}% TableI - \cci{\GetTranslation{Nr-(ODw)}}\\[0.3em] + \cci{\translate{Nr-(ODw)}}\\[0.3em] \hline\\[-\ODw@EXtra]% \setcounter{ODw@Cnt}{1}% \whiledo{\theODw@Cnt<\theODw@Nr}{% @@ -4996,7 +5035,7 @@ pdflatex --shell-escape onedown.dtx % % \subsection{Resetting the Game} % -% We use \packname{pgfkeys} with its \meta{key}=\meta{val} system to +% We use \packname{pgfkeys} with its |=| system to %specify the fonts and other things that we want to have as defaults, %rather than the intitial \OneDown values. Therefore we first define the %keys and the store for it. @@ -5302,12 +5341,12 @@ pdflatex --shell-escape onedown.dtx %JW \ODw@GameFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{A-(ODw)}}% - {\GetTranslation{Ace-(ODw)}}% + {\translate{A-(ODw)}}% + {\translate{Ace-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{a-(ODw)}}% - {\GetTranslation{ace-(ODw)}}% + {\translate{a-(ODw)}}% + {\translate{ace-(ODw)}}% }% \egroup% \xspace% @@ -5326,12 +5365,12 @@ pdflatex --shell-escape onedown.dtx %JW \ODw@GameFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{K-(ODw)}}% - {\GetTranslation{King-(ODw)}}% + {\translate{K-(ODw)}}% + {\translate{King-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{k-(ODw)}}% - {\GetTranslation{king-(ODw)}}% + {\translate{k-(ODw)}}% + {\translate{king-(ODw)}}% }% \egroup% \xspace% @@ -5350,12 +5389,12 @@ pdflatex --shell-escape onedown.dtx %JW \ODw@GameFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{Q-(ODw)}}% - {\GetTranslation{Queen-(ODw)}}% + {\translate{Q-(ODw)}}% + {\translate{Queen-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{q-(ODw)}}% - {\GetTranslation{queen-(ODw)}}% + {\translate{q-(ODw)}}% + {\translate{queen-(ODw)}}% }% \egroup% \xspace% @@ -5374,12 +5413,12 @@ pdflatex --shell-escape onedown.dtx %JW \ODw@GameFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{J-(ODw)}}% - {\GetTranslation{Jack-(ODw)}}% + {\translate{J-(ODw)}}% + {\translate{Jack-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{j-(ODw)}}% - {\GetTranslation{jack-(ODw)}}% + {\translate{j-(ODw)}}% + {\translate{jack-(ODw)}}% }% \egroup% \xspace% @@ -5419,12 +5458,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{All!-(ODw)}}% - {\GetTranslation{All-(ODw)}}% + {\translate{All!-(ODw)}}% + {\translate{All-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{all!-(ODw)}}% - {\GetTranslation{all-(ODw)}}% + {\translate{all!-(ODw)}}% + {\translate{all-(ODw)}}% }% \egroup% \xspace% @@ -5443,12 +5482,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{None!-(ODw)}}% - {\GetTranslation{None-(ODw)}}% + {\translate{None!-(ODw)}}% + {\translate{None-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{none!-(ODw)}}% - {\GetTranslation{none-(ODw)}}% + {\translate{none!-(ODw)}}% + {\translate{none-(ODw)}}% }% \egroup% \xspace% @@ -5473,12 +5512,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{Contr-(ODw)}}% - {\GetTranslation{Contract-(ODw)}}% + {\translate{Contr-(ODw)}}% + {\translate{Contract-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{contr-(ODw)}}% - {\GetTranslation{contract-(ODw)}}% + {\translate{contr-(ODw)}}% + {\translate{contract-(ODw)}}% }% \egroup% \xspace% @@ -5497,12 +5536,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{Lead!-(ODw)}}% - {\GetTranslation{Lead-(ODw)}}% + {\translate{Lead!-(ODw)}}% + {\translate{Lead-(ODw)}}% }{% else #1 \IfBooleanTF{#2}% - {\GetTranslation{lead!-(ODw)}}% - {\GetTranslation{lead-(ODw)}}% + {\translate{lead!-(ODw)}}% + {\translate{lead-(ODw)}}% }% #1 \egroup% \xspace% @@ -5521,12 +5560,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{Decl-(ODw)}}% - {\GetTranslation{Declarer-(ODw)}}% + {\translate{Decl-(ODw)}}% + {\translate{Declarer-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{decl-(ODw)}}% - {\GetTranslation{declarer-(ODw)}}% + {\translate{decl-(ODw)}}% + {\translate{declarer-(ODw)}}% }% \egroup% \xspace% @@ -5542,7 +5581,7 @@ pdflatex --shell-escape onedown.dtx \newcommand\by{% \bgroup% \ODw@OtherFont% - \GetTranslation{by-(ODw)}% + \translate{by-(ODw)}% \egroup% \xspace% }% by @@ -5557,12 +5596,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{Brd-(ODw)}}% - {\GetTranslation{Board-(ODw)}}% + {\translate{Brd-(ODw)}}% + {\translate{Board-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{brd-(ODw)}}% - {\GetTranslation{board-(ODw)}}% + {\translate{brd-(ODw)}}% + {\translate{board-(ODw)}}% }% \egroup% \xspace% @@ -5581,12 +5620,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{Deal!-(ODw)}}% - {\GetTranslation{Deal-(ODw)}}% + {\translate{Deal!-(ODw)}}% + {\translate{Deal-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{deal!-(ODw)}}% - {\GetTranslation{deal-(ODw)}}% + {\translate{deal!-(ODw)}}% + {\translate{deal-(ODw)}}% }% \egroup% \xspace% @@ -5603,8 +5642,8 @@ pdflatex --shell-escape onedown.dtx \bgroup% \ODw@OtherFont% \IfBooleanTF{#1}{% - \GetTranslation{Doubled-(ODw)}}{% - \GetTranslation{doubled-(ODw)}% + \translate{Doubled-(ODw)}}{% + \translate{doubled-(ODw)}% }% \egroup% \xspace% @@ -5618,8 +5657,8 @@ pdflatex --shell-escape onedown.dtx \bgroup% \ODw@OtherFont% \IfBooleanTF{#1}{% - \GetTranslation{Redoubled-(ODw)}}{% - \GetTranslation{redoubled-(ODw)}% + \translate{Redoubled-(ODw)}}{% + \translate{redoubled-(ODw)}% }% \egroup% \xspace% @@ -5639,12 +5678,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{HCP-(ODw)}}% - {\GetTranslation{High Card Points-(ODw)}}% + {\translate{HCP-(ODw)}}% + {\translate{High Card Points-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{hcp-(ODw)}}% - {\GetTranslation{high card points-(ODw)}}% + {\translate{hcp-(ODw)}}% + {\translate{high card points-(ODw)}}% }% \egroup% \xspace% @@ -5664,19 +5703,19 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{LP-(ODw)}}% - {\GetTranslation{Length Points-(ODw)}}% + {\translate{LP-(ODw)}}% + {\translate{Length Points-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{lp-(ODw)}}% - {\GetTranslation{length points-(ODw)}}% + {\translate{lp-(ODw)}}% + {\translate{length points-(ODw)}}% }% \egroup% \xspace% }% Length Points % \def\LP{\,\lpts*!} -\def\HLP{\,\bgroup\ODw@OtherFont\GetTranslation{HLP-(ODw)}\egroup\xspace} +\def\HLP{\,\bgroup\ODw@OtherFont\translate{HLP-(ODw)}\egroup\xspace} % \end{macrocode} % \end{macro} % \end{macro} @@ -5690,12 +5729,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{DP-(ODw)}}% - {\GetTranslation{Distribution Points-(ODw)}}% + {\translate{DP-(ODw)}}% + {\translate{Distribution Points-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{dp-(ODw)}}% - {\GetTranslation{distribution points-(ODw)}}% + {\translate{dp-(ODw)}}% + {\translate{distribution points-(ODw)}}% }% \egroup% \xspace% @@ -5714,12 +5753,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{TP-(ODw)}}% - {\GetTranslation{Total Points-(ODw)}}% + {\translate{TP-(ODw)}}% + {\translate{Total Points-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{tp-(ODw)}}% - {\GetTranslation{total points-(ODw)}}% + {\translate{tp-(ODw)}}% + {\translate{total points-(ODw)}}% }% \egroup% \xspace% @@ -5743,12 +5782,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{GF-(ODw)}}% - {\GetTranslation{Game Forcing-(ODw)}}% + {\translate{GF-(ODw)}}% + {\translate{Game Forcing-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{gf-(ODw)}}% - {\GetTranslation{game forcing-(ODw)}}% + {\translate{gf-(ODw)}}% + {\translate{game forcing-(ODw)}}% }% \egroup% \xspace% @@ -5767,12 +5806,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{SF-(ODw)}}% - {\GetTranslation{Semi Forcing-(ODw)}}% + {\translate{SF-(ODw)}}% + {\translate{Semi Forcing-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{sf-(ODw)}}% - {\GetTranslation{semi forcing-(ODw)}}% + {\translate{sf-(ODw)}}% + {\translate{semi forcing-(ODw)}}% }% \egroup% \xspace% @@ -5791,12 +5830,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{NMF-(ODw)}}% - {\GetTranslation{New Minor Forcing-(ODw)}}% + {\translate{NMF-(ODw)}}% + {\translate{New Minor Forcing-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{nmf-(ODw)}}% - {\GetTranslation{new minor forcing-(ODw)}}% + {\translate{nmf-(ODw)}}% + {\translate{new minor forcing-(ODw)}}% }% \egroup% \xspace% @@ -5815,12 +5854,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{TSF-(ODw)}}% - {\GetTranslation{Third Suit Forcing-(ODw)}}% + {\translate{TSF-(ODw)}}% + {\translate{Third Suit Forcing-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{tsf-(ODw)}}% - {\GetTranslation{third suit forcing-(ODw)}}% + {\translate{tsf-(ODw)}}% + {\translate{third suit forcing-(ODw)}}% }% \egroup% \xspace% @@ -5839,12 +5878,12 @@ pdflatex --shell-escape onedown.dtx \ODw@OtherFont% \IfBooleanTF{#1}{% \IfBooleanTF{#2}% - {\GetTranslation{FSF-(ODw)}}% - {\GetTranslation{Fourth Suit Forcing-(ODw)}}% + {\translate{FSF-(ODw)}}% + {\translate{Fourth Suit Forcing-(ODw)}}% }{% \IfBooleanTF{#2}% - {\GetTranslation{fsf-(ODw)}}% - {\GetTranslation{fourth suit forcing-(ODw)}}% + {\translate{fsf-(ODw)}}% + {\translate{fourth suit forcing-(ODw)}}% }% \egroup% \xspace% @@ -5886,30 +5925,85 @@ pdflatex --shell-escape onedown.dtx % \end{macrocode} % Now we load the dictionaries for the languages that are to be used in % the document. We use \packname{tracklang} to iterate over all the -% document languages and load the corresponding |ODw|-dictionaries. Due to +% document languages and load the corresponding |ODw|-dictionaries. +% \iffalse +% Due to % an inconsistency between \packname{babel} and \packname{translations} % with respect to the Norwegian language (\packname{babel} calls this % language \emph{norsk} whereas \packname{translations} insist on using % \emph{norwegian}, we redefine |\thislang| to the latter if it happens to % be \emph{norsk}. +% \fi % \begin{macrocode} -\AtBeginDocument{% +%\AtBeginDocument{% +\usedictionary{ODw} +%%%% \ForEachTrackedLanguage{\thislang}{% - \ifthenelse{\equal{\thislang}{norsk}}% - {\def\thislang{norwegian}}{}% - \IfFileExists{ODw-\thislang.trsl}% - {% - \LoadDictionaryFor{\thislang}{ODw}% - \PackageInfo{ODw}{% - Translation dictionary ODw-\thislang.trsl loaded% - }% - }{% - \PackageWarning{ODw}{% - Translation dictionary ODw-\thislang.trsl not found% - }% - }% + \PackageInfo{ODw}{Language \thislang\ detected}% +% +% Commented out due to translator +% \ifthenelse{\equal{\thislang}{norsk}}% +% {\def\thislang{norwegian}}{}% +% + \IfEqCase{\thislang}{% + {danish}{\IfFileExists{ODw-Danish.dict}% + {\uselanguage{Danish}% + \PackageInfo{ODw}{Dictionary ODw-Danish.dict loaded} + }{\PackageWarning{ODw}{Dictionary ODw-Danish.dict missing}}}% +% + {dutch}{\IfFileExists{ODw-Dutch.dict}% + {\uselanguage{Dutch}% + \PackageInfo{ODw}{Dictionary ODw-Dutch.dict loaded} + }{\PackageWarning{ODw}{Dictionary ODw-Dutch.dict missing}}}% +% + {english}{\IfFileExists{ODw-English.dict}% + {\uselanguage{English}% + \PackageInfo{ODw}{Dictionary ODw-English.dict loaded} + }{\PackageWarning{ODw}{Dictionary ODw-English.dict missing}}}% +% + {french}{\IfFileExists{ODw-French.dict}% + {\uselanguage{French}% + \PackageInfo{ODw}{Dictionary ODw-French.dict loaded} + }{\PackageWarning{ODw}{Dictionary ODw-French.dict missing}}}% +% + {german}{\IfFileExists{ODw-German.dict}% + {\uselanguage{German}% + \PackageInfo{ODw}{Dictionary ODw-German.dict loaded} + }{\PackageWarning{ODw}{Dictionary ODw-German.dict missing}}}% +% + {norsk}{\IfFileExists{ODw-Norsk.dict}% + {\uselanguage{Norsk}% + \PackageInfo{ODw}{Dictionary ODw-Norsk.dict loaded} + }{\PackageWarning{ODw}{Dictionary ODw-Norsk.dict missing}}}% +% + {spanish}{\IfFileExists{ODw-Spanish.dict}% + {\uselanguage{Spanish}% + \PackageInfo{ODw}{Dictionary ODw-Spanish.dict loaded} + }{\PackageWarning{ODw}{Dictionary ODw-Spanish.dict missing}}}% +% + {swedish}{\IfFileExists{ODw-Swedish.dict}% + {\uselanguage{Swedish}% + \PackageInfo{ODw}{Dictionary ODw-Swedish.dict loaded} + }{\PackageWarning{ODw}{Dictionary ODw-Swedish.dict missing}}}% +% + {turkish}{\IfFileExists{ODw-Turkish.dict}% + {\uselanguage{Turkish}% + \PackageInfo{ODw}{Dictionary ODw-Turkish.dict loaded} + }{\PackageWarning{ODw}{Dictionary ODw-Turkish.dict missing}}}% +% + }[% + \PackageWarning{ODw}% + {Language \thislang\space not supported by OneDown} + ]% IfEqCase +% }% ForEach -}% AtBeginDocument +%%%%% +%}% AtBeginDocument +% Look if we can find a file called onedown.symbols somewhere in the \LaTeX-path +% If so, we load it (the code for inputting card symbols directly from keyboard). +% If not, we keep silent about it +\@input{onedown.symbols} +% % \end{macrocode} % That's it folks, happy \TeX ing! % \begin{macrocode} -- cgit v1.2.3