summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/translations
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-05-16 21:07:07 +0000
committerKarl Berry <karl@freefriends.org>2017-05-16 21:07:07 +0000
commita41809964596f3f3a1a5de9220c4c1e0a8c9873c (patch)
tree3c1d42f4dbf220244ec86e0e227b25a3a721825d /Master/texmf-dist/tex/latex/translations
parent59524d832c95d96dbf8b0a59147fb169d27835d5 (diff)
translations (16may17)
git-svn-id: svn://tug.org/texlive/trunk@44381 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/translations')
-rw-r--r--Master/texmf-dist/tex/latex/translations/translations.sty66
1 files changed, 28 insertions, 38 deletions
diff --git a/Master/texmf-dist/tex/latex/translations/translations.sty b/Master/texmf-dist/tex/latex/translations/translations.sty
index 83604d1f203..88d2b20c86f 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.
% --------------------------------------------------------------------------
-\newcommand*\@trnslt@date{2017/05/06}
-\newcommand*\@trnslt@version{v1.5c}
+\newcommand*\@trnslt@date{2017/05/16}
+\newcommand*\@trnslt@version{v1.6}
\newcommand*\@trnslt@packageinfo{internationalization of LaTeX2e packages}
\ProvidesPackage{translations}[%
@@ -94,23 +94,6 @@
\fi
}
-% a check for etoolbox's lists where items may contain braces:
-\newbool{@trnslt@inlist}
-\newrobustcmd\@trnslt@ifinlist@type[5]{%
- \def\do##1{%
- \boolfalse{@trnslt@inlist}%
- \ifstrequal{##1}{#2}
- {\booltrue{@trnslt@inlist}\listbreak}
- {}%
- }%
- #1{#3}%
- \ifbool{@trnslt@inlist}
- {#4}
- {#5}%
-}
-\newrobustcmd*\@trnslt@ifinlist{\@trnslt@ifinlist@type\dolistloop}
-\newrobustcmd*\@trnslt@ifinlistcs{\@trnslt@ifinlist@type\dolistcsloop}
-
\long\def\@trnslt@getnext@braced#1#2#3{#2\@trnslt@firstofone{#3{#1}}}
\long\def\@trnslt@firstofone#1{#1}
\long\def\@trnslt@braced@expanded@fully#1\@trnslt@firstofone#2#3{%
@@ -252,11 +235,12 @@
\@trnslt@if@dialect{#2}
{\csletcs{@trnslt@dialect@#1}{@trnslt@dialect@#2}}
{}%
- \@trnslt@ifinlist{#1}\@trnslt@aliases@single
- {}{%
+ \ifcsdef{@trnslt@alias@#1}
+ {}
+ {%
\csdef{@trnslt@alias@#1}{#2}%
- \listeadd\@trnslt@aliases@pair{{#1}{#2}}%
- \listeadd\@trnslt@aliases@single{#1}%
+ \listadd\@trnslt@aliases@pair{{#1}{#2}}%
+ \listadd\@trnslt@aliases@single{#1}%
}%
}
@@ -311,16 +295,16 @@
% #1: language
% #2: word
% #3: replacement
-\newrobustcmd*\declaretranslation[3]{%
+\newrobustcmd\declaretranslation[3]{%
\@trnslt@declare@translation{#2}{#1}{#3}%
}
-\newrobustcmd*\definetranslation[3]{%
+\newrobustcmd\definetranslation[3]{%
\@trnslt@new@translation{#2}{#1}{#3}%
}
-\newrobustcmd*\redefinetranslation[3]{%
+\newrobustcmd\redefinetranslation[3]{%
\@trnslt@renew@translation{#2}{#1}{#3}%
}
-\newrobustcmd*\addtranslation[3]{%
+\newrobustcmd\addtranslation[3]{%
\@trnslt@provide@translation{#2}{#1}{#3}%
}
@@ -358,36 +342,36 @@
% #1: word
% #2: language
% #3: replacement
-\newrobustcmd*\@trnslt@declare@translation[3]{%
+\newrobustcmd\@trnslt@declare@translation[3]{%
\@trnslt@if@language{#2}
{%
\@trnslt@if@dialect{#2}
{%
- \csdef{@trnslt@word@\detokenize{#1}@\@trnslt@dialect{#2}}{#3}%
+ \long\csdef{@trnslt@word@\detokenize{#1}@\@trnslt@dialect{#2}}{#3}%
\@trnslt@if@word\@trnslt@dialect@of{#1}{#2}
{}
- {\csdef{@trnslt@word@\detokenize{#1}@\@trnslt@dialect@of{#2}}{#3}}%
+ {\long\csdef{@trnslt@word@\detokenize{#1}@\@trnslt@dialect@of{#2}}{#3}}%
}
- {\csdef{@trnslt@word@\detokenize{#1}@\@trnslt@language{#2}}{#3}}%
+ {\long\csdef{@trnslt@word@\detokenize{#1}@\@trnslt@language{#2}}{#3}}%
% save the <word> as <word>:
\csdef{@trnslt@word@\detokenize{#1}@literal}{#1}%
}
{\@trnslt@err@unknown@lang{#2}}%
}
-\newrobustcmd*\@trnslt@new@translation[3]{%
+\newrobustcmd\@trnslt@new@translation[3]{%
\@trnslt@if@word\@trnslt@language{#1}{#2}
{\@trnslt@err@already@defined{#1}{#2}}
{\@trnslt@declare@translation{#1}{#2}{#3}}%
}
-\newrobustcmd*\@trnslt@renew@translation[3]{%
+\newrobustcmd\@trnslt@renew@translation[3]{%
\@trnslt@if@word\@trnslt@language{#1}{#2}
{\@trnslt@declare@translation{#1}{#2}{#3}}
{\@trnslt@err@not@defined{#1}{#2}}%
}
-\newrobustcmd*\@trnslt@provide@translation[3]{%
+\newrobustcmd\@trnslt@provide@translation[3]{%
\@trnslt@if@word\@trnslt@language{#1}{#2}
{}
{\@trnslt@declare@translation{#1}{#2}{#3}}%
@@ -661,14 +645,18 @@
{\@trnslt@dictionary@name-\@trnslt@dictionary@lang.trsl}%
[(\@trnslt@dictionary@lang\space translation file `\@trnslt@dictionary@name') #1]}
-% change this test (we can't use braces inside the item with \ifinlist):
\newcommand*\@trnslt@check@dictionary@entry[2]{%
- \@trnslt@ifinlistcs
- {{#1}{#2}}
- {@trnslt@dictionary@\@trnslt@dictionary@name @\@trnslt@dictionary@lang}%
+ \ifcsdef{%
+ @trnslt@dictionary@\@trnslt@dictionary@name
+ @\@trnslt@dictionary@lang @{#1}{\detokenize{#2}}%
+ }%
}
\newrobustcmd*\@trnslt@add@dictionary@entry[2]{%
+ \csdef{%
+ @trnslt@dictionary@\@trnslt@dictionary@name
+ @\@trnslt@dictionary@lang @{#1}{\detokenize{#2}}%
+ }{{#1}{#2}}%
\listcsadd
{@trnslt@dictionary@\@trnslt@dictionary@name @\@trnslt@dictionary@lang}
{{#1}{#2}}%
@@ -1162,3 +1150,5 @@
2017/03/05 v1.5a - correct typos in Dutch dictionary
2017/04/24 v1.5b - correct typos in Malaysian language names
2017/05/06 v1.5c - add Azerbaijani
+2017/05/16 v1.6 - allow translations to contain \par
+ - improve perfomance by replacing list checks