summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/translations
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-04-21 20:57:19 +0000
committerKarl Berry <karl@freefriends.org>2016-04-21 20:57:19 +0000
commit4be03093334314094136535b74404505a26aa50b (patch)
tree0fe7294a0fd0b487772a3465324b4504fc1ab1f4 /Master/texmf-dist/tex/latex/translations
parent8b231a565e5f97a3bd41deded73be7986ab1cb3e (diff)
translations (21apr16)
git-svn-id: svn://tug.org/texlive/trunk@40659 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/translations')
-rw-r--r--Master/texmf-dist/tex/latex/translations/translations.sty120
1 files changed, 87 insertions, 33 deletions
diff --git a/Master/texmf-dist/tex/latex/translations/translations.sty b/Master/texmf-dist/tex/latex/translations/translations.sty
index 2a59d323f04..23228043c97 100644
--- a/Master/texmf-dist/tex/latex/translations/translations.sty
+++ b/Master/texmf-dist/tex/latex/translations/translations.sty
@@ -8,7 +8,7 @@
% Web: http://www.mychemistry.eu/forums/forum/translations
% E-Mail: contact@mychemistry.eu
% --------------------------------------------------------------------------
-% Copyright 2012-2015 Clemens Niederberger
+% Copyright 2012-2016 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -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/11/07}
-\def\@trnslt@version{v1.2e}
+\def\@trnslt@date{2016/04/19}
+\def\@trnslt@version{v1.3}
\def\@trnslt@info{internationalization of LaTeX2e packages}
\ProvidesPackage{translations}[%
@@ -511,23 +511,65 @@
\@trnslt@load@dictionary@for{#2}{#1}}
\@onlypreamble\LoadDictionaryFor
+\newrobustcmd*\LoadDictionaryForDialect[2]{%
+ \@trnslt@load@dictionary@for@dialect{#2}{#1}}
+\@onlypreamble\LoadDictionaryFor
+
% #1: name
% #2: lang
-\newrobustcmd*\@trnslt@load@dictionary@for[2]{%
+% #3: false
+\newrobustcmd*\@trnslt@input@if@dictionary@exists[3]{%
\AtBeginDocument{%
\InputIfFileExists{#1-\@trnslt@language{#2}.trsl}
{\@trnslt@check@dictionary{#1}{#2}}
- {%
- \@trnslt@warning{dictionary file `#1-\@trnslt@language{#2}.trsl' not
- found.}%
- }%
+ {#3}%
+ }%
+}
+
+% #1: name
+% #2: lang
+% #3: false
+\newrobustcmd*\@trnslt@load@dictionary@for@F[3]{%
+ \@trnslt@input@if@dictionary@exists{#1}{#2}{#3}%
+}
+
+% #1: name
+% #2: lang
+\newrobustcmd*\@trnslt@load@dictionary@for@dialect[2]{%
+ \@trnslt@load@dictionary@for@F{#1}{#2}
+ {%
+ \@trnslt@warning{dictionary file `#1-\@trnslt@language{#2}.trsl' not
+ found.}%
+ }%
+}
+
+% #1: name
+% #2: lang
+\newrobustcmd*\@trnslt@load@dictionary@for[2]{%
+ \@trnslt@load@dictionary@for@F{#1}{#2}
+ {%
+ \@trnslt@load@dictionary@for@F{#1}{\baselanguage{#2}}
+ {%
+ \@trnslt@warning{neither dictionary file
+ `#1-\@trnslt@language{#2}.trsl' nor `#1-\baselanguage{#2}.trsl'
+ found.}%
+ }%
+ }%
+}
+
+\newrobustcmd*\@trnslt@load@dictionary@silent@for[2]{%
+ \@trnslt@load@dictionary@for@F{#1}{#2}{%
+ \@trnslt@load@dictionary@for@F{#1}{\baselanguage{#2}}{}%
}%
}
+% #1: name
+% #2: lang
\newrobustcmd*\@trnslt@check@dictionary[2]{%
\AfterFile{#1-\@trnslt@language{#2}.trsl}
{%
- \ifcsdef{@trnslt@dictionary@#1@\@trnslt@language{#2}}
+ \edef\@trnslt@tmpa{\@trnslt@language{#2}}%
+ \ifcsdef{@trnslt@dictionary@#1@\@trnslt@tmpa}
{\@trnslt@info{loading dictionary `#1' for `#2'.}}
{%
\@trnslt@warning{file `#1-\@trnslt@language{#2}.trsl' does not
@@ -536,16 +578,18 @@
}%
}
-\newcommand*\@trnslt@if@dictionary[2]{\IfFileExists{#1-#2.trsl}}
-
-\newcommand*\@trnslt@load@dictionary@silent@for[2]{\InputIfFileExists{#1-#2.trsl}{}{}}
+% \newcommand*\@trnslt@if@dictionary[2]{\IfFileExists{#1-#2.trsl}}
% --------------------------------------------------------------------------
% the contents of a dictionary; let's declare that is one.
+% #1: lang
+% #2: name
\newrobustcmd*\ProvideDictionaryFor[2]{%
\@trnslt@provide@dictionary@for{#1}{#2}}
\@onlypreamble\ProvideDictionaryFor
+% #1: lang
+% #2: name
\newrobustcmd*\@trnslt@provide@dictionary@for[2]{%
\def\@trnslt@dictionary@name{#2}%
\edef\@trnslt@dictionary@lang{\@trnslt@language{#1}}%
@@ -968,27 +1012,30 @@
% --------------------------------------------------------------------------
% load basic dictionary if available
\AtBeginDocument{%
- \@trnslt@if@dialect{\@trnslt@current@language}
- {%
- \@trnslt@if@dictionary
- {translations-basic-dictionary}
- {\@trnslt@language{\@trnslt@current@language}}%
- {%
- \@trnslt@load@dictionary@silent@for
- {translations-basic-dictionary}
- {\@trnslt@language{\@trnslt@current@language}}%
- }%
- {%
- \@trnslt@load@dictionary@silent@for
- {translations-basic-dictionary}
- {\@trnslt@dialect@of{\@trnslt@current@language}}%
- }
- }
- {%
- \@trnslt@load@dictionary@silent@for
- {translations-basic-dictionary}
- {\@trnslt@language{\@trnslt@current@language}}%
- }%
+ % \@trnslt@if@dialect{\@trnslt@current@language}
+ % {%
+ % \@trnslt@if@dictionary
+ % {translations-basic-dictionary}
+ % {\@trnslt@language{\@trnslt@current@language}}%
+ % {%
+ % \@trnslt@load@dictionary@silent@for
+ % {translations-basic-dictionary}
+ % {\@trnslt@language{\@trnslt@current@language}}%
+ % }%
+ % {%
+ % \@trnslt@load@dictionary@silent@for
+ % {translations-basic-dictionary}
+ % {\@trnslt@dialect@of{\@trnslt@current@language}}%
+ % }
+ % }
+ % {%
+ % \@trnslt@load@dictionary@silent@for
+ % {translations-basic-dictionary}
+ % {\@trnslt@language{\@trnslt@current@language}}%
+ % }%
+ \@trnslt@load@dictionary@silent@for
+ {translations-basic-dictionary}
+ \@trnslt@current@language
}
\endinput
@@ -1058,3 +1105,10 @@
2015/11/07 v1.2e - Some fixes to the French translations in the basic
dictionary, thanks to Denis Bitouz\'e
- add Macedonian language
+2016/01/20 v1.3 - \LoadDictionary first checks if a dictionary for the
+ dialect exists and loads it if it does; else it looks
+ for a dictionary of the base language and loads that
+ instead
+ - New command \LoadDictionaryForDialect which only loads
+ the dictionary for a specified dialect – this doesn't
+ check if a dictionary for a baselanguage exists