summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-09-06 23:20:14 +0000
committerKarl Berry <karl@freefriends.org>2015-09-06 23:20:14 +0000
commit1d472d214213c24b5cd6fc136a8834c121ebf922 (patch)
tree2d42ff52d05214502f9f29bf050921133edb2fc7 /Master
parent36ca69fa1454d2fc9f7034b7486051219212f60f (diff)
translations (6sep15)
git-svn-id: svn://tug.org/texlive/trunk@38308 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/translations/README2
-rw-r--r--Master/texmf-dist/doc/latex/translations/translations_en.pdfbin548986 -> 549961 bytes
-rw-r--r--Master/texmf-dist/doc/latex/translations/translations_en.tex30
-rw-r--r--Master/texmf-dist/tex/latex/translations/translations.sty15
4 files changed, 31 insertions, 16 deletions
diff --git a/Master/texmf-dist/doc/latex/translations/README b/Master/texmf-dist/doc/latex/translations/README
index 43cdb00ebd6..cf23823f540 100644
--- a/Master/texmf-dist/doc/latex/translations/README
+++ b/Master/texmf-dist/doc/latex/translations/README
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------
-the TRANSLATIONS package v1.2c - 2015/08/29
+the TRANSLATIONS package v1.2d - 2015/09/06
internationalization of LaTeX2e packages
--------------------------------------------------------------------------
diff --git a/Master/texmf-dist/doc/latex/translations/translations_en.pdf b/Master/texmf-dist/doc/latex/translations/translations_en.pdf
index c0691a99ece..34286fc40a7 100644
--- a/Master/texmf-dist/doc/latex/translations/translations_en.pdf
+++ b/Master/texmf-dist/doc/latex/translations/translations_en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/translations/translations_en.tex b/Master/texmf-dist/doc/latex/translations/translations_en.tex
index 55801f916b9..5ce6fa4ddc4 100644
--- a/Master/texmf-dist/doc/latex/translations/translations_en.tex
+++ b/Master/texmf-dist/doc/latex/translations/translations_en.tex
@@ -50,6 +50,7 @@
DeclareTranslationFallback,
GetTranslation,
GetTranslationFor,
+ IfTranslation,
LoadDictionary,
LoadDictionaryFor,
NewTranslation,
@@ -92,16 +93,9 @@
\LoadDictionaryFor{German}{translations-basic-dictionary}
% ----------------------------------------------------------------------------
-% custom commands
\usepackage{bbding}
-
-\newlength\nodewidth
-\setlength\nodewidth{.375\linewidth}
-\long\def\yes{\centering\textcolor{green}{\CheckmarkBold}\par}
-\long\def\no{\centering\textcolor{red}{\XSolidBrush}\par}
-\protected\def\fnote#1{\textsuperscript{#1}}
-
+\newrobustcmd\fnote[1]{\textsuperscript{#1}}
\begin{document}
@@ -156,6 +150,10 @@ translation for a given key.
\begin{figure}[htbp]
\centering
+ \newlength\nodewidth
+ \setlength\nodewidth{.375\linewidth}
+ \newcommand*\yes{\centering\textcolor{green}{\CheckmarkBold}\par}
+ \renewcommand*\no{\centering\textcolor{red}{\XSolidBrush}\par}
\begin{tikzpicture}
[
level/.style={sibling distance=.5\linewidth/#1},
@@ -271,6 +269,10 @@ Commands without the marker aren't expandable.
translation of \meta{key} for the currently active language has been
provided. No error will be raised if a fallback for \meta{key} already
exists. This command can only be used in the preamble.
+ \expandable\command{IfTranslation}[\marg{lang}\marg{key}\marg{true}\marg{false}]
+ Checks\sinceversion{1.2d} if a translation for \meta{key} in language
+ \meta{lang} is defined or not and either leaves \meta{true} or
+ \meta{false} in the input stream.
\expandable\command{GetTranslationFor}[\marg{lang}\marg{key}]
Fetches and prints the translation of \meta{key} for the language
\meta{lang}. This command is expandable.
@@ -394,6 +396,9 @@ retrieving and typesetting them.
\selectlanguage{ngerman}
\GetTranslation{Kueche} \kitchen\ \GetTranslationFor{spanish}{Kueche}
\cuisine
+
+ \IfTranslation{German}{Kueche}{true}{false} \par
+ \IfTranslation{Danish}{Kueche}{true}{false}
\end{example}
The next example demonstrates the use of dialects and how they fall back to
@@ -442,7 +447,7 @@ The following three examples should make this concept clear:
\begin{example}[compile]
\documentclass[margin=5mm]{standalone}
\usepackage{translations}
- \DeclareTranslation{German}{foo-literal}{bar}
+ \DeclareTranslation{German}{foo-literal}{foo-german}
\begin{document}
\GetTranslation{foo-literal} % foo-literal
\end{document}
@@ -452,7 +457,7 @@ The following three examples should make this concept clear:
\documentclass[margin=5mm]{standalone}
\usepackage{translations}
\DeclareTranslationFallback{foo-literal}{foo}
- \DeclareTranslation{German}{foo-literal}{bar}
+ \DeclareTranslation{German}{foo-literal}{foo-german}
\begin{document}
\GetTranslation{foo-literal} % foo
\end{document}
@@ -462,9 +467,10 @@ The following three examples should make this concept clear:
\documentclass[margin=5mm]{standalone}
\usepackage[ngerman]{babel}
\usepackage{translations}
- \DeclareTranslation{German}{foo-literal}{bar}
+ \DeclareTranslationFallback{foo-literal}{foo}
+ \DeclareTranslation{German}{foo-literal}{foo-german}
\begin{document}
- \GetTranslation{foo-literal} % bar
+ \GetTranslation{foo-literal} % foo-german
\end{document}
\end{example}
diff --git a/Master/texmf-dist/tex/latex/translations/translations.sty b/Master/texmf-dist/tex/latex/translations/translations.sty
index 789f5eb19d6..c3c76c0a132 100644
--- a/Master/texmf-dist/tex/latex/translations/translations.sty
+++ b/Master/texmf-dist/tex/latex/translations/translations.sty
@@ -25,8 +25,8 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
-\def\@trnslt@date{2015/08/29}
-\def\@trnslt@version{v1.2c}
+\def\@trnslt@date{2015/09/06}
+\def\@trnslt@version{v1.2d}
\def\@trnslt@info{internationalization of LaTeX2e packages}
\ProvidesPackage{translations}[%
@@ -350,6 +350,8 @@
\fi
}%
+% #1: word
+% #2: language
\newcommand*\@trnslt@if@translation[2]{%
\@trnslt@if@word\@trnslt@language{#1}{#2}
{\expandafter\@firstoftwo}
@@ -368,6 +370,10 @@
}%
}
+% #1: language
+% #2: word
+\newcommand*\IfTranslation[2]{\@trnslt@if@translation{#2}{#1}}
+
% --------------------------------------------------------------------------
% We also need to be able to look up a translation:
% \GetTranslationFor and \GetTranslation
@@ -904,6 +910,8 @@
\DeclareLanguageAlias {Croatian}{croatian}
\DeclareLanguageAlias {Slovak}{slovak}
\DeclareLanguageAlias {Slovenian}{slovenian}
+\DeclareLanguageAlias {slovene}{slovenian}
+\DeclareLanguageAlias {Slovene}{slovene}
\DeclareLanguageAlias {Sorbian}{sorbian}
\DeclareLanguageDialect{lowersorbian}{sorbian}
\DeclareLanguageDialect{uppersorbian}{sorbian}
@@ -1029,4 +1037,5 @@
available as \@trnslt@language)
2015/07/09 v1.2b - add language `korean'
2015/08/29 v1.2c - fix bug in \@trnslt@save@translation@for
-
+2015/09/06 v1.2d - add alias `slovene' for `slovenian'
+ - add user command for \@trnslt@if@translation