From a41809964596f3f3a1a5de9220c4c1e0a8c9873c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 16 May 2017 21:07:07 +0000 Subject: translations (16may17) git-svn-id: svn://tug.org/texlive/trunk@44381 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/translations/README | 2 +- .../doc/latex/translations/translations_en.pdf | Bin 498266 -> 498253 bytes .../tex/latex/translations/translations.sty | 66 +++++++++------------ 3 files changed, 29 insertions(+), 39 deletions(-) diff --git a/Master/texmf-dist/doc/latex/translations/README b/Master/texmf-dist/doc/latex/translations/README index 57c11ba5a8a..3a992315cce 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.5c - 2017/05/06 +the TRANSLATIONS package v1.6 - 2017/05/16 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 5634ba5c1cd..4469a3fe170 100644 Binary files a/Master/texmf-dist/doc/latex/translations/translations_en.pdf and b/Master/texmf-dist/doc/latex/translations/translations_en.pdf differ 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 as : \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 -- cgit v1.2.3