diff options
author | Karl Berry <karl@freefriends.org> | 2013-07-17 22:16:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-07-17 22:16:32 +0000 |
commit | b89c6d74de55dd5e434d60c0fb3a81f66ad153db (patch) | |
tree | a6e6f3977c86c34cf8f955d186f2ee064db07d49 /Master/texmf-dist/tex/latex/translations | |
parent | eec0a21648f82e9f409ed8151e1bc83f34bfec79 (diff) |
translations (17jul13)
git-svn-id: svn://tug.org/texlive/trunk@31222 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/translations')
5 files changed, 959 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/translations/translations-basic-dictionary-english.trsl b/Master/texmf-dist/tex/latex/translations/translations-basic-dictionary-english.trsl new file mode 100644 index 00000000000..47dbcbeb39a --- /dev/null +++ b/Master/texmf-dist/tex/latex/translations/translations-basic-dictionary-english.trsl @@ -0,0 +1,87 @@ +\ProvideDictionaryFor{English}{translations-basic-dictionary} + +\DeclareDictTranslation{Abstract}{Abstract} +\DeclareDictTranslation{Addresses}{Addresses} +\DeclareDictTranslation{addresses}{addresses} +\DeclareDictTranslation{Address}{Address} +\DeclareDictTranslation{address}{address} +\DeclareDictTranslation{and}{and} +\DeclareDictTranslation{Appendix}{Appendix} +\DeclareDictTranslation{Authors}{Authors} +\DeclareDictTranslation{authors}{authors} +\DeclareDictTranslation{Author}{Author} +\DeclareDictTranslation{author}{author} +\DeclareDictTranslation{Bibliography}{Bibliography} +\DeclareDictTranslation{cc}{cc} +\DeclareDictTranslation{Chapters}{Chapters} +\DeclareDictTranslation{chapters}{chapters} +\DeclareDictTranslation{Chapter}{Chapter} +\DeclareDictTranslation{chapter}{chapter} +\DeclareDictTranslation{Conclusion}{Conclusion} +\DeclareDictTranslation{conclusion}{conclusion} +\DeclareDictTranslation{Contents}{Contents} +\DeclareDictTranslation{Continuation}{Continuation} +\DeclareDictTranslation{continuation}{continuation} +\DeclareDictTranslation{cont}{cont} +\DeclareDictTranslation{encl (plural)}{encl} +\DeclareDictTranslation{encl (singular)}{encl} +\DeclareDictTranslation{encl}{encl} +\DeclareDictTranslation{Figures}{Figures} +\DeclareDictTranslation{figures}{figures} +\DeclareDictTranslation{Figure}{Figure} +\DeclareDictTranslation{figure}{figure} +\DeclareDictTranslation{From}{From} +\DeclareDictTranslation{from}{from} +\DeclareDictTranslation{Glossary}{Glossary} +\DeclareDictTranslation{Index}{Index} +\DeclareDictTranslation{Introduction}{Introduction} +\DeclareDictTranslation{introduction}{introduction} +\DeclareDictTranslation{List of Figures and Tables}{List of Figures and Tables} +\DeclareDictTranslation{List of Figures}{List of Figures} +\DeclareDictTranslation{List of Tables}{List of Tables} +\DeclareDictTranslation{or}{or} +\DeclareDictTranslation{Outline}{Outline} +\DeclareDictTranslation{Overview}{Overview} +\DeclareDictTranslation{Pages}{Pages} +\DeclareDictTranslation{pages}{pages} +\DeclareDictTranslation{Page}{Page} +\DeclareDictTranslation{page}{page} +\DeclareDictTranslation{Paragraphs}{Paragraphs} +\DeclareDictTranslation{paragraphs}{paragraphs} +\DeclareDictTranslation{Paragraph}{Paragraph} +\DeclareDictTranslation{paragraph}{paragraph} +\DeclareDictTranslation{Parts}{Parts} +\DeclareDictTranslation{parts}{parts} +\DeclareDictTranslation{Part}{Part} +\DeclareDictTranslation{part}{part} +\DeclareDictTranslation{Preface}{Preface} +\DeclareDictTranslation{Proofs}{Proofs} +\DeclareDictTranslation{proofs}{proofs} +\DeclareDictTranslation{Proof}{Proof} +\DeclareDictTranslation{proof}{proof} +\DeclareDictTranslation{References}{References} +\DeclareDictTranslation{Related work}{Related work} +\DeclareDictTranslation{Related Work}{Related Work} +\DeclareDictTranslation{Sections}{Sections} +\DeclareDictTranslation{sections}{sections} +\DeclareDictTranslation{Section}{Section} +\DeclareDictTranslation{section}{section} +\DeclareDictTranslation{See also}{See also} +\DeclareDictTranslation{see also}{see also} +\DeclareDictTranslation{See}{See} +\DeclareDictTranslation{see}{see} +\DeclareDictTranslation{Sketch of Proofs}{Sketch of Proofs} +\DeclareDictTranslation{Sketch of proofs}{Sketch of proofs} +\DeclareDictTranslation{Sketch of Proof}{Sketch of Proof} +\DeclareDictTranslation{Sketch of proof}{Sketch of proof} +\DeclareDictTranslation{Subsections}{Subsections} +\DeclareDictTranslation{subsections}{subsections} +\DeclareDictTranslation{Subsection}{Subsection} +\DeclareDictTranslation{subsection}{subsection} +\DeclareDictTranslation{Summary}{Summary} +\DeclareDictTranslation{Tables}{Tables} +\DeclareDictTranslation{tables}{tables} +\DeclareDictTranslation{Table}{Table} +\DeclareDictTranslation{table}{table} +\DeclareDictTranslation{To}{To} +\DeclareDictTranslation{to}{to} diff --git a/Master/texmf-dist/tex/latex/translations/translations-basic-dictionary-french.trsl b/Master/texmf-dist/tex/latex/translations/translations-basic-dictionary-french.trsl new file mode 100644 index 00000000000..ce4965a5475 --- /dev/null +++ b/Master/texmf-dist/tex/latex/translations/translations-basic-dictionary-french.trsl @@ -0,0 +1,87 @@ +\ProvideDictionaryFor{French}{translations-basic-dictionary} + +\DeclareDictTranslation{Abstract}{R\'{e}sum\'{e}} +\DeclareDictTranslation{Addresses}{Adresses} +\DeclareDictTranslation{addresses}{adresses} +\DeclareDictTranslation{Address}{Adresse} +\DeclareDictTranslation{address}{adresse} +\DeclareDictTranslation{and}{et} +\DeclareDictTranslation{Appendix}{Annexe} +\DeclareDictTranslation{Authors}{Auteurs} +\DeclareDictTranslation{authors}{auteur} +\DeclareDictTranslation{Author}{Auteur} +\DeclareDictTranslation{author}{auteur} +\DeclareDictTranslation{Bibliography}{Bibliographie} +\DeclareDictTranslation{cc}{Copie \`{a} } +\DeclareDictTranslation{Chapters}{Chapitres} +\DeclareDictTranslation{chapters}{chapitres} +\DeclareDictTranslation{Chapter}{Chapitre} +\DeclareDictTranslation{chapter}{chapitre} +\DeclareDictTranslation{Conclusion}{Conclusion} +\DeclareDictTranslation{conclusion}{conclusion} +\DeclareDictTranslation{Contents}{Contenu} +\DeclareDictTranslation{Continuation}{Suite} +\DeclareDictTranslation{continuation}{suite} +\DeclareDictTranslation{cont}{suite} % FIXME: unsure +\DeclareDictTranslation{encl (plural)}{P.~J.} +\DeclareDictTranslation{encl (singular)}{P.~J.} +\DeclareDictTranslation{encl}{P.~J.} +\DeclareDictTranslation{Figures}{Figures} +\DeclareDictTranslation{figures}{figures} +\DeclareDictTranslation{Figure}{Figure} +\DeclareDictTranslation{figure}{figure} +\DeclareDictTranslation{From}{De} +\DeclareDictTranslation{from}{de} +\DeclareDictTranslation{Glossary}{Glossaire} +\DeclareDictTranslation{Index}{Index} +\DeclareDictTranslation{Introduction}{Introduction} +\DeclareDictTranslation{introduction}{introduction} +\DeclareDictTranslation{List of Figures and Tables}{Liste des figures et des tableaux} +\DeclareDictTranslation{List of Figures}{Liste des figures} +\DeclareDictTranslation{List of Tables}{Liste des tableaux} +\DeclareDictTranslation{or}{ou} +\DeclareDictTranslation{Outline}{Plan} +\DeclareDictTranslation{Overview}{Sommaire} +\DeclareDictTranslation{Pages}{Pages} +\DeclareDictTranslation{pages}{pages} +\DeclareDictTranslation{Page}{Page} +\DeclareDictTranslation{page}{page} +\DeclareDictTranslation{Paragraphs}{Paragraphes} +\DeclareDictTranslation{paragraphs}{paragraphes} +\DeclareDictTranslation{Paragraph}{Paragraphe} +\DeclareDictTranslation{paragraph}{paragraphe} +\DeclareDictTranslation{Parts}{Parties} +\DeclareDictTranslation{parts}{parties} +\DeclareDictTranslation{Part}{Partie} +\DeclareDictTranslation{part}{partie} +\DeclareDictTranslation{Preface}{Pr\'{e}face} +\DeclareDictTranslation{Proofs}{D\'{e}monstrations} +\DeclareDictTranslation{proofs}{d\'{e}monstrations} +\DeclareDictTranslation{Proof}{D\'{e}monstration} +\DeclareDictTranslation{proof}{d\'{e}monstration} +\DeclareDictTranslation{References}{R\'{e}f\'{e}rences} +\DeclareDictTranslation{Related work}{travaux connexes} +\DeclareDictTranslation{Related Work}{Travaux connexes} +\DeclareDictTranslation{Sections}{Sections} +\DeclareDictTranslation{sections}{sections} +\DeclareDictTranslation{Section}{Section} +\DeclareDictTranslation{section}{section} +\DeclareDictTranslation{See also}{Voir aussi} +\DeclareDictTranslation{see also}{voir aussi} +\DeclareDictTranslation{See}{Voir} +\DeclareDictTranslation{see}{voir} +\DeclareDictTranslation{Sketch of Proofs}{Esquisse de preuves} +\DeclareDictTranslation{Sketch of proofs}{Esquisse de preuves} +\DeclareDictTranslation{Sketch of Proof}{Esquisse de preuve} +\DeclareDictTranslation{Sketch of proof}{Esquisse de preuve} +\DeclareDictTranslation{Subsections}{Sous-sections} +\DeclareDictTranslation{subsections}{sous-sections} +\DeclareDictTranslation{Subsection}{Sous-section} +\DeclareDictTranslation{subsection}{sous-section} +\DeclareDictTranslation{Summary}{R\'{e}sum\'{e}} +\DeclareDictTranslation{Tables}{Tables} +\DeclareDictTranslation{tables}{tables} +\DeclareDictTranslation{Table}{Table} +\DeclareDictTranslation{table}{table} +\DeclareDictTranslation{To}{Vers}%?? +\DeclareDictTranslation{to}{vers}%?? diff --git a/Master/texmf-dist/tex/latex/translations/translations-basic-dictionary-german.trsl b/Master/texmf-dist/tex/latex/translations/translations-basic-dictionary-german.trsl new file mode 100644 index 00000000000..95732490944 --- /dev/null +++ b/Master/texmf-dist/tex/latex/translations/translations-basic-dictionary-german.trsl @@ -0,0 +1,87 @@ +\ProvideDictionaryFor{German}{translations-basic-dictionary} + +\DeclareDictTranslation{Abstract}{Zusammenfassung} +\DeclareDictTranslation{Addresses}{Adressen} +\DeclareDictTranslation{addresses}{Adressen} +\DeclareDictTranslation{Address}{Adresse} +\DeclareDictTranslation{address}{Adresse} +\DeclareDictTranslation{and}{und} +\DeclareDictTranslation{Appendix}{Anhang} +\DeclareDictTranslation{Authors}{Autoren} +\DeclareDictTranslation{authors}{Autoren} +\DeclareDictTranslation{Author}{Autor} +\DeclareDictTranslation{author}{Autor} +\DeclareDictTranslation{Bibliography}{Literaturverzeichnis} +\DeclareDictTranslation{cc}{Verteiler} +\DeclareDictTranslation{Chapters}{Kapitel} +\DeclareDictTranslation{chapters}{Kapitel} +\DeclareDictTranslation{Chapter}{Kapitel} +\DeclareDictTranslation{chapter}{Kapitel} +\DeclareDictTranslation{Conclusion}{Zusammenfassung} +\DeclareDictTranslation{conclusion}{Zusammenfassung} +\DeclareDictTranslation{Contents}{Inhaltsverzeichnis} +\DeclareDictTranslation{Continuation}{Fortsetzung} +\DeclareDictTranslation{continuation}{Fortsetzung} +\DeclareDictTranslation{cont}{Forts} +\DeclareDictTranslation{encl (plural)}{Anlagen} +\DeclareDictTranslation{encl (singular)}{Anlage} +\DeclareDictTranslation{encl}{Anlage(n)} +\DeclareDictTranslation{Figures}{Abbildungen} +\DeclareDictTranslation{figures}{Abbildungen} +\DeclareDictTranslation{Figure}{Abbildung} +\DeclareDictTranslation{figure}{Abbildung} +\DeclareDictTranslation{From}{Von} +\DeclareDictTranslation{from}{von} +\DeclareDictTranslation{Glossary}{Glossar} +\DeclareDictTranslation{Index}{Index} +\DeclareDictTranslation{Introduction}{Einleitung} +\DeclareDictTranslation{introduction}{Einleitung} +\DeclareDictTranslation{List of Figures and Tables}{Abbildungs- und Tabellenverzeichnis} +\DeclareDictTranslation{List of Figures}{Abbildungsverzeichnis} +\DeclareDictTranslation{List of Tables}{Tabellenverzeichnis} +\DeclareDictTranslation{or}{oder} +\DeclareDictTranslation{Outline}{Gliederung} +\DeclareDictTranslation{Overview}{\"Uber\-sicht} +\DeclareDictTranslation{Pages}{Seiten} +\DeclareDictTranslation{pages}{Seiten} +\DeclareDictTranslation{Page}{Seite} +\DeclareDictTranslation{page}{Seite} +\DeclareDictTranslation{Paragraphs}{Ab\-s\"at\-ze} +\DeclareDictTranslation{paragraphs}{Ab\-s\"at\-ze} +\DeclareDictTranslation{Paragraph}{Absatz} +\DeclareDictTranslation{paragraph}{Absatz} +\DeclareDictTranslation{Parts}{Teile} +\DeclareDictTranslation{parts}{Teile} +\DeclareDictTranslation{Part}{Teil} +\DeclareDictTranslation{part}{Teil} +\DeclareDictTranslation{Preface}{Vorwort} +\DeclareDictTranslation{Proofs}{Beweise} +\DeclareDictTranslation{proofs}{Beweise} +\DeclareDictTranslation{Proof}{Beweis} +\DeclareDictTranslation{proof}{Beweis} +\DeclareDictTranslation{References}{Literatur} +\DeclareDictTranslation{Related work}{Verwandte Arbeiten} +\DeclareDictTranslation{Related Work}{Verwandte Arbeiten} +\DeclareDictTranslation{Sections}{Abschnitte} +\DeclareDictTranslation{sections}{Abschnitte} +\DeclareDictTranslation{Section}{Abschnitt} +\DeclareDictTranslation{section}{Abschnitt} +\DeclareDictTranslation{See also}{Siehe auch} +\DeclareDictTranslation{see also}{siehe auch} +\DeclareDictTranslation{See}{Siehe} +\DeclareDictTranslation{see}{siehe} +\DeclareDictTranslation{Sketch of Proofs}{Beweisskizzen} +\DeclareDictTranslation{Sketch of proofs}{Beweisskizzen} +\DeclareDictTranslation{Sketch of Proof}{Beweisskizze} +\DeclareDictTranslation{Sketch of proof}{Beweisskizze} +\DeclareDictTranslation{Subsections}{Unterabschnitte} +\DeclareDictTranslation{subsections}{Unterabschnitte} +\DeclareDictTranslation{Subsection}{Unterabschnitt} +\DeclareDictTranslation{subsection}{Unterabschnitt} +\DeclareDictTranslation{Summary}{Zusammenfassung} +\DeclareDictTranslation{Tables}{Tabellen} +\DeclareDictTranslation{tables}{Tabellen} +\DeclareDictTranslation{Table}{Tabelle} +\DeclareDictTranslation{table}{Tabelle} +\DeclareDictTranslation{To}{An} +\DeclareDictTranslation{to}{an} diff --git a/Master/texmf-dist/tex/latex/translations/translations-basic-dictionary-spanish.trsl b/Master/texmf-dist/tex/latex/translations/translations-basic-dictionary-spanish.trsl new file mode 100644 index 00000000000..69e0824b103 --- /dev/null +++ b/Master/texmf-dist/tex/latex/translations/translations-basic-dictionary-spanish.trsl @@ -0,0 +1,87 @@ +\ProvideDictionaryFor{Spanish}{translations-basic-dictionary} + +\DeclareDictTranslation{Abstract}{Resumen} +\DeclareDictTranslation{Addresses}{Direcciones} +\DeclareDictTranslation{addresses}{direcciones} +\DeclareDictTranslation{Address}{Direcci\'{o}n} +\DeclareDictTranslation{address}{direcci\'{o}n} +\DeclareDictTranslation{and}{y} +\DeclareDictTranslation{Appendix}{Ap\'{e}ndice} +\DeclareDictTranslation{Authors}{Autores} +\DeclareDictTranslation{authors}{autores} +\DeclareDictTranslation{Author}{Autor} +\DeclareDictTranslation{author}{autor} +\DeclareDictTranslation{Bibliography}{Bibliograf\'{\i}a} +\DeclareDictTranslation{cc}{c.c.} +\DeclareDictTranslation{Chapters}{Cap\'{\i}tulos} +\DeclareDictTranslation{chapters}{cap\'{\i}tulos} +\DeclareDictTranslation{Chapter}{Cap\'{\i}tulo} +\DeclareDictTranslation{chapter}{cap\'{\i}tulo} +\DeclareDictTranslation{Conclusion}{Conclusi\'{o}n} +\DeclareDictTranslation{conclusion}{conclusi\'{o}n} +\DeclareDictTranslation{Contents}{Contenido} +\DeclareDictTranslation{Continuation}{Continuaci\'{o}n} +\DeclareDictTranslation{continuation}{continuaci\'{o}n} +\DeclareDictTranslation{cont}{cont} +\DeclareDictTranslation{encl (plural)}{adj.} +\DeclareDictTranslation{encl (singular)}{adj.} +\DeclareDictTranslation{encl}{adj.} +\DeclareDictTranslation{Figures}{Figuras} +\DeclareDictTranslation{figures}{figuras} +\DeclareDictTranslation{Figure}{Figura} +\DeclareDictTranslation{figure}{figura} +\DeclareDictTranslation{From}{Desde} +\DeclareDictTranslation{from}{desde} +\DeclareDictTranslation{Glossary}{Glosario} +\DeclareDictTranslation{Index}{\'{I}ndice} +\DeclareDictTranslation{Introduction}{Introducci\'{o}n} +\DeclareDictTranslation{introduction}{introducci\'{o}n} +\DeclareDictTranslation{List of Figures and Tables}{Lista de Figuras y Tablas} +\DeclareDictTranslation{List of Figures}{Lista de Figuras} +\DeclareDictTranslation{List of Tables}{Lista de Tablas} +\DeclareDictTranslation{or}{o} +\DeclareDictTranslation{Outline}{Esbozo} +\DeclareDictTranslation{Overview}{Visi\'{o}n General} +\DeclareDictTranslation{Pages}{P\'{a}ginas} +\DeclareDictTranslation{pages}{p\'{a}ginas} +\DeclareDictTranslation{Page}{P\'{a}gina} +\DeclareDictTranslation{page}{p\'{a}gina} +\DeclareDictTranslation{Paragraphs}{P\'{a}rrafos} +\DeclareDictTranslation{paragraphs}{p\'{a}rrafos} +\DeclareDictTranslation{Paragraph}{P\'{a}rrafo} +\DeclareDictTranslation{paragraph}{p\'{a}rrafo} +\DeclareDictTranslation{Parts}{Partes} +\DeclareDictTranslation{parts}{partes} +\DeclareDictTranslation{Part}{Parte} +\DeclareDictTranslation{part}{parte} +\DeclareDictTranslation{Preface}{Prefacio} +\DeclareDictTranslation{Proofs}{Demostraciones} +\DeclareDictTranslation{proofs}{demostraciones} +\DeclareDictTranslation{Proof}{Demostraci\'{o}n} +\DeclareDictTranslation{proof}{demostraci\'{o}n} +\DeclareDictTranslation{References}{Referencias} +\DeclareDictTranslation{Related work}{Trabajo relacionado} +\DeclareDictTranslation{Related Work}{Trabajo Relacionado} +\DeclareDictTranslation{Sections}{Secciones} +\DeclareDictTranslation{sections}{secciones} +\DeclareDictTranslation{Section}{Secci\'{o}n} +\DeclareDictTranslation{section}{secci\'{o}n} +\DeclareDictTranslation{See also}{Ver tambi\'{e}n} +\DeclareDictTranslation{see also}{ver tambi\'{e}n} +\DeclareDictTranslation{See}{Ver} +\DeclareDictTranslation{see}{ver} +\DeclareDictTranslation{Sketch of Proofs}{Esbozo de Demostraciones} +\DeclareDictTranslation{Sketch of proofs}{Esbozo de demostraciones} +\DeclareDictTranslation{Sketch of Proof}{Esbozo de Demostraci\'{o}n} +\DeclareDictTranslation{Sketch of proof}{Esbozo de demostraci\'{o}n} +\DeclareDictTranslation{Subsections}{Subsecciones} +\DeclareDictTranslation{subsections}{subsecciones} +\DeclareDictTranslation{Subsection}{Subsecci\'{o}n} +\DeclareDictTranslation{subsection}{subsecci\'{o}n} +\DeclareDictTranslation{Summary}{Resumen} +\DeclareDictTranslation{Tables}{Tablas} +\DeclareDictTranslation{tables}{tablas} +\DeclareDictTranslation{Table}{Tabla} +\DeclareDictTranslation{table}{tabla} +\DeclareDictTranslation{To}{Hasta} +\DeclareDictTranslation{to}{hasta} diff --git a/Master/texmf-dist/tex/latex/translations/translations.sty b/Master/texmf-dist/tex/latex/translations/translations.sty new file mode 100644 index 00000000000..ddf88b8240f --- /dev/null +++ b/Master/texmf-dist/tex/latex/translations/translations.sty @@ -0,0 +1,611 @@ +% -------------------------------------------------------------------------- +% the TRANSLATIONS package +% +% a simple translator +% +% This package is part of the exsheets bundle +% -------------------------------------------------------------------------- +% Clemens Niederberger +% Web: https://github.com/cgnieder/translations +% E-Mail: contact@mychemistry.eu +% -------------------------------------------------------------------------- +% Copyright 2012 Clemens Niederberger +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Clemens Niederberger. +% -------------------------------------------------------------------------- +% The translations package is part of the exsheets bundle. +% -------------------------------------------------------------------------- +% If you have any ideas, questions, suggestions or bugs to report, please +% feel free to contact me. +% -------------------------------------------------------------------------- +\def\@trnslt@date{2013/07/16} +\def\@trnslt@version{v1.0} + +\ProvidesPackage{translations}[\@trnslt@date\space \@trnslt@version\space a simple translator] +\RequirePackage{etoolbox,scrlfile} + +% -------------------------------------------------------------------------- +% message handling +\def\@trnslt@error@message{% + For details have a look at the `translations' manual.} + +\def\@trnslt@create@message#1{% + \ifstrequal{#1}{Error} + {% + \lowercase{\csdef{@trnslt@#1}}##1{% + \csuse{Package#1}{translations}{##1}{\@trnslt@error@message}}% + }{% + \lowercase{\csdef{@trnslt@#1}}##1{% + \csuse{Package#1}{translations}{##1}}% + }} +\@trnslt@create@message{Error} +\@trnslt@create@message{Warning} +\@trnslt@create@message{WarningNoLine} +\@trnslt@create@message{Info} + +\def\@trnslt@err@unknown@lang#1{% + \@trnslt@error{Unknown language `#1'}} + +\def\@trnslt@warn@unknown@lang#1{% + \@trnslt@warning{Unknown language `#1'}} + +\def\@trnslt@err@already@defined#1#2{% + \@trnslt@error{The #2 translation for `#1' is already defined.}} + +\def\@trnslt@err@not@defined#1#2{% + \@trnslt@error{The \@trnslt@language{#2} translation for `#1' is not defined yet.}} + +% -------------------------------------------------------------------------- +% check if babel or polyglossia is used +\AtEndPreamble{ + \@ifpackageloaded{babel}{}{ + \@ifpackageloaded{polyglossia}{} + {\@trnslt@warning{No language package found. I am going to use `english' + as default language.}} + } + \ifdef\languagename{} + {\def\languagename{english}} + \def\@trnslt@current@language{\languagename} + \ifdef\bbl@afterfi{} + {\long\def\bbl@afterfi#1\fi{\fi#1}} +} + +% -------------------------------------------------------------------------- +% book keeping: the following macros will be used as `etoolbox' lists that +% keep record of defined languages, dialects and aliases +\def\@trnslt@languages{}% all languages +\def\@trnslt@aliases@pair{}% all aliases and their base +\def\@trnslt@aliases@single{}% all aliases +\def\@trnslt@dialects@pair{}% all dialects and their base +\def\@trnslt@dialects@single{}% all dialects + +% -------------------------------------------------------------------------- +% define \@trnslt@if@<name> conditionals that don't leave the checked macro as +% \relax behind and check for \@trnslt@<name>@#1. These conditionals should +% also be expandable in an \edef-like context: +\def\@trnslt@newif#1{% + \csdef{@trnslt@if@#1}##1{% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \@firstofone + {\expandafter\expandafter\expandafter}% + \ifcsname @trnslt@#1@##1\endcsname + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi + }% +} + +% -------------------------------------------------------------------------- +% \DeclareLanguage +% #1: language +\newrobustcmd*\DeclareLanguage[1]{% + \@trnslt@declare@language{#1}} +\@onlypreamble\DeclareLanguage + +\def\@trnslt@declare@language#1{% + \@trnslt@if@language{#1} + {}{% + \csdef{@trnslt@language@#1}{#1}% + \listeadd\@trnslt@languages{#1}% + }% +} + +\def\@trnslt@language#1{% + \csuse{@trnslt@language@#1}} + +\@trnslt@newif{language} + +% -------------------------------------------------------------------------- +% \DeclareLanguageDialect +% #1: dialect +% #2: language +\newrobustcmd*\DeclareLanguageDialect[2]{% + \@trnslt@declare@languagedialect{#1}{#2}} +\@onlypreamble\DeclareLanguageDialect + +\def\@trnslt@declare@languagedialect#1#2{% + \@trnslt@if@language{#2} + {}{% + \@trnslt@warn@unknown@lang{#2}% + \@trnslt@declare@language{#2}% + }% + \@trnslt@if@dialect{#1} + {% => ist schon als dialect definiert => irgendwelche weiteren checks? + } + {% + \@trnslt@if@alias{#2} + {% + \csedef{@trnslt@dialect@#1}{{\@trnslt@alias{#2}}{#1}}% + \@trnslt@declare@language{#1}% + \listeadd\@trnslt@dialects@single{#1}% + \listeadd\@trnslt@dialects@pair{{#1}{\@trnslt@alias{#2}}}% + } + {% + \csdef{@trnslt@dialect@#1}{{#2}{#1}}% + \@trnslt@declare@language{#1}% + \listeadd\@trnslt@dialects@single{#1}% + \listeadd\@trnslt@dialects@pair{{#1}{#2}}% + }% + }% +} + +\def\@trnslt@dialect#1{% + \csuse{@trnslt@dialect@#1}} + +% this macros fetches the base language for a given dialect, expandably: +\def\@trnslt@dialect@of#1{% + \@trnslt@if@dialect{#1} + {% + \expandafter\expandafter\expandafter + \@firstoftwo + \csname @trnslt@dialect@#1\endcsname + }{}% +} + +\@trnslt@newif{dialect} + +% -------------------------------------------------------------------------- +% \DeclareLanguageAlias +% #1: alias +% #2: language +\newrobustcmd*\DeclareLanguageAlias[2]{% + \@trnslt@declare@languagealias{#1}{#2}} +\@onlypreamble\DeclareLanguageAlias + +\def\@trnslt@declare@languagealias#1#2{% + \@trnslt@if@language{#2} + {}{% + \@trnslt@warn@unknown@lang{#2}% + \@trnslt@declare@language{#2}% + }% + \csletcs{@trnslt@language@#1}{@trnslt@language@#2}% + \@trnslt@if@dialect{#2} + {\csletcs{@trnslt@dialect@#1}{@trnslt@dialect@#2}} + {}% + \ifinlist{#1}\@trnslt@aliases@single + {}{% + \csdef{@trnslt@alias@#1}{#2}% + \listeadd\@trnslt@aliases@pair{{#1}{#2}}% + \listeadd\@trnslt@aliases@single{#1}% + }% +} + +\def\@trnslt@alias#1{% + \csuse{@trnslt@alias@#1}} + +\@trnslt@newif{alias} + +% -------------------------------------------------------------------------- +% dummy language: `fallback': +\DeclareLanguage{fallback} +\DeclareLanguageAlias{Fallback}{fallback} + +% -------------------------------------------------------------------------- +% \DeclareTranslation, \NewTranslation and \RenewTranslation +% #1: language +% #2: word +% #3: replacement +\newrobustcmd*\DeclareTranslation[3]{% + \@trnslt@declare@translation{#2}{#1}{#3}} +\@onlypreamble\DeclareTranslation + +\newrobustcmd*\DeclareTranslationFallback[2]{% + \@trnslt@declare@translation{#1}{fallback}{#2}} +\@onlypreamble\DeclareTranslationFallback + +\newrobustcmd*\NewTranslation[3]{% + \@trnslt@new@translation{#2}{#1}{#3}} +\@onlypreamble\NewTranslation + +\newrobustcmd*\RenewTranslation[3]{% + \@trnslt@renew@translation{#2}{#1}{#3}} +\@onlypreamble\RenewTranslation + +% #1: word +% #2: language +% #3: replacement +\def\@trnslt@declare@translation#1#2#3{% + \@trnslt@if@language{#2} + {% + \@trnslt@if@dialect{#2} + {% + \csdef{@trnslt@word@#1@\@trnslt@dialect{#2}}{#3}% + \@trnslt@if@word\@trnslt@dialect@of{#1}{#2} + {} + {\csdef{@trnslt@word@#1@\@trnslt@dialect@of{#2}}{#3}}% + } + {\csdef{@trnslt@word@#1@\@trnslt@language{#2}}{#3}}% + % save the <word> as <word>: + \csdef{@trnslt@word@#1@literal}{#1}% + } + {\@trnslt@err@unknown@lang{#2}}% +} + +\def\@trnslt@new@translation#1#2#3{% + \@trnslt@if@translation{#1}{#2} + {\@trnslt@err@already@defined{#1}{#2}} + {\@trnslt@declare@translation{#1}{#2}{#3}}} + +\def\@trnslt@renew@translation#1#2#3{% + \@trnslt@if@translation{#1}{#2} + {\@trnslt@declare@translation{#1}{#2}{#3}} + {\@trnslt@err@not@defined{#1}{#2}}} + +% -------------------------------------------------------------------------- +% now let's go through some trouble to check if a translation exists: +\def\@trnslt@if@word#1#2#3{% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \@firstofone + {\expandafter\expandafter\expandafter}% + \ifcsname @trnslt@word@#2@#1{#3}\endcsname + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +}% + +\def\@trnslt@if@translation#1#2{% + \@trnslt@if@word\@trnslt@language{#1}{#2} + {\expandafter\@firstoftwo} + {% + \@trnslt@if@dialect{#2} + {% + \@trnslt@if@word\@trnslt@dialect{#1}{#2} + {\expandafter\@firstoftwo} + {% + \@trnslt@if@word\@trnslt@dialect@of{#1}{#2} + {\expandafter\@firstoftwo} + {\expandafter\@secondoftwo}% + } + } + {\expandafter\@secondoftwo}% + }% +} + +% -------------------------------------------------------------------------- +% \GetTranslationFor and \GetTranslation +% these need to be expandable! +% #1: language +% #2: word +\newcommand*\GetTranslationFor[2]{% + \@trnslt@checkandget@translation@for{#2}{#1}} + +\newcommand*\GetTranslation[1]{% + \@trnslt@checkandget@translation@for{#1}{\@trnslt@current@language}} + +% unexpandable version of the commands that raise a warning if no translation +% is available: +\newcommand*\GetTranslationForWarn[2]{% + \@trnslt@getandwarn@translation@for{#2}{#1}} + +\newcommand*\GetTranslationWarn[1]{% + \@trnslt@getandwarn@translation@for{#1}{\@trnslt@current@language}} + +% #1: word #2: language +\def\@trnslt@get@translation@for#1#2{% + \@trnslt@if@dialect{#2} + {% + \ifcsdef{@trnslt@word@#1@\@trnslt@dialect{#2}} + {\csuse{@trnslt@word@#1@\@trnslt@dialect{#2}}} + {\csuse{@trnslt@word@#1@\@trnslt@dialect@of{#2}}}% + } + {\csuse{@trnslt@word@#1@\@trnslt@language{#2}}}% +} + +\def\@trnslt@checkandget@translation@for#1#2{% + \@trnslt@if@translation{#1}{#2} + {\@trnslt@get@translation@for{#1}{#2}} + {% + \@trnslt@if@translation{#1}{fallback} + {\csuse{@trnslt@word@#1@fallback}} + {\csuse{@trnslt@word@#1@literal}}% + }% +} + +% this is not expandable! +\protected\def\@trnslt@getandwarn@translation@for#1#2{% + \@trnslt@if@translation{#1}{#2} + {\@trnslt@get@translation@for{#1}{#2}} + {% + \@trnslt@warning{Translation for `#1' in #2 unknown. You may try to use + \string\DeclareTranslation{#2}{#1}{ ... } in your preamble.}% + \@trnslt@if@translation{#1}{fallback} + {% + \@trnslt@info{Using fallback translation for `#1'}% + \csuse{@trnslt@word@#1@fallback} + } + {\csuse{@trnslt@word@#1@literal}}% + }% +} + +% -------------------------------------------------------------------------- +% \SaveTranslationFor and \SaveTranslation +\newrobustcmd*\SaveTranslationFor[3]{% + \@trnslt@save@translation@for{#1}{#3}{#2}} + +\newrobustcmd*\SaveTranslation[2]{% + \@trnslt@save@translation@for{#1}{#2}{\@trnslt@current@language}} + +\def\@trnslt@save@translation@for#1#2#3{% + \edef#1{% + \@trnslt@if@translation{#2}{#3} + {\csuse{@trnslt@word@#2@\@trnslt@language{#3}}} + {}% + }} + +% -------------------------------------------------------------------------- +% \LoadDictionary and \LoadDictionaryFor +\newrobustcmd*\LoadDictionary[1]{% + \@trnslt@load@dictionary@for{#1}{\@trnslt@current@language}} +\@onlypreamble\LoadDictionary + +\newrobustcmd*\LoadDictionaryFor[2]{% + \@trnslt@load@dictionary@for{#2}{#1}} +\@onlypreamble\LoadDictionaryFor + +% #1: name +% #2: lang +\def\@trnslt@load@dictionary@for#1#2{% + \AtBeginDocument{% + \InputIfFileExists{#1-\@trnslt@language{#2}.trsl} + {\@trnslt@check@dictionary{#1}{#2}} + {\@trnslt@warning{dictionary file `#1-\@trnslt@language{#2}.trsl' not + found.}}% + }} + +\def\@trnslt@check@dictionary#1#2{% + \AfterFile{#1-\@trnslt@language{#2}.trsl} + {% + \ifcsdef{@trnslt@dictionary@#1@\@trnslt@language{#2}} + {\@trnslt@info{loading dictionary `#1' for `#2'.}} + {% + \@trnslt@warning{file `#1-\@trnslt@language{#2}.trsl' does not + appear to be a dictionary}% + }% + }% +} + +\def\@trnslt@load@dictionary@silent@for#1#2{% + \AtBeginDocument{\InputIfFileExists{#1-\@trnslt@language{#2}.trsl}{}{}}} + +\newrobustcmd*\ProvideDictionaryFor[2]{% + \@trnslt@provide@dictionary@for{#1}{#2}} +\@onlypreamble\ProvideDictionaryFor + +\def\@trnslt@provide@dictionary@for#1#2{% + \def\@trnslt@dictionary@name{#2}% + \edef\@trnslt@dictionary@lang{\@trnslt@language{#1}}% + % this macro can be used to check if we have a dictionary and will also be + % used as a list for the dictionary entries: + \csdef{@trnslt@dictionary@\@trnslt@dictionary@name @\@trnslt@dictionary@lang}{}% + \@ifnextchar[ + {\@trnslt@provide@dictionary@version} + { + \ProvidesFile + {#2-\@trnslt@dictionary@lang.trsl}% + [(\@trnslt@dictionary@lang\space translation file `#2')] + }% +} + +\def\@trnslt@provide@dictionary@version[#1]{% + \ProvidesFile + {\@trnslt@dictionary@name-\@trnslt@dictionary@lang.trsl}% + [(\@trnslt@dictionary@lang\space translation file `\@trnslt@dictionary@name') #1]} + +% \@trnslt@dictionary@language +\newrobustcmd*\DeclareDictTranslation[2]{% + \listcsadd + {@trnslt@dictionary@\@trnslt@dictionary@name @\@trnslt@dictionary@lang} + {{#1}{#2}}% + \@trnslt@declare@translation{#1}{\@trnslt@dictionary@lang}{#2}% +} +\@onlypreamble\DeclareDictTranslation + +% \PrintDictionaryFor +% #1: lang +% #2: name +% #3: pre +% #4: mid +% #5: post +\newcommand*\PrintDictionaryFor[5]{% + \@trnslt@print@dictionary@for{#1}{#2}{#3}{#4}{#5}} + +% #1: lang +% #2: name +% #3: pre +% #4: mid +% #5: post +\def\@trnslt@print@dictionary@for#1#2#3#4#5{% + \forlistcsloop + {\@trnslt@print@dictionary@entry{#3}{#4}{#5}} + {@trnslt@dictionary@#2@\@trnslt@language{#1}}% +} + +% #1: pre +% #2: mid +% #3: post +% #4: {key}{translation} +\def\@trnslt@print@dictionary@entry#1#2#3#4{% + \@trnslt@print@dictionary@entry@aux{#1}{#2}{#3}#4} + +% #1: pre +% #2: mid +% #3: post +% #4: key +% #5: translation +\def\@trnslt@print@dictionary@entry@aux#1#2#3#4#5{#1#4#2#5#3} + +% -------------------------------------------------------------------------- +% predefined languages +\DeclareLanguage{albanian} +\DeclareLanguage{bulgarian} +\DeclareLanguage{catalan} +\DeclareLanguage{croatian} +\DeclareLanguage{czech} +\DeclareLanguage{danish} +\DeclareLanguage{dutch} +\DeclareLanguage{english} +\DeclareLanguage{finnish} +\DeclareLanguage{french} +\DeclareLanguage{german} +\DeclareLanguage{greek} +\DeclareLanguage{hebrew} +\DeclareLanguage{hungarian} +\DeclareLanguage{icelandic} +\DeclareLanguage{italian} +\DeclareLanguage{norwegian} +\DeclareLanguage{polish} +\DeclareLanguage{portuges} +\DeclareLanguage{romanian} +\DeclareLanguage{russian} +\DeclareLanguage{serbocroatian} +\DeclareLanguage{slovak} +\DeclareLanguage{slovenian} +\DeclareLanguage{spanish} +\DeclareLanguage{swedish} +\DeclareLanguage{turkish} +\DeclareLanguage{ukrainian} + +% -------------------------------------------------------------------------- +% aliases and dialects: +\DeclareLanguageAlias {Albanian}{albanian} +\DeclareLanguageAlias {Bulgarian}{bulgarian} +\DeclareLanguageAlias {Catalan}{catalan} +\DeclareLanguageAlias {Croatian}{croatian} +\DeclareLanguageAlias {Czech}{czech} +\DeclareLanguageAlias {Danish}{danish} +\DeclareLanguageAlias {Dutch}{dutch} +\DeclareLanguageAlias {Finnish}{finnish} +\DeclareLanguageAlias {francais}{french} +\DeclareLanguageAlias {Francais}{francais} +\DeclareLanguageDialect{canadien}{french} +\DeclareLanguageAlias {Canadien}{canadien} +\DeclareLanguageAlias {French}{french} +\DeclareLanguageDialect{american}{english} +\DeclareLanguageAlias {American}{american} +\DeclareLanguageDialect{australian}{english} +\DeclareLanguageAlias {Australian}{australian} +\DeclareLanguageDialect{british}{english} +\DeclareLanguageAlias {British}{british} +\DeclareLanguageDialect{canadian}{english} +\DeclareLanguageAlias {Canadian}{canadian} +\DeclareLanguageAlias {English}{english} +\DeclareLanguageAlias {UKenglish}{british} +\DeclareLanguageAlias {USenglish}{american} +\DeclareLanguageDialect{austrian}{german} +\DeclareLanguageAlias {Austrian}{austrian} +\DeclareLanguageAlias {German}{german} +\DeclareLanguageAlias {germanb}{german} +\DeclareLanguageDialect{naustrian}{austrian} +\DeclareLanguageAlias {ngerman}{german} +\DeclareLanguageAlias {Greek}{greek} +\DeclareLanguageAlias {polutonikogreek}{greek} +\DeclareLanguageAlias {Hebrew}{hebrew} +\DeclareLanguageAlias {Hungarian}{hungarian} +\DeclareLanguageDialect{magyar}{hungarian} +\DeclareLanguageAlias {Magyar}{magyar} +\DeclareLanguageAlias {Icelandic}{icelandic} +\DeclareLanguageAlias {Italian}{italian} +\DeclareLanguageAlias {norsk}{norwegian} +\DeclareLanguageAlias {Norsk}{norsk} +\DeclareLanguageAlias {Norwegian}{norwegian} +\DeclareLanguageAlias {nynorsk}{norwegian} +\DeclareLanguageAlias {Nynorsk}{nynorsk} +\DeclareLanguageAlias {Polish}{polish} +\DeclareLanguageDialect{brazil}{portuges} +\DeclareLanguageAlias {Brazil}{brazil} +\DeclareLanguageAlias {brazilian}{brazil} +\DeclareLanguageAlias {Brazilian}{brazilian} +\DeclareLanguageAlias {Portuges}{portuges} +\DeclareLanguageAlias {portuguese}{portuges} +\DeclareLanguageAlias {Portuguese}{portuguese} +\DeclareLanguageAlias {Romanian}{romanian} +\DeclareLanguageAlias {Russian}{russian} +\DeclareLanguageAlias {Serbocroatian}{serbocroatian} +\DeclareLanguageAlias {Slovak}{slovak} +\DeclareLanguageAlias {Slovenian}{slovenian} +\DeclareLanguageAlias {Spanish}{spanish} +\DeclareLanguageAlias {Swedish}{swedish} +\DeclareLanguageDialect{swissgerman}{german} +% this maybe should be a language of it's own: +\DeclareLanguageAlias {Swiss}{swissgerman} +\DeclareLanguageAlias {Swissgerman}{swissgerman} +\DeclareLanguageAlias {Turkish}{turkish} +\DeclareLanguageAlias {Ukrainian}{ukrainian} + +% -------------------------------------------------------------------------- +% load basic dictionary if available +\AtBeginDocument{% + \@trnslt@load@dictionary@silent@for + {translations-basic-dictionary} + {\@trnslt@current@language}% +} + +\endinput + +% -------------------------------------------------------------------------- +% HISTORY: +2012/09/30 v0.2beta - first version (as part of the `exsheets' bundle) +2012/10/05 v0.2 - \LoadDictionary and \LoadDictionaryFor added and loads of + languages defined. +2013/03/10 v0.8 - basic dictionaries for English, German, French and Spanish + - new command \DeclareDictTranslation +2013/04/04 v0.8a - bug fix in \DeclareDictTranslation +2013/04/07 v0.9 - slightly improved messages +2013/04/08 v0.9a - changed fallback warning into info + - synchronized version number with `exsheets' until now but + won't any more +2013/06/22 v0.9b - added Swiss +2013/06/28 v0.10 - declaring aliases of dialects now works as expected + - declarings dialects of an alias now correctly declares + the dialect to the correct base language + - corrected a few erroneous language declarations +2013/07/12 v0.10a - \GetTranslation gets two-folded fallback: use + fallback-translation if no translation for the current + language has been defined; use literal string if /no/ + language is used - this should never happen but /will/ + happen if neither `babel' nor `polyglossia' have been + loaded, i.e., no language has been chosen /and/ the + package writer did not provide an English translation +2013/07/16 v1.0 - removed from `exsheets' bundle - `translations' should + be a package of it's own + - load basic dictionary automatically if available + - rudimentary check in \LoadDictionary if loaded file is a + dictionary + - new command \PrintDictionaryFor + - redefined conditionals; they still seemed to make + trouble in some cases + |