From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/translations/README | 36 + .../translations-basic-dictionary-catalan.trsl | 138 +++ .../dicts/translations-basic-dictionary-dutch.trsl | 136 +++ .../translations-basic-dictionary-english.trsl | 136 +++ .../translations-basic-dictionary-french.trsl | 136 +++ .../translations-basic-dictionary-german.trsl | 136 +++ .../translations-basic-dictionary-spanish.trsl | 136 +++ macros/latex/contrib/translations/translations.sty | 1160 ++++++++++++++++++++ .../latex/contrib/translations/translations_en.pdf | Bin 0 -> 504516 bytes .../latex/contrib/translations/translations_en.tex | 778 +++++++++++++ 10 files changed, 2792 insertions(+) create mode 100644 macros/latex/contrib/translations/README create mode 100644 macros/latex/contrib/translations/dicts/translations-basic-dictionary-catalan.trsl create mode 100644 macros/latex/contrib/translations/dicts/translations-basic-dictionary-dutch.trsl create mode 100644 macros/latex/contrib/translations/dicts/translations-basic-dictionary-english.trsl create mode 100644 macros/latex/contrib/translations/dicts/translations-basic-dictionary-french.trsl create mode 100644 macros/latex/contrib/translations/dicts/translations-basic-dictionary-german.trsl create mode 100644 macros/latex/contrib/translations/dicts/translations-basic-dictionary-spanish.trsl create mode 100644 macros/latex/contrib/translations/translations.sty create mode 100644 macros/latex/contrib/translations/translations_en.pdf create mode 100644 macros/latex/contrib/translations/translations_en.tex (limited to 'macros/latex/contrib/translations') diff --git a/macros/latex/contrib/translations/README b/macros/latex/contrib/translations/README new file mode 100644 index 0000000000..ce94dac6bb --- /dev/null +++ b/macros/latex/contrib/translations/README @@ -0,0 +1,36 @@ +-------------------------------------------------------------------------- +the TRANSLATIONS package v1.7a - 2017/08/31 + internationalization of LaTeX2e packages + +-------------------------------------------------------------------------- +Clemens Niederberger +Web: https://github.com/cgnieder/translations +E-Mail: contact@mychemistry.eu +-------------------------------------------------------------------------- +Copyright 2012-2017 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 consists of the files + - translations.sty, translations_en.tex, translations_en.pdf, + translations-basic-dictionary-catalan.trsl, + translations-basic-dictionary-english.trsl, + translations-basic-dictionary-dutch.trsl, + translations-basic-dictionary-french.trsl, + translations-basic-dictionary-german.trsl, + translations-basic-dictionary-spanish.trsl + - README +-------------------------------------------------------------------------- +If you have any ideas, questions, suggestions or bugs to report, please +feel free to contact me. +-------------------------------------------------------------------------- diff --git a/macros/latex/contrib/translations/dicts/translations-basic-dictionary-catalan.trsl b/macros/latex/contrib/translations/dicts/translations-basic-dictionary-catalan.trsl new file mode 100644 index 0000000000..d136677d9e --- /dev/null +++ b/macros/latex/contrib/translations/dicts/translations-basic-dictionary-catalan.trsl @@ -0,0 +1,138 @@ +% -------------------------------------------------------------------------- +% the TRANSLATIONS package +% +% internationalizations of LaTeX2e packages +% +% -------------------------------------------------------------------------- +% Clemens Niederberger +% Web: https://github.com/cgnieder/translations +% E-Mail: contact@mychemistry.eu +% -------------------------------------------------------------------------- +% Copyright 2012-2017 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. +% -------------------------------------------------------------------------- +\ProvideDictionaryFor{Spanish}{translations-basic-dictionary} + +\ProvideDictTranslation{Abstract}{Resum} +\ProvideDictTranslation{Addresses}{Adreces} +\ProvideDictTranslation{addresses}{adreces} +\ProvideDictTranslation{Address}{Adre\c{c}a} +\ProvideDictTranslation{address}{adre\c{c}a} +\ProvideDictTranslation{and}{i} +\ProvideDictTranslation{Appendix}{Ap\`{e}ndix} +\ProvideDictTranslation{Authors}{Autors} +\ProvideDictTranslation{authors}{autors} +\ProvideDictTranslation{Author}{Autor} +\ProvideDictTranslation{author}{autor} +\ProvideDictTranslation{Bibliography}{Bibliografia} +\ProvideDictTranslation{cc}{c.c.} +\ProvideDictTranslation{Chapters}{Cap\'{\i}tols} +\ProvideDictTranslation{chapters}{cap\'{\i}tols} +\ProvideDictTranslation{Chapter}{Cap\'{\i}tol} +\ProvideDictTranslation{chapter}{cap\'{\i}tol} +\ProvideDictTranslation{Conclusion}{Conclusi\'{o}} +\ProvideDictTranslation{conclusion}{conclusi\'{o}} +\ProvideDictTranslation{Contents}{Contingut} +\ProvideDictTranslation{Continuation}{Continuaci\'{o}} +\ProvideDictTranslation{continuation}{continuaci\'{o}} +\ProvideDictTranslation{cont}{cont} +\ProvideDictTranslation{encl (plural)}{adj.} +\ProvideDictTranslation{encl (singular)}{adj.} +\ProvideDictTranslation{encl}{adj.} +\ProvideDictTranslation{Figures}{Figures} +\ProvideDictTranslation{figures}{figures} +\ProvideDictTranslation{Figure}{Figura} +\ProvideDictTranslation{figure}{figura} +\ProvideDictTranslation{From}{Des de} +\ProvideDictTranslation{from}{des de} +\ProvideDictTranslation{Glossary}{Glosari} +\ProvideDictTranslation{Index}{\'{I}ndex} +\ProvideDictTranslation{Introduction}{Introducci\'{o}} +\ProvideDictTranslation{introduction}{introducci\'{o}} +\ProvideDictTranslation{List of Figures and Tables}{Llista de Figures i Taules} +\ProvideDictTranslation{List of Figures}{Llista de Figures} +\ProvideDictTranslation{List of Tables}{Llista de Taules} +\ProvideDictTranslation{or}{o} +\ProvideDictTranslation{Outline}{Esb\'os} +\ProvideDictTranslation{Overview}{Visi\'{o} General} +\ProvideDictTranslation{Pages}{P\`{a}gines} +\ProvideDictTranslation{pages}{p\`{a}gines} +\ProvideDictTranslation{Page}{P\`{a}gina} +\ProvideDictTranslation{page}{p\`{a}gina} +\ProvideDictTranslation{Paragraphs}{Par\`{a}grafs} +\ProvideDictTranslation{paragraphs}{par\`{a}grafs} +\ProvideDictTranslation{Paragraph}{Par\`{a}graf} +\ProvideDictTranslation{paragraph}{par\`{a}graf} +\ProvideDictTranslation{Parts}{Parts} +\ProvideDictTranslation{parts}{parts} +\ProvideDictTranslation{Part}{Part} +\ProvideDictTranslation{part}{part} +\ProvideDictTranslation{Preface}{Prefaci} +\ProvideDictTranslation{Proofs}{Demostracions} +\ProvideDictTranslation{proofs}{demostracions} +\ProvideDictTranslation{Proof}{Demostraci\'{o}} +\ProvideDictTranslation{proof}{demostraci\'{o}} +\ProvideDictTranslation{References}{Refer\`{e}ncies} +\ProvideDictTranslation{Related work}{Treball relacionat} +\ProvideDictTranslation{Related Work}{Treball Relacionat} +\ProvideDictTranslation{Sections}{Seccions} +\ProvideDictTranslation{sections}{seccions} +\ProvideDictTranslation{Section}{Secci\'{o}} +\ProvideDictTranslation{section}{secci\'{o}} +\ProvideDictTranslation{See also}{Veure tamb\'{e}} +\ProvideDictTranslation{see also}{veurr tamb\'{e}} +\ProvideDictTranslation{See}{Veure} +\ProvideDictTranslation{see}{veure} +\ProvideDictTranslation{Sketch of Proofs}{Esbossos de Demostracions} +\ProvideDictTranslation{Sketch of proofs}{Esbossos de demostracions} +\ProvideDictTranslation{Sketch of Proof}{Esb\'{o}s de Demostraci\'{o}} +\ProvideDictTranslation{Sketch of proof}{Esb\'{o}s de demostraci\'{o}} +\ProvideDictTranslation{Subsections}{Subseccions} +\ProvideDictTranslation{subsections}{subseccions} +\ProvideDictTranslation{Subsection}{Subsecci\'{o}} +\ProvideDictTranslation{subsection}{subsecci\'{o}} +\ProvideDictTranslation{Summary}{Resum} +\ProvideDictTranslation{Tables}{Taules} +\ProvideDictTranslation{tables}{taules} +\ProvideDictTranslation{Table}{Taula} +\ProvideDictTranslation{table}{taula} +\ProvideDictTranslation{To}{Fins} +\ProvideDictTranslation{to}{fins} + +\ProvideDictTranslation{Monday}{Dilluns} +\ProvideDictTranslation{Tuesday}{Dimarts} +\ProvideDictTranslation{Wednesday}{Dimecres} +\ProvideDictTranslation{Thursday}{Dijous} +\ProvideDictTranslation{Friday}{Divendres} +\ProvideDictTranslation{Saturday}{Dissabte} +\ProvideDictTranslation{Sunday}{Diumenge} + +\ProvideDictTranslation{January}{Gener} +\ProvideDictTranslation{February}{Febrer} +\ProvideDictTranslation{March}{Mar\c{c}} +\ProvideDictTranslation{April}{Abril} +\ProvideDictTranslation{May}{Maig} +\ProvideDictTranslation{June}{Juny} +\ProvideDictTranslation{July}{Juliol} +\ProvideDictTranslation{August}{Agost} +\ProvideDictTranslation{September}{Setembre} +\ProvideDictTranslation{October}{Octubre} +\ProvideDictTranslation{November}{Novembre} +\ProvideDictTranslation{December}{Desembre} + diff --git a/macros/latex/contrib/translations/dicts/translations-basic-dictionary-dutch.trsl b/macros/latex/contrib/translations/dicts/translations-basic-dictionary-dutch.trsl new file mode 100644 index 0000000000..a9b8a61b00 --- /dev/null +++ b/macros/latex/contrib/translations/dicts/translations-basic-dictionary-dutch.trsl @@ -0,0 +1,136 @@ +% -------------------------------------------------------------------------- +% the TRANSLATIONS package +% +% internationalization of LaTeX2e packages +% +% -------------------------------------------------------------------------- +% Clemens Niederberger +% Web: https://github.com/cgnieder/translations +% E-Mail: contact@mychemistry.eu +% -------------------------------------------------------------------------- +% Copyright 2012-2017 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. +% -------------------------------------------------------------------------- +% If you have any ideas, questions, suggestions or bugs to report, please +% feel free to contact me. +% -------------------------------------------------------------------------- +\ProvideDictionaryFor{Dutch}{translations-basic-dictionary} + +\ProvideDictTranslation{Abstract}{Samenvatting} +\ProvideDictTranslation{Addresses}{Adressen} +\ProvideDictTranslation{addresses}{adressen} +\ProvideDictTranslation{Address}{Adres} +\ProvideDictTranslation{address}{adres} +\ProvideDictTranslation{and}{en} +\ProvideDictTranslation{Appendix}{Appendix} +\ProvideDictTranslation{Authors}{Auteurs} +\ProvideDictTranslation{authors}{auteurs} +\ProvideDictTranslation{Author}{Auteur} +\ProvideDictTranslation{author}{auteur} +\ProvideDictTranslation{Bibliography}{Bibliografie} +\ProvideDictTranslation{cc}{cc} +\ProvideDictTranslation{Chapters}{Hoofdstukken} +\ProvideDictTranslation{chapters}{hoofdstukken} +\ProvideDictTranslation{Chapter}{Hoofdstuk} +\ProvideDictTranslation{chapter}{hoofdstuk} +\ProvideDictTranslation{Conclusion}{Conclusie} +\ProvideDictTranslation{conclusion}{conclusie} +\ProvideDictTranslation{Contents}{Inhoud} +\ProvideDictTranslation{Continuation}{Vervolg} +\ProvideDictTranslation{continuation}{vervolg} +\ProvideDictTranslation{cont}{vervolg} +\ProvideDictTranslation{encl (plural)}{B\ij lagen} +\ProvideDictTranslation{encl (singular)}{B\ij lage} +\ProvideDictTranslation{encl}{B\ij lage(n)} +\ProvideDictTranslation{Figures}{Figuren} +\ProvideDictTranslation{figures}{figuren} +\ProvideDictTranslation{Figure}{Figuur} +\ProvideDictTranslation{figure}{figuur} +\ProvideDictTranslation{From}{Van} +\ProvideDictTranslation{from}{van} +\ProvideDictTranslation{Glossary}{Verklarende Woordenl\ij st} +\ProvideDictTranslation{Index}{Register} +\ProvideDictTranslation{Introduction}{Inleiding} +\ProvideDictTranslation{introduction}{inleiding} +\ProvideDictTranslation{List of Figures and Tables}{L\ij st van figuren en tabellen} +\ProvideDictTranslation{List of Figures}{L\ij st van figuren} +\ProvideDictTranslation{List of Tables}{L\ij st van tabellen} +\ProvideDictTranslation{or}{of} +\ProvideDictTranslation{Outline}{Indeling} +\ProvideDictTranslation{Overview}{Overzicht} +\ProvideDictTranslation{Pages}{Pagina's} +\ProvideDictTranslation{pages}{pagina's} +\ProvideDictTranslation{Page}{Pagina} +\ProvideDictTranslation{page}{pagina} +\ProvideDictTranslation{Paragraphs}{Alinea's} +\ProvideDictTranslation{paragraphs}{alinea's} +\ProvideDictTranslation{Paragraph}{Alinea} +\ProvideDictTranslation{paragraph}{alinea} +\ProvideDictTranslation{Parts}{Delen} +\ProvideDictTranslation{parts}{delen} +\ProvideDictTranslation{Part}{Deel} +\ProvideDictTranslation{part}{deel} +\ProvideDictTranslation{Preface}{Woord vooraf} +\ProvideDictTranslation{Proofs}{Bew\ij zen} +\ProvideDictTranslation{proofs}{Bew\ij zen} +\ProvideDictTranslation{Proof}{Bew\ij s} +\ProvideDictTranslation{proof}{bew\ij s} +\ProvideDictTranslation{References}{Referenties} +\ProvideDictTranslation{Related work}{Verwant werk} +\ProvideDictTranslation{Related Work}{Verwant Werk} +\ProvideDictTranslation{Sections}{Paragrafen} +\ProvideDictTranslation{sections}{paragrafen} +\ProvideDictTranslation{Section}{Paragraaf} +\ProvideDictTranslation{section}{paragraaf} +\ProvideDictTranslation{See also}{Zie ook} +\ProvideDictTranslation{see also}{zie ook} +\ProvideDictTranslation{See}{Zie} +\ProvideDictTranslation{see}{zie} +\ProvideDictTranslation{Sketch of Proofs}{Bew\ij sschetsen} +\ProvideDictTranslation{Sketch of proofs}{bew\ij sschetsen} +\ProvideDictTranslation{Sketch of Proof}{Bew\ij sschets} +\ProvideDictTranslation{Sketch of proof}{bew\ij sschets} +\ProvideDictTranslation{Subsections}{Subparagrafen} +\ProvideDictTranslation{subsections}{subparagrafen} +\ProvideDictTranslation{Subsection}{Subparagraaf} +\ProvideDictTranslation{subsection}{subparagraaf} +\ProvideDictTranslation{Summary}{Samenvatting} +\ProvideDictTranslation{Tables}{Tabellen} +\ProvideDictTranslation{tables}{tabellen} +\ProvideDictTranslation{Table}{Tabel} +\ProvideDictTranslation{table}{tabel} +\ProvideDictTranslation{To}{Aan} +\ProvideDictTranslation{to}{aan} + +\ProvideDictTranslation{Monday}{Maandag} +\ProvideDictTranslation{Tuesday}{Dinsdag} +\ProvideDictTranslation{Wednesday}{Woensdag} +\ProvideDictTranslation{Thursday}{Donderdag} +\ProvideDictTranslation{Friday}{Vr\ij dag} +\ProvideDictTranslation{Saturday}{Zaterdag} +\ProvideDictTranslation{Sunday}{Zondag} + +\ProvideDictTranslation{January}{Januari} +\ProvideDictTranslation{February}{Februari} +\ProvideDictTranslation{March}{Maart} +\ProvideDictTranslation{April}{April} +\ProvideDictTranslation{May}{Mei} +\ProvideDictTranslation{June}{Juni} +\ProvideDictTranslation{July}{Juli} +\ProvideDictTranslation{August}{Augustus} +\ProvideDictTranslation{September}{September} +\ProvideDictTranslation{October}{Oktober} +\ProvideDictTranslation{November}{November} +\ProvideDictTranslation{December}{December} + diff --git a/macros/latex/contrib/translations/dicts/translations-basic-dictionary-english.trsl b/macros/latex/contrib/translations/dicts/translations-basic-dictionary-english.trsl new file mode 100644 index 0000000000..a01c359094 --- /dev/null +++ b/macros/latex/contrib/translations/dicts/translations-basic-dictionary-english.trsl @@ -0,0 +1,136 @@ +% -------------------------------------------------------------------------- +% the TRANSLATIONS package +% +% internationalization of LaTeX2e packages +% +% -------------------------------------------------------------------------- +% Clemens Niederberger +% Web: https://github.com/cgnieder/translations +% E-Mail: contact@mychemistry.eu +% -------------------------------------------------------------------------- +% Copyright 2012-2017 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. +% -------------------------------------------------------------------------- +% If you have any ideas, questions, suggestions or bugs to report, please +% feel free to contact me. +% -------------------------------------------------------------------------- +\ProvideDictionaryFor{English}{translations-basic-dictionary} + +\ProvideDictTranslation{Abstract}{Abstract} +\ProvideDictTranslation{Addresses}{Addresses} +\ProvideDictTranslation{addresses}{addresses} +\ProvideDictTranslation{Address}{Address} +\ProvideDictTranslation{address}{address} +\ProvideDictTranslation{and}{and} +\ProvideDictTranslation{Appendix}{Appendix} +\ProvideDictTranslation{Authors}{Authors} +\ProvideDictTranslation{authors}{authors} +\ProvideDictTranslation{Author}{Author} +\ProvideDictTranslation{author}{author} +\ProvideDictTranslation{Bibliography}{Bibliography} +\ProvideDictTranslation{cc}{cc} +\ProvideDictTranslation{Chapters}{Chapters} +\ProvideDictTranslation{chapters}{chapters} +\ProvideDictTranslation{Chapter}{Chapter} +\ProvideDictTranslation{chapter}{chapter} +\ProvideDictTranslation{Conclusion}{Conclusion} +\ProvideDictTranslation{conclusion}{conclusion} +\ProvideDictTranslation{Contents}{Contents} +\ProvideDictTranslation{Continuation}{Continuation} +\ProvideDictTranslation{continuation}{continuation} +\ProvideDictTranslation{cont}{cont} +\ProvideDictTranslation{encl (plural)}{encl} +\ProvideDictTranslation{encl (singular)}{encl} +\ProvideDictTranslation{encl}{encl} +\ProvideDictTranslation{Figures}{Figures} +\ProvideDictTranslation{figures}{figures} +\ProvideDictTranslation{Figure}{Figure} +\ProvideDictTranslation{figure}{figure} +\ProvideDictTranslation{From}{From} +\ProvideDictTranslation{from}{from} +\ProvideDictTranslation{Glossary}{Glossary} +\ProvideDictTranslation{Index}{Index} +\ProvideDictTranslation{Introduction}{Introduction} +\ProvideDictTranslation{introduction}{introduction} +\ProvideDictTranslation{List of Figures and Tables}{List of Figures and Tables} +\ProvideDictTranslation{List of Figures}{List of Figures} +\ProvideDictTranslation{List of Tables}{List of Tables} +\ProvideDictTranslation{or}{or} +\ProvideDictTranslation{Outline}{Outline} +\ProvideDictTranslation{Overview}{Overview} +\ProvideDictTranslation{Pages}{Pages} +\ProvideDictTranslation{pages}{pages} +\ProvideDictTranslation{Page}{Page} +\ProvideDictTranslation{page}{page} +\ProvideDictTranslation{Paragraphs}{Paragraphs} +\ProvideDictTranslation{paragraphs}{paragraphs} +\ProvideDictTranslation{Paragraph}{Paragraph} +\ProvideDictTranslation{paragraph}{paragraph} +\ProvideDictTranslation{Parts}{Parts} +\ProvideDictTranslation{parts}{parts} +\ProvideDictTranslation{Part}{Part} +\ProvideDictTranslation{part}{part} +\ProvideDictTranslation{Preface}{Preface} +\ProvideDictTranslation{Proofs}{Proofs} +\ProvideDictTranslation{proofs}{proofs} +\ProvideDictTranslation{Proof}{Proof} +\ProvideDictTranslation{proof}{proof} +\ProvideDictTranslation{References}{References} +\ProvideDictTranslation{Related work}{Related work} +\ProvideDictTranslation{Related Work}{Related Work} +\ProvideDictTranslation{Sections}{Sections} +\ProvideDictTranslation{sections}{sections} +\ProvideDictTranslation{Section}{Section} +\ProvideDictTranslation{section}{section} +\ProvideDictTranslation{See also}{See also} +\ProvideDictTranslation{see also}{see also} +\ProvideDictTranslation{See}{See} +\ProvideDictTranslation{see}{see} +\ProvideDictTranslation{Sketch of Proofs}{Sketch of Proofs} +\ProvideDictTranslation{Sketch of proofs}{Sketch of proofs} +\ProvideDictTranslation{Sketch of Proof}{Sketch of Proof} +\ProvideDictTranslation{Sketch of proof}{Sketch of proof} +\ProvideDictTranslation{Subsections}{Subsections} +\ProvideDictTranslation{subsections}{subsections} +\ProvideDictTranslation{Subsection}{Subsection} +\ProvideDictTranslation{subsection}{subsection} +\ProvideDictTranslation{Summary}{Summary} +\ProvideDictTranslation{Tables}{Tables} +\ProvideDictTranslation{tables}{tables} +\ProvideDictTranslation{Table}{Table} +\ProvideDictTranslation{table}{table} +\ProvideDictTranslation{To}{To} +\ProvideDictTranslation{to}{to} + +\ProvideDictTranslation{Monday}{Monday} +\ProvideDictTranslation{Tuesday}{Tuesday} +\ProvideDictTranslation{Wednesday}{Wednesday} +\ProvideDictTranslation{Thursday}{Thursday} +\ProvideDictTranslation{Friday}{Friday} +\ProvideDictTranslation{Saturday}{Saturday} +\ProvideDictTranslation{Sunday}{Sunday} + +\ProvideDictTranslation{January}{January} +\ProvideDictTranslation{February}{February} +\ProvideDictTranslation{March}{March} +\ProvideDictTranslation{April}{April} +\ProvideDictTranslation{May}{May} +\ProvideDictTranslation{June}{June} +\ProvideDictTranslation{July}{July} +\ProvideDictTranslation{August}{August} +\ProvideDictTranslation{September}{September} +\ProvideDictTranslation{October}{October} +\ProvideDictTranslation{November}{November} +\ProvideDictTranslation{December}{December} + diff --git a/macros/latex/contrib/translations/dicts/translations-basic-dictionary-french.trsl b/macros/latex/contrib/translations/dicts/translations-basic-dictionary-french.trsl new file mode 100644 index 0000000000..d40b0d6ca5 --- /dev/null +++ b/macros/latex/contrib/translations/dicts/translations-basic-dictionary-french.trsl @@ -0,0 +1,136 @@ +% -------------------------------------------------------------------------- +% the TRANSLATIONS package +% +% internationalization of LaTeX2e packages +% +% -------------------------------------------------------------------------- +% Clemens Niederberger +% Web: https://github.com/cgnieder/translations +% E-Mail: contact@mychemistry.eu +% -------------------------------------------------------------------------- +% Copyright 2012-2017 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. +% -------------------------------------------------------------------------- +% If you have any ideas, questions, suggestions or bugs to report, please +% feel free to contact me. +% -------------------------------------------------------------------------- +\ProvideDictionaryFor{French}{translations-basic-dictionary} + +\ProvideDictTranslation{Abstract}{R\'{e}sum\'{e}} +\ProvideDictTranslation{Addresses}{Adresses} +\ProvideDictTranslation{addresses}{adresses} +\ProvideDictTranslation{Address}{Adresse} +\ProvideDictTranslation{address}{adresse} +\ProvideDictTranslation{and}{et} +\ProvideDictTranslation{Appendix}{Annexe} +\ProvideDictTranslation{Authors}{Auteurs} +\ProvideDictTranslation{authors}{auteur} +\ProvideDictTranslation{Author}{Auteur} +\ProvideDictTranslation{author}{auteur} +\ProvideDictTranslation{Bibliography}{Bibliographie} +\ProvideDictTranslation{cc}{Copie \`{a} } +\ProvideDictTranslation{Chapters}{Chapitres} +\ProvideDictTranslation{chapters}{chapitres} +\ProvideDictTranslation{Chapter}{Chapitre} +\ProvideDictTranslation{chapter}{chapitre} +\ProvideDictTranslation{Conclusion}{Conclusion} +\ProvideDictTranslation{conclusion}{conclusion} +\ProvideDictTranslation{Contents}{Contenu} +\ProvideDictTranslation{Continuation}{Suite} +\ProvideDictTranslation{continuation}{suite} +\ProvideDictTranslation{cont}{suite} +\ProvideDictTranslation{encl (plural)}{P.~J.} +\ProvideDictTranslation{encl (singular)}{P.~J.} +\ProvideDictTranslation{encl}{P.~J.} +\ProvideDictTranslation{Figures}{Figures} +\ProvideDictTranslation{figures}{figures} +\ProvideDictTranslation{Figure}{Figure} +\ProvideDictTranslation{figure}{figure} +\ProvideDictTranslation{From}{De} +\ProvideDictTranslation{from}{de} +\ProvideDictTranslation{Glossary}{Glossaire} +\ProvideDictTranslation{Index}{Index} +\ProvideDictTranslation{Introduction}{Introduction} +\ProvideDictTranslation{introduction}{introduction} +\ProvideDictTranslation{List of Figures and Tables}{Liste des figures et des tableaux} +\ProvideDictTranslation{List of Figures}{Liste des figures} +\ProvideDictTranslation{List of Tables}{Liste des tableaux} +\ProvideDictTranslation{or}{ou} +\ProvideDictTranslation{Outline}{Plan} +\ProvideDictTranslation{Overview}{Sommaire} +\ProvideDictTranslation{Pages}{Pages} +\ProvideDictTranslation{pages}{pages} +\ProvideDictTranslation{Page}{Page} +\ProvideDictTranslation{page}{page} +\ProvideDictTranslation{Paragraphs}{Paragraphes} +\ProvideDictTranslation{paragraphs}{paragraphes} +\ProvideDictTranslation{Paragraph}{Paragraphe} +\ProvideDictTranslation{paragraph}{paragraphe} +\ProvideDictTranslation{Parts}{Parties} +\ProvideDictTranslation{parts}{parties} +\ProvideDictTranslation{Part}{Partie} +\ProvideDictTranslation{part}{partie} +\ProvideDictTranslation{Preface}{Pr\'{e}face} +\ProvideDictTranslation{Proofs}{D\'{e}monstrations} +\ProvideDictTranslation{proofs}{d\'{e}monstrations} +\ProvideDictTranslation{Proof}{D\'{e}monstration} +\ProvideDictTranslation{proof}{d\'{e}monstration} +\ProvideDictTranslation{References}{R\'{e}f\'{e}rences} +\ProvideDictTranslation{Related work}{travaux connexes} +\ProvideDictTranslation{Related Work}{Travaux connexes} +\ProvideDictTranslation{Sections}{Sections} +\ProvideDictTranslation{sections}{sections} +\ProvideDictTranslation{Section}{Section} +\ProvideDictTranslation{section}{section} +\ProvideDictTranslation{See also}{Voir aussi} +\ProvideDictTranslation{see also}{voir aussi} +\ProvideDictTranslation{See}{Voir} +\ProvideDictTranslation{see}{voir} +\ProvideDictTranslation{Sketch of Proofs}{Esquisse de preuves} +\ProvideDictTranslation{Sketch of proofs}{Esquisse de preuves} +\ProvideDictTranslation{Sketch of Proof}{Esquisse de preuve} +\ProvideDictTranslation{Sketch of proof}{Esquisse de preuve} +\ProvideDictTranslation{Subsections}{Sous-sections} +\ProvideDictTranslation{subsections}{sous-sections} +\ProvideDictTranslation{Subsection}{Sous-section} +\ProvideDictTranslation{subsection}{sous-section} +\ProvideDictTranslation{Summary}{R\'{e}sum\'{e}} +\ProvideDictTranslation{Tables}{Tables} +\ProvideDictTranslation{tables}{tables} +\ProvideDictTranslation{Table}{Table} +\ProvideDictTranslation{table}{table} +\ProvideDictTranslation{To}{\`{A}} +\ProvideDictTranslation{to}{\`{a}} + +\ProvideDictTranslation{Monday}{lundi} +\ProvideDictTranslation{Tuesday}{mardi} +\ProvideDictTranslation{Wednesday}{mercredi} +\ProvideDictTranslation{Thursday}{jeudi} +\ProvideDictTranslation{Friday}{vendredi} +\ProvideDictTranslation{Saturday}{samedi} +\ProvideDictTranslation{Sunday}{dimanche} + +\ProvideDictTranslation{January}{janvier} +\ProvideDictTranslation{February}{f\'{e}vrier} +\ProvideDictTranslation{March}{mars} +\ProvideDictTranslation{April}{avril} +\ProvideDictTranslation{May}{mai} +\ProvideDictTranslation{June}{juin} +\ProvideDictTranslation{July}{juillet} +\ProvideDictTranslation{August}{ao\^{u}t} +\ProvideDictTranslation{September}{septembre} +\ProvideDictTranslation{October}{octobre} +\ProvideDictTranslation{November}{novembre} +\ProvideDictTranslation{December}{d\'{e}cembre} + diff --git a/macros/latex/contrib/translations/dicts/translations-basic-dictionary-german.trsl b/macros/latex/contrib/translations/dicts/translations-basic-dictionary-german.trsl new file mode 100644 index 0000000000..db4405016c --- /dev/null +++ b/macros/latex/contrib/translations/dicts/translations-basic-dictionary-german.trsl @@ -0,0 +1,136 @@ +% -------------------------------------------------------------------------- +% the TRANSLATIONS package +% +% internationalization of LaTeX2e packages +% +% -------------------------------------------------------------------------- +% Clemens Niederberger +% Web: https://github.com/cgnieder/translations +% E-Mail: contact@mychemistry.eu +% -------------------------------------------------------------------------- +% Copyright 2012-2017 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. +% -------------------------------------------------------------------------- +% If you have any ideas, questions, suggestions or bugs to report, please +% feel free to contact me. +% -------------------------------------------------------------------------- +\ProvideDictionaryFor{German}{translations-basic-dictionary} + +\ProvideDictTranslation{Abstract}{Zusammenfassung} +\ProvideDictTranslation{Addresses}{Adressen} +\ProvideDictTranslation{addresses}{Adressen} +\ProvideDictTranslation{Address}{Adresse} +\ProvideDictTranslation{address}{Adresse} +\ProvideDictTranslation{and}{und} +\ProvideDictTranslation{Appendix}{Anhang} +\ProvideDictTranslation{Authors}{Autoren} +\ProvideDictTranslation{authors}{Autoren} +\ProvideDictTranslation{Author}{Autor} +\ProvideDictTranslation{author}{Autor} +\ProvideDictTranslation{Bibliography}{Literaturverzeichnis} +\ProvideDictTranslation{cc}{Verteiler} +\ProvideDictTranslation{Chapters}{Kapitel} +\ProvideDictTranslation{chapters}{Kapitel} +\ProvideDictTranslation{Chapter}{Kapitel} +\ProvideDictTranslation{chapter}{Kapitel} +\ProvideDictTranslation{Conclusion}{Zusammenfassung} +\ProvideDictTranslation{conclusion}{Zusammenfassung} +\ProvideDictTranslation{Contents}{Inhaltsverzeichnis} +\ProvideDictTranslation{Continuation}{Fortsetzung} +\ProvideDictTranslation{continuation}{Fortsetzung} +\ProvideDictTranslation{cont}{Forts} +\ProvideDictTranslation{encl (plural)}{Anlagen} +\ProvideDictTranslation{encl (singular)}{Anlage} +\ProvideDictTranslation{encl}{Anlage(n)} +\ProvideDictTranslation{Figures}{Abbildungen} +\ProvideDictTranslation{figures}{Abbildungen} +\ProvideDictTranslation{Figure}{Abbildung} +\ProvideDictTranslation{figure}{Abbildung} +\ProvideDictTranslation{From}{Von} +\ProvideDictTranslation{from}{von} +\ProvideDictTranslation{Glossary}{Glossar} +\ProvideDictTranslation{Index}{Index} +\ProvideDictTranslation{Introduction}{Einleitung} +\ProvideDictTranslation{introduction}{Einleitung} +\ProvideDictTranslation{List of Figures and Tables}{Abbildungs- und Tabellenverzeichnis} +\ProvideDictTranslation{List of Figures}{Abbildungsverzeichnis} +\ProvideDictTranslation{List of Tables}{Tabellenverzeichnis} +\ProvideDictTranslation{or}{oder} +\ProvideDictTranslation{Outline}{Gliederung} +\ProvideDictTranslation{Overview}{\"Uber\-sicht} +\ProvideDictTranslation{Pages}{Seiten} +\ProvideDictTranslation{pages}{Seiten} +\ProvideDictTranslation{Page}{Seite} +\ProvideDictTranslation{page}{Seite} +\ProvideDictTranslation{Paragraphs}{Ab\-s\"at\-ze} +\ProvideDictTranslation{paragraphs}{Ab\-s\"at\-ze} +\ProvideDictTranslation{Paragraph}{Absatz} +\ProvideDictTranslation{paragraph}{Absatz} +\ProvideDictTranslation{Parts}{Teile} +\ProvideDictTranslation{parts}{Teile} +\ProvideDictTranslation{Part}{Teil} +\ProvideDictTranslation{part}{Teil} +\ProvideDictTranslation{Preface}{Vorwort} +\ProvideDictTranslation{Proofs}{Beweise} +\ProvideDictTranslation{proofs}{Beweise} +\ProvideDictTranslation{Proof}{Beweis} +\ProvideDictTranslation{proof}{Beweis} +\ProvideDictTranslation{References}{Literatur} +\ProvideDictTranslation{Related work}{Verwandte Arbeiten} +\ProvideDictTranslation{Related Work}{Verwandte Arbeiten} +\ProvideDictTranslation{Sections}{Abschnitte} +\ProvideDictTranslation{sections}{Abschnitte} +\ProvideDictTranslation{Section}{Abschnitt} +\ProvideDictTranslation{section}{Abschnitt} +\ProvideDictTranslation{See also}{Siehe auch} +\ProvideDictTranslation{see also}{siehe auch} +\ProvideDictTranslation{See}{Siehe} +\ProvideDictTranslation{see}{siehe} +\ProvideDictTranslation{Sketch of Proofs}{Beweisskizzen} +\ProvideDictTranslation{Sketch of proofs}{Beweisskizzen} +\ProvideDictTranslation{Sketch of Proof}{Beweisskizze} +\ProvideDictTranslation{Sketch of proof}{Beweisskizze} +\ProvideDictTranslation{Subsections}{Unterabschnitte} +\ProvideDictTranslation{subsections}{Unterabschnitte} +\ProvideDictTranslation{Subsection}{Unterabschnitt} +\ProvideDictTranslation{subsection}{Unterabschnitt} +\ProvideDictTranslation{Summary}{Zusammenfassung} +\ProvideDictTranslation{Tables}{Tabellen} +\ProvideDictTranslation{tables}{Tabellen} +\ProvideDictTranslation{Table}{Tabelle} +\ProvideDictTranslation{table}{Tabelle} +\ProvideDictTranslation{To}{An} +\ProvideDictTranslation{to}{an} + +\ProvideDictTranslation{Monday}{Montag} +\ProvideDictTranslation{Tuesday}{Dienstag} +\ProvideDictTranslation{Wednesday}{Mittwoch} +\ProvideDictTranslation{Thursday}{Donnerstag} +\ProvideDictTranslation{Friday}{Freitag} +\ProvideDictTranslation{Saturday}{Samstag} +\ProvideDictTranslation{Sunday}{Sonntag} + +\ProvideDictTranslation{January}{Januar} +\ProvideDictTranslation{February}{Februar} +\ProvideDictTranslation{March}{M\"arz} +\ProvideDictTranslation{April}{April} +\ProvideDictTranslation{May}{Mai} +\ProvideDictTranslation{June}{Juni} +\ProvideDictTranslation{July}{Juli} +\ProvideDictTranslation{August}{August} +\ProvideDictTranslation{September}{September} +\ProvideDictTranslation{October}{Oktober} +\ProvideDictTranslation{November}{November} +\ProvideDictTranslation{December}{Dezember} + diff --git a/macros/latex/contrib/translations/dicts/translations-basic-dictionary-spanish.trsl b/macros/latex/contrib/translations/dicts/translations-basic-dictionary-spanish.trsl new file mode 100644 index 0000000000..ef94881407 --- /dev/null +++ b/macros/latex/contrib/translations/dicts/translations-basic-dictionary-spanish.trsl @@ -0,0 +1,136 @@ +% -------------------------------------------------------------------------- +% the TRANSLATIONS package +% +% internationalization of LaTeX2e packages +% +% -------------------------------------------------------------------------- +% Clemens Niederberger +% Web: https://github.com/cgnieder/translations +% E-Mail: contact@mychemistry.eu +% -------------------------------------------------------------------------- +% Copyright 2012-2017 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. +% -------------------------------------------------------------------------- +% If you have any ideas, questions, suggestions or bugs to report, please +% feel free to contact me. +% -------------------------------------------------------------------------- +\ProvideDictionaryFor{Spanish}{translations-basic-dictionary} + +\ProvideDictTranslation{Abstract}{Resumen} +\ProvideDictTranslation{Addresses}{Direcciones} +\ProvideDictTranslation{addresses}{direcciones} +\ProvideDictTranslation{Address}{Direcci\'{o}n} +\ProvideDictTranslation{address}{direcci\'{o}n} +\ProvideDictTranslation{and}{y} +\ProvideDictTranslation{Appendix}{Ap\'{e}ndice} +\ProvideDictTranslation{Authors}{Autores} +\ProvideDictTranslation{authors}{autores} +\ProvideDictTranslation{Author}{Autor} +\ProvideDictTranslation{author}{autor} +\ProvideDictTranslation{Bibliography}{Bibliograf\'{\i}a} +\ProvideDictTranslation{cc}{c.c.} +\ProvideDictTranslation{Chapters}{Cap\'{\i}tulos} +\ProvideDictTranslation{chapters}{cap\'{\i}tulos} +\ProvideDictTranslation{Chapter}{Cap\'{\i}tulo} +\ProvideDictTranslation{chapter}{cap\'{\i}tulo} +\ProvideDictTranslation{Conclusion}{Conclusi\'{o}n} +\ProvideDictTranslation{conclusion}{conclusi\'{o}n} +\ProvideDictTranslation{Contents}{Contenido} +\ProvideDictTranslation{Continuation}{Continuaci\'{o}n} +\ProvideDictTranslation{continuation}{continuaci\'{o}n} +\ProvideDictTranslation{cont}{cont} +\ProvideDictTranslation{encl (plural)}{adj.} +\ProvideDictTranslation{encl (singular)}{adj.} +\ProvideDictTranslation{encl}{adj.} +\ProvideDictTranslation{Figures}{Figuras} +\ProvideDictTranslation{figures}{figuras} +\ProvideDictTranslation{Figure}{Figura} +\ProvideDictTranslation{figure}{figura} +\ProvideDictTranslation{From}{Desde} +\ProvideDictTranslation{from}{desde} +\ProvideDictTranslation{Glossary}{Glosario} +\ProvideDictTranslation{Index}{\'{I}ndice} +\ProvideDictTranslation{Introduction}{Introducci\'{o}n} +\ProvideDictTranslation{introduction}{introducci\'{o}n} +\ProvideDictTranslation{List of Figures and Tables}{Lista de Figuras y Tablas} +\ProvideDictTranslation{List of Figures}{Lista de Figuras} +\ProvideDictTranslation{List of Tables}{Lista de Tablas} +\ProvideDictTranslation{or}{o} +\ProvideDictTranslation{Outline}{Esbozo} +\ProvideDictTranslation{Overview}{Visi\'{o}n General} +\ProvideDictTranslation{Pages}{P\'{a}ginas} +\ProvideDictTranslation{pages}{p\'{a}ginas} +\ProvideDictTranslation{Page}{P\'{a}gina} +\ProvideDictTranslation{page}{p\'{a}gina} +\ProvideDictTranslation{Paragraphs}{P\'{a}rrafos} +\ProvideDictTranslation{paragraphs}{p\'{a}rrafos} +\ProvideDictTranslation{Paragraph}{P\'{a}rrafo} +\ProvideDictTranslation{paragraph}{p\'{a}rrafo} +\ProvideDictTranslation{Parts}{Partes} +\ProvideDictTranslation{parts}{partes} +\ProvideDictTranslation{Part}{Parte} +\ProvideDictTranslation{part}{parte} +\ProvideDictTranslation{Preface}{Prefacio} +\ProvideDictTranslation{Proofs}{Demostraciones} +\ProvideDictTranslation{proofs}{demostraciones} +\ProvideDictTranslation{Proof}{Demostraci\'{o}n} +\ProvideDictTranslation{proof}{demostraci\'{o}n} +\ProvideDictTranslation{References}{Referencias} +\ProvideDictTranslation{Related work}{Trabajo relacionado} +\ProvideDictTranslation{Related Work}{Trabajo Relacionado} +\ProvideDictTranslation{Sections}{Secciones} +\ProvideDictTranslation{sections}{secciones} +\ProvideDictTranslation{Section}{Secci\'{o}n} +\ProvideDictTranslation{section}{secci\'{o}n} +\ProvideDictTranslation{See also}{Ver tambi\'{e}n} +\ProvideDictTranslation{see also}{ver tambi\'{e}n} +\ProvideDictTranslation{See}{Ver} +\ProvideDictTranslation{see}{ver} +\ProvideDictTranslation{Sketch of Proofs}{Esbozo de Demostraciones} +\ProvideDictTranslation{Sketch of proofs}{Esbozo de demostraciones} +\ProvideDictTranslation{Sketch of Proof}{Esbozo de Demostraci\'{o}n} +\ProvideDictTranslation{Sketch of proof}{Esbozo de demostraci\'{o}n} +\ProvideDictTranslation{Subsections}{Subsecciones} +\ProvideDictTranslation{subsections}{subsecciones} +\ProvideDictTranslation{Subsection}{Subsecci\'{o}n} +\ProvideDictTranslation{subsection}{subsecci\'{o}n} +\ProvideDictTranslation{Summary}{Resumen} +\ProvideDictTranslation{Tables}{Tablas} +\ProvideDictTranslation{tables}{tablas} +\ProvideDictTranslation{Table}{Tabla} +\ProvideDictTranslation{table}{tabla} +\ProvideDictTranslation{To}{Hasta} +\ProvideDictTranslation{to}{hasta} + +\ProvideDictTranslation{Monday}{Lunes} +\ProvideDictTranslation{Tuesday}{Martes} +\ProvideDictTranslation{Wednesday}{Mi\'{e}rcoles} +\ProvideDictTranslation{Thursday}{Jueves} +\ProvideDictTranslation{Friday}{Viernes} +\ProvideDictTranslation{Saturday}{S\'{a}bado} +\ProvideDictTranslation{Sunday}{Domingo} + +\ProvideDictTranslation{January}{Enero} +\ProvideDictTranslation{February}{Febrero} +\ProvideDictTranslation{March}{Marzo} +\ProvideDictTranslation{April}{Abril} +\ProvideDictTranslation{May}{Mayo} +\ProvideDictTranslation{June}{Junio} +\ProvideDictTranslation{July}{Julio} +\ProvideDictTranslation{August}{Agosto} +\ProvideDictTranslation{September}{Septiembre} +\ProvideDictTranslation{October}{Octubre} +\ProvideDictTranslation{November}{Noviembre} +\ProvideDictTranslation{December}{Diciembre} + diff --git a/macros/latex/contrib/translations/translations.sty b/macros/latex/contrib/translations/translations.sty new file mode 100644 index 0000000000..6c5e03bbf2 --- /dev/null +++ b/macros/latex/contrib/translations/translations.sty @@ -0,0 +1,1160 @@ +% -------------------------------------------------------------------------- +% the TRANSLATIONS package +% +% internationalization of LaTeX2e packages +% +% -------------------------------------------------------------------------- +% Clemens Niederberger +% Web: https://github.com/cgnieder/translations +% E-Mail: contact@mychemistry.eu +% -------------------------------------------------------------------------- +% Copyright 2012-2017 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. +% -------------------------------------------------------------------------- +% If you have any ideas, questions, suggestions or bugs to report, please +% feel free to contact me. +% -------------------------------------------------------------------------- +\newcommand*\@trnslt@date{2017/08/31} +\newcommand*\@trnslt@version{v1.7a} +\newcommand*\@trnslt@packageinfo{internationalization of LaTeX2e packages} + +\ProvidesPackage{translations}[% + \@trnslt@date\space + \@trnslt@version\space + \@trnslt@packageinfo\space (CN)] +\RequirePackage{scrlfile,etoolbox,pdftexcmds} + +% -------------------------------------------------------------------------- +% message handling +% generic help message: +\newcommand*\@trnslt@error@message{% + For details have a look at the `translations' manual.% +} + +\newrobustcmd*\@trnslt@info[1]{\PackageInfo{translations}{#1}} +\newrobustcmd*\@trnslt@warning[1]{\PackageWarning{translations}{#1}} +\newrobustcmd*\@trnslt@error[1]{% + \PackageError{translations}{#1}\@trnslt@error@message +} + +% specific errors: +\newrobustcmd*\@trnslt@err@unknown@lang[1]{% + \@trnslt@error{Unknown language `#1'}% +} +\newrobustcmd*\@trnslt@warn@unknown@lang[1]{% + \PackageWarning{translations}{Unknown language `#1'}% +} +\newrobustcmd*\@trnslt@err@already@defined[2]{% + \@trnslt@error{The #2 translation for `#1' is already defined.}% +} +\newrobustcmd*\@trnslt@err@not@defined[2]{% + \@trnslt@error{The \@trnslt@language{#2} translation for `#1' is not defined yet.}% +} +\newrobustcmd*\@trnslt@err@dict@already@defined[2]{% + \@trnslt@error{The #2 dictionary entry for `#1' is already defined.}% +} +\newrobustcmd*\@trnslt@err@dict@not@defined[2]{% + \@trnslt@error{The \@trnslt@language{#2} dictionary entry for `#1' is not defined yet.}% +} + +% -------------------------------------------------------------------------- +% check if babel or polyglossia is used +\AtEndPreamble{ + \@ifpackageloaded{babel}{}{ + \@ifpackageloaded{polyglossia}{} + {\@trnslt@info{No language package found. I am going to use `english' + as default language.}} + } + % define \languagename if not defined yet: + \providecommand*\languagename{english}% + \def\@trnslt@current@language{\languagename}% + % define \bbl@afterfi if not defined yet: + \ifdef\bbl@afterfi{} + {\long\def\bbl@afterfi#1\fi{\fi#1}} +} + +% -------------------------------------------------------------------------- +% test string equality, expandably: +\newcommand\@trnslt@ifstrequal[2]{% + \ifnum\pdf@strcmp{\unexpanded{#1}}{\unexpanded{#2}}=\z@ + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} + +\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{% + \expandafter\@trnslt@getnext@braced + \expandafter{\romannumeral-`0#3}{#1}{#2}% +} + +% -------------------------------------------------------------------------- +% book keeping: the following macros will be used as `etoolbox' lists that +% keep record of defined languages, dialects and aliases +\newcommand*\@trnslt@languages{}% all languages +\newcommand*\@trnslt@aliases@pair{}% all aliases and their base +\newcommand*\@trnslt@aliases@single{}% all aliases +\newcommand*\@trnslt@dialects@pair{}% all dialects and their base +\newcommand*\@trnslt@dialects@single{}% all dialects + +% -------------------------------------------------------------------------- +% define \@trnslt@if@ conditionals that don't leave the checked macro as +% \relax behind and check for \@trnslt@@#1. These conditionals should +% also be expandable in an \edef-like context. Thanks to e-TeX there's +% \ifcsname: +\newrobustcmd*\@trnslt@new@check[1]{% + \csdef{@trnslt@if@#1}##1{% + \ifcsname @trnslt@#1@##1\endcsname + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi + }% +} + +% -------------------------------------------------------------------------- +% leaves lowercase full expansion of #1 in the input stream (except that it +% doesn't, because nothing is expanded... :p) +\newcommand\@trnslt@get@lowercase[1]{% + \lowercase\expandafter{\romannumeral-`\Q#1}% +} + +% -------------------------------------------------------------------------- +% \DeclareLanguage +% #1: language +\newrobustcmd*\DeclareLanguage[1]{% + \@trnslt@declare@language{#1}} +\@onlypreamble\DeclareLanguage + +\newrobustcmd*\@trnslt@declare@language[1]{% + \@trnslt@if@language{#1} + {}{% + \csdef{@trnslt@language@#1}{#1}% + \listeadd\@trnslt@languages{#1}% + }% +} + +% get the name declared by \DeclareLanguage: the underlying name of a given +% language; this is not the base of a dialect! +\newcommand*\@trnslt@language[1]{\csuse{@trnslt@language@#1}} + +% a user-level equivalent: +% \newcommand*\baselanguage[1]{\@trnslt@language{#1}} + +% define \@trnslt@if@language{#1}{}{} that actually checks the existence of +% \@trnslt@language@#1: +\@trnslt@new@check{language} + +% -------------------------------------------------------------------------- +% \DeclareLanguageDialect +% #1: dialect +% #2: language +\newrobustcmd*\DeclareLanguageDialect[2]{% + \@trnslt@declare@languagedialect{#1}{#2}} +\@onlypreamble\DeclareLanguageDialect + +\newrobustcmd*\@trnslt@declare@languagedialect[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}}% + }% + }% +} + +% dialect equivalent of \@trnslt@language +\newcommand*\@trnslt@dialect[1]{\csuse{@trnslt@dialect@#1}} + +% this macros fetches the base language for a given dialect, expandably: +\newcommand*\@trnslt@dialect@of[1]{% + \@trnslt@if@dialect{#1} + {% + \expandafter\expandafter\expandafter + \@firstoftwo + \csname @trnslt@dialect@#1\endcsname + }{}% +} + +% get the underlying name of a language or the name of the base language of a +% dialect: +\newcommand*\baselanguage[1]{% + \@trnslt@if@dialect{#1} + {\@trnslt@language{\@trnslt@dialect@of{#1}}} + {\@trnslt@language{#1}}% +} + +% define \@trnslt@if@dialect{#1}{}{} that actually checks the existence of +% \@trnslt@dialect@#1: +\@trnslt@new@check{dialect} + +% -------------------------------------------------------------------------- +% \DeclareLanguageAlias +% #1: alias +% #2: language +\newrobustcmd*\DeclareLanguageAlias[2]{% + \@trnslt@declare@languagealias{#1}{#2}} +\@onlypreamble\DeclareLanguageAlias + +\newrobustcmd*\@trnslt@declare@languagealias[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}} + {}% + \ifcsdef{@trnslt@alias@#1} + {} + {% + \csdef{@trnslt@alias@#1}{#2}% + \listadd\@trnslt@aliases@pair{{#1}{#2}}% + \listadd\@trnslt@aliases@single{#1}% + }% +} + +% alias equivalent of \@trnslt@language +\newcommand*\@trnslt@alias[1]{\csuse{@trnslt@alias@#1}} + +% define \@trnslt@if@alias{#1}{}{} that actually checks the existence of +% \@trnslt@alias@#1: +\@trnslt@new@check{alias} + +% -------------------------------------------------------------------------- +% check the current language, expandably: +% #1: language +% #2: true +% #3: false +\newcommand*\@trnslt@iflanguage[1]{% + \@trnslt@braced@expanded@fully + \@trnslt@braced@expanded@fully + \@trnslt@firstofone + \@trnslt@ifstrequal + {\@trnslt@language{#1}} + {\@trnslt@language{\languagename}}% +} + +% check the current /base/ language, expandably: +\newcommand*\@trnslt@ifbaselanguage[1]{% + \@trnslt@if@dialect{\languagename} + {% + \@trnslt@braced@expanded@fully + \@trnslt@braced@expanded@fully + \@trnslt@firstofone + \@trnslt@ifstrequal + {\@trnslt@language{\@trnslt@dialect@of{\languagename}}} + {\@trnslt@language{#1}}% + } + {\@trnslt@iflanguage{#1}}% +} + +% user commands for the above: +\newcommand*\ifcurrentlanguage[1]{% + \@trnslt@iflanguage{#1}% +} +\newcommand*\ifcurrentbaselanguage[1]{% + \@trnslt@ifbaselanguage{#1}% +} + +% -------------------------------------------------------------------------- +% Now that we can define languages we also want to be able to define +% translations: +% \DeclareTranslation, \NewTranslation, \RenewTranslation and +% \ProvideTranslation +% #1: language +% #2: word +% #3: replacement +\newrobustcmd\declaretranslation[3]{% + \@trnslt@declare@translation{#2}{#1}{#3}% +} +\newrobustcmd\definetranslation[3]{% + \@trnslt@new@translation{#2}{#1}{#3}% +} +\newrobustcmd\redefinetranslation[3]{% + \@trnslt@renew@translation{#2}{#1}{#3}% +} +\newrobustcmd\addtranslation[3]{% + \@trnslt@provide@translation{#2}{#1}{#3}% +} + +\let\DeclareTranslation\declaretranslation +\@onlypreamble\DeclareTranslation +\let\NewTranslation\definetranslation +\@onlypreamble\NewTranslation +\let\RenewTranslation\redefinetranslation +\@onlypreamble\RenewTranslation +\let\ProvideTranslation\addtranslation +\@onlypreamble\ProvideTranslation + +\newrobustcmd*\declaretranslationfallback{% + \declaretranslation{fallback}% +} +\newrobustcmd*\definetranslationfallback{% + \definetranslation{fallback}% +} +\newrobustcmd*\redefinetranslationfallback{% + \redefinetranslation{fallback}% +} +\newrobustcmd*\addtranslationfallback{% + \addtranslation{fallback}% +} + +\let\DeclareTranslationFallback\declaretranslationfallback +\@onlypreamble\DeclareTranslationFallback +\let\NewTranslationFallback\definetranslationfallback +\@onlypreamble\NewTranslationFallback +\let\RenewTranslationFallback\redefinetranslationfallback +\@onlypreamble\RenewTranslationFallback +\let\ProvideTranslationFallback\addtranslationfallback +\@onlypreamble\ProvideTranslationFallback + +% #1: word +% #2: language +% #3: replacement +\newrobustcmd\@trnslt@declare@translation[3]{% + \@trnslt@if@language{#2} + {% + \@trnslt@if@dialect{#2} + {% + \long\csdef{@trnslt@word@\detokenize{#1}@\@trnslt@dialect{#2}}{#3}% + \@trnslt@if@word\@trnslt@dialect@of{#1}{#2} + {} + {\long\csdef{@trnslt@word@\detokenize{#1}@\@trnslt@dialect@of{#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]{% + \@trnslt@if@word\@trnslt@language{#1}{#2} + {\@trnslt@err@already@defined{#1}{#2}} + {\@trnslt@declare@translation{#1}{#2}{#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]{% + \@trnslt@if@word\@trnslt@language{#1}{#2} + {} + {\@trnslt@declare@translation{#1}{#2}{#3}}% +} + +% -------------------------------------------------------------------------- +% let's go through some trouble to check if a translation exists: +\newcommand*\@trnslt@if@word[3]{% + \ifcsname @trnslt@word@\detokenize{#2}@#1{#3}\endcsname + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +}% + +% #1: word +% #2: language +\newcommand*\@trnslt@if@translation[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}% + }% +} + +% #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 +% 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}} + +% those will print the translation lowercase... they're also expandable; that +% is: nearly... +% \DeclareTranslation{German}{foo}{Bla} +% \edef\foo{\GetLCTranslationFor{German}{foo}} +% \show\foo +% > \foo=macro: +% ->\lowercase {Bla}. +\newcommand*\GetLCTranslationFor[2]{% + \@trnslt@get@lowercase{\@trnslt@checkandget@translation@for{#2}{#1}}% +} + +\newcommand*\GetLCTranslation[1]{% + \@trnslt@get@lowercase{% + \@trnslt@checkandget@translation@for{#1}{\@trnslt@current@language}% + }% +} + +% unexpandable version of the commands that raise a warning if no translation +% is available: +\newrobustcmd*\GetTranslationForWarn[2]{% + \@trnslt@getandwarn@translation@for{#2}{#1}% +} + +\newrobustcmd*\GetTranslationWarn[1]{% + \@trnslt@getandwarn@translation@for{#1}{\@trnslt@current@language}% +} + +\newrobustcmd*\GetLCTranslationForWarn[2]{% + \@trnslt@getandwarn@lctranslation@for{#2}{#1}% +} + +\newrobustcmd*\GetLCTranslationWarn[1]{% + \@trnslt@getandwarn@lctranslation@for{#1}{\@trnslt@current@language}% +} + +% #1: word #2: language +\newcommand*\@trnslt@get@translation@for[2]{% + \@trnslt@if@dialect{#2} + {% + \@trnslt@if@translation@value{#1}{\@trnslt@dialect{#2}} + {\@trnslt@translation@value{#1}{\@trnslt@dialect{#2}}} + {\@trnslt@translation@value{#1}{\@trnslt@dialect@of{#2}}}% + } + {\@trnslt@translation@value{#1}{\@trnslt@language{#2}}}% +} + +\newcommand*\@trnslt@checkandget@translation@for[2]{% + \@trnslt@if@translation{#1}{#2} + {\@trnslt@get@translation@for{#1}{#2}} + {% + \@trnslt@if@translation{#1}{fallback} + {\@trnslt@translation@value{#1}{fallback}} + {\@trnslt@translation@value{#1}{literal}}% + }% +} + +\newcommand*\@trnslt@if@translation@value[2]{% + \ifcsdef{@trnslt@word@\detokenize{#1}@#2}% +} + +\newcommand*\@trnslt@translation@value[2]{% + \unexpanded\expandafter\expandafter\expandafter{% + \csname @trnslt@word@\detokenize{#1}@#2\endcsname + }% +} + +% this is not expandable! +\newrobustcmd*\@trnslt@getandwarn@translation@for[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@\detokenize{#1}@fallback} + } + {\csuse{@trnslt@word@\detokenize{#1}@literal}}% + }% +} + +% lowercase version for translation with warnings: +\newrobustcmd*\@trnslt@getandwarn@lctranslation@for[2]{% + \@trnslt@if@translation{#1}{#2} + {\@trnslt@get@lowercase{\@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'}% + \@trnslt@get@lowercase{\csuse{@trnslt@word@\detokenize{#1}@fallback}}% + } + {\@trnslt@get@lowercase{\csuse{@trnslt@word@\detokenize{#1}@literal}}}% + }% +} + +% -------------------------------------------------------------------------- +% no idea if the following ones really are needed... let's define them +% anyway +% \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}% +} + +\newrobustcmd*\@trnslt@save@translation@for[3]{% + \edef#1{\@trnslt@checkandget@translation@for{#2}{#3}}% +} + +% -------------------------------------------------------------------------- +% The basics are set. What's missing? Right: dictionaries! Those will be files +% that contain translations for a specific language. +% -------------------------------------------------------------------------- +% load dictionaries and check for existing ones: +% \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 + +\newrobustcmd*\LoadDictionaryForDialect[2]{% + \@trnslt@load@dictionary@for@dialect{#2}{#1}} +\@onlypreamble\LoadDictionaryFor + +% #1: name +% #2: lang +% #3: false +\newrobustcmd*\@trnslt@input@if@dictionary@exists[3]{% + \AtBeginDocument{% + \InputIfFileExists{#1-\@trnslt@language{#2}.trsl} + {\@trnslt@check@dictionary{#1}{#2}} + {#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} + {% + \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 + appear to be a dictionary}% + }% + }% +} + +% -------------------------------------------------------------------------- +% 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}}% + % 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')] + }% +} + +\protected\def\@trnslt@provide@dictionary@version[#1]{% + \ProvidesFile + {\@trnslt@dictionary@name-\@trnslt@dictionary@lang.trsl}% + [(\@trnslt@dictionary@lang\space translation file `\@trnslt@dictionary@name') #1]} + +\newcommand*\@trnslt@check@dictionary@entry[2]{% + \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}}% +} + +% -------------------------------------------------------------------------- +% now we should be able to add translations without repeatedly type the +% language ... +\newrobustcmd*\NewDictTranslation[2]{% + \@trnslt@check@dictionary@entry{#1}{#2} + {\@trnslt@err@dict@already@defined{#1}{#2}}% + {% + \@trnslt@add@dictionary@entry{#1}{#2} + \@trnslt@new@translation{#1}{\@trnslt@dictionary@lang}{#2}% + }% +} +\@onlypreamble\NewDictTranslation + +\newrobustcmd*\RenewDictTranslation[2]{% + \@trnslt@check@dictionary@entry{#1}{#2} + {\@trnslt@renew@translation{#1}{\@trnslt@dictionary@lang}{#2}} + {\@trnslt@err@dict@not@defined{#1}{#2}}% +} +\@onlypreamble\RenewDictTranslation + +\newrobustcmd*\DeclareDictTranslation[2]{% + \@trnslt@check@dictionary@entry{#1}{#2} + {} + {\@trnslt@add@dictionary@entry{#1}{#2}}% + \@trnslt@declare@translation{#1}{\@trnslt@dictionary@lang}{#2}% +} +\@onlypreamble\DeclareDictTranslation + +\newrobustcmd*\ProvideDictTranslation[2]{% + \@trnslt@check@dictionary@entry{#1}{#2} + {} + {% + \@trnslt@add@dictionary@entry{#1}{#2}% + \@trnslt@provide@translation{#1}{\@trnslt@dictionary@lang}{#2}% + }% +} +\@onlypreamble\ProvideDictTranslation + +% -------------------------------------------------------------------------- +% last not least let's inspect which entries a dictionary contains of: +% \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 +\newcommand*\@trnslt@print@dictionary@for[5]{% + \forlistcsloop + {\@trnslt@print@dictionary@entry{#3}{#4}{#5}} + {@trnslt@dictionary@#2@\@trnslt@language{#1}}% +} + +% #1: pre +% #2: mid +% #3: post +% #4: (key)(translation) +\newcommand*\@trnslt@print@dictionary@entry[4]{% + \@trnslt@print@dictionary@entry@aux{#1}{#2}{#3}#4% +} + +% #1: pre +% #2: mid +% #3: post +% #4: key +% #5: translation +\newcommand*\@trnslt@print@dictionary@entry@aux[5]{#1#4#2#5#3} + +% ========================================================================== +% Now that the package is finished let's use the above commands to provide a +% basis for usage; we need all languages known to `babel' and `polyglossia' +% as well as aliases to allow different spellings/names; we also need dialects +% where it makes sense (e.g. British as a dialect of English) + +% -------------------------------------------------------------------------- +% dummy language `fallback' -- it is needed for the whole mechansim provided +% earlier (\DeclareFallbackTranslation...) +\DeclareLanguage{fallback} +\DeclareLanguageAlias{Fallback}{fallback} + +% -------------------------------------------------------------------------- +% predefined languages +\DeclareLanguage{afrikaans} +\DeclareLanguage{albanian} +\DeclareLanguage{amharic} +\DeclareLanguage{arabic} +\DeclareLanguage{armenian} +\DeclareLanguage{asturian} +\DeclareLanguage{azerbaijani} +\DeclareLanguage{basque} +\DeclareLanguage{bengali} +\DeclareLanguage{breton} +\DeclareLanguage{bulgarian} +\DeclareLanguage{catalan} +\DeclareLanguage{coptic} +\DeclareLanguage{czech} +\DeclareLanguage{danish} +\DeclareLanguage{dutch} +\DeclareLanguage{english} +\DeclareLanguage{esperanto} +\DeclareLanguage{estonian} +\DeclareLanguage{ethiop} +\DeclareLanguage{farsi} +\DeclareLanguage{finnish} +\DeclareLanguage{french} +\DeclareLanguage{friulan} +\DeclareLanguage{gaelic} +\DeclareLanguage{galician} +\DeclareLanguage{german} +\DeclareLanguage{greek} +\DeclareLanguage{hebrew} +\DeclareLanguage{hindustani} +\DeclareLanguage{hungarian} +\DeclareLanguage{icelandic} +\DeclareLanguage{interlingua} +\DeclareLanguage{italian} +\DeclareLanguage{japanese} +\DeclareLanguage{kannada} +\DeclareLanguage{korean} +\DeclareLanguage{ladin} +\DeclareLanguage{lao} +\DeclareLanguage{latin} +\DeclareLanguage{latvian} +\DeclareLanguage{lithuanian} +\DeclareLanguage{macedonian} +\DeclareLanguage{malay} +\DeclareLanguage{malayalam} +\DeclareLanguage{maldivian} +\DeclareLanguage{marathi} +\DeclareLanguage{mongolian} +% polyglossia seems to support this one but it is unclear which language is +% actually meant by it: +% \DeclareLanguage{nko} +\DeclareLanguage{norwegian} +\DeclareLanguage{occitan} +\DeclareLanguage{piedmontese} +\DeclareLanguage{pinyin} +\DeclareLanguage{polish} +\DeclareLanguage{portuges} +\DeclareLanguage{romanian} +\DeclareLanguage{romansh} +\DeclareLanguage{russian} +\DeclareLanguage{samin} +\DeclareLanguage{sanskrit} +\DeclareLanguage{serbocroatian} +\DeclareLanguage{slovak} +\DeclareLanguage{slovenian} +\DeclareLanguage{sorbian} +% not sure about this: isn't it either a Spanish or English dialect? +\DeclareLanguage{spanglish} +\DeclareLanguage{spanish} +\DeclareLanguage{swedish} +% polyglossia seems to support this one but it is unclear which language is +% actually meant by it: +% \DeclareLanguage{syriac} +\DeclareLanguage{tamil} +\DeclareLanguage{telugu} +\DeclareLanguage{thai} +\DeclareLanguage{tibetan} +\DeclareLanguage{turkish} +\DeclareLanguage{turkmen} +\DeclareLanguage{ukrainian} +\DeclareLanguage{vietnamese} +\DeclareLanguage{welsh} + +% -------------------------------------------------------------------------- +% aliases and dialects: +\DeclareLanguageAlias {Afrikaans}{afrikaans} +\DeclareLanguageAlias {Albanian}{albanian} +\DeclareLanguageAlias {Amharic}{amharic} +\DeclareLanguageAlias {Arabic}{arabic} +\DeclareLanguageAlias {Armenian}{armenian} +\DeclareLanguageAlias {Asturian}{asturian} +\DeclareLanguageAlias {astur-leonese}{asturian} +\DeclareLanguageAlias {Astur-Leonese}{astur-leonese} +\DeclareLanguageAlias {asturian-leonese}{asturian} +\DeclareLanguageAlias {Asturian-Leonese}{asturian-leonese} +\DeclareLanguageAlias {Azerbaijani}{azerbaijani} +\DeclareLanguageAlias {Basque}{basque} +\DeclareLanguageAlias {Bengali}{bengali} +\DeclareLanguageAlias {Breton}{breton} +\DeclareLanguageAlias {Bulgarian}{bulgarian} +\DeclareLanguageAlias {Catalan}{catalan} +\DeclareLanguageAlias {Coptic}{coptic} +\DeclareLanguageAlias {coptic egyptian}{coptic} +\DeclareLanguageAlias {Coptic Egyptian}{coptic egyptian} +\DeclareLanguageAlias {Czech}{czech} +\DeclareLanguageAlias {Danish}{danish} +\DeclareLanguageAlias {Dutch}{dutch} +\DeclareLanguageAlias {Farsi}{farsi} +\DeclareLanguageAlias {Finnish}{finnish} +\DeclareLanguageAlias {francais}{french} +\DeclareLanguageAlias {Francais}{francais} +\DeclareLanguageDialect{canadien}{french} +\DeclareLanguageAlias {Canadien}{canadien} +\DeclareLanguageAlias {French}{french} +\DeclareLanguageDialect{acadian}{french} +\DeclareLanguageAlias {Acadian}{acadian} +\DeclareLanguageAlias {frenchle}{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{newzealand}{english} +\DeclareLanguageAlias {Newzealand}{newzealand} +\DeclareLanguageAlias {Ethiop}{ethiop} +\DeclareLanguageAlias {Esperanto}{esperanto} +\DeclareLanguageAlias {Estonian}{estonian} +\DeclareLanguageAlias {Friulan}{friulan} +\DeclareLanguageAlias {Gaelic}{gaelic} +\DeclareLanguageDialect{irish}{gaelic} +\DeclareLanguageDialect{scottish}{gaelic} +\DeclareLanguageAlias {Irish}{irish} +\DeclareLanguageAlias {irish gaelic}{irish} +\DeclareLanguageAlias {Irish Gaelic}{irish} +\DeclareLanguageAlias {Scottish}{scottish} +\DeclareLanguageAlias {scottish gaelic}{scottish} +\DeclareLanguageAlias {Scottish Gaelic}{scottish} +\DeclareLanguageAlias {Galician}{galician} +\DeclareLanguageAlias {German}{german} +\DeclareLanguageAlias {germanb}{german} +\DeclareLanguageAlias {ngerman}{german} +\DeclareLanguageDialect{austrian}{german} +\DeclareLanguageAlias {Austrian}{austrian} +\DeclareLanguageAlias {naustrian}{austrian} +\DeclareLanguageAlias {Greek}{greek} +\DeclareLanguageAlias {polutonikogreek}{greek} +\DeclareLanguageAlias {ibygreek}{greek} +\DeclareLanguageAlias {bgreek}{greek} +\DeclareLanguageAlias {Hebrew}{hebrew} +\DeclareLanguageAlias {Hindustani}{hindustani} +\DeclareLanguageAlias {hindi-urdu}{hindustani} +\DeclareLanguageAlias {Hindi-Urdu}{hindi-urdu} +\DeclareLanguageDialect{hindi}{hindustani} +\DeclareLanguageAlias {Hindi}{hindi} +\DeclareLanguageDialect{urdu}{hindustani} +\DeclareLanguageAlias {Urdu}{urdu} +\DeclareLanguageAlias {Hungarian}{hungarian} +\DeclareLanguageAlias {magyar}{hungarian} +\DeclareLanguageAlias {Magyar}{magyar} +\DeclareLanguageAlias {Icelandic}{icelandic} +\DeclareLanguageAlias {Interlingua}{interlingua} +\DeclareLanguageAlias {Italian}{italian} +\DeclareLanguageAlias {Japanese}{japanese} +\DeclareLanguageAlias {Kannada}{kannada} +\DeclareLanguageAlias {Korean}{korean} +\DeclareLanguageAlias {Ladin}{ladin} +\DeclareLanguageAlias {Lao}{lao} +\DeclareLanguageAlias {laotian}{lao} +\DeclareLanguageAlias {Laotian}{laotian} +\DeclareLanguageAlias {Latin}{latin} +\DeclareLanguageAlias {Latvian}{latvian} +\DeclareLanguageAlias {lettish}{latvian} +\DeclareLanguageAlias {Lettish}{lettish} +\DeclareLanguageAlias {Lithuanian}{lithuanian} +\DeclareLanguageAlias {Macedonian}{macedonian} +% hopefully someone who knows better than me can comment on the following +% family: +\DeclareLanguageAlias {Malay}{malay} +\DeclareLanguageAlias {bahasa malaysia}{malay} +\DeclareLanguageAlias {Bahasa Malaysia}{bahasa malaysia} +\DeclareLanguageAlias {bahasa melayu}{bahasa malaysia} +\DeclareLanguageAlias {Bahasa Melayu}{bahasa melayu} +\DeclareLanguageAlias {bahasa}{bahasa melayu} +\DeclareLanguageAlias {Bahasa}{bahasa} +\DeclareLanguageAlias {bahasai}{bahasa} +\DeclareLanguageAlias {Bahasai}{bahasai} +\DeclareLanguageAlias {bahasam}{bahasa} +\DeclareLanguageAlias {Bahasam}{bahasam} +\DeclareLanguageDialect{indonesian}{malay} +\DeclareLanguageAlias {Indonesian}{indonesian} +\DeclareLanguageAlias {indon}{indonesian} +% +\DeclareLanguageAlias {Malayalam}{malayalam} +\DeclareLanguageAlias {Maldivian}{maldivian} +\DeclareLanguageAlias {divehi}{maldivian} +\DeclareLanguageAlias {Divehi}{divehi} +\DeclareLanguageAlias {Marathi}{marathi} +\DeclareLanguageAlias {Mongolian}{mongolian} +% \DeclareLanguageAlias {Nko}{nko} +\DeclareLanguageAlias {norsk}{norwegian} +\DeclareLanguageAlias {Norsk}{norsk} +\DeclareLanguageAlias {Norwegian}{norwegian} +\DeclareLanguageAlias {nynorsk}{norwegian} +\DeclareLanguageAlias {Nynorsk}{nynorsk} +\DeclareLanguageAlias {Occitan}{occitan} +\DeclareLanguageAlias {lenga d'oc}{occitan} +\DeclareLanguageAlias {langue d'oc}{occitan} +\DeclareLanguageAlias {Piedmontese}{piedmontese} +\DeclareLanguageAlias {piemontese}{piedmontese} +\DeclareLanguageAlias {Piemontese}{piemontese} +\DeclareLanguageAlias {piemonteis}{piedmontese} +\DeclareLanguageAlias {Piemonteis}{piemonteis} +\DeclareLanguageAlias {Pinyin}{pinyin} +\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 {Romansh}{romansh} +\DeclareLanguageAlias {Romansch}{romansh} +\DeclareLanguageAlias {Rumantsh}{romansh} +\DeclareLanguageAlias {Rumantsch}{romansh} +\DeclareLanguageAlias {Romanche}{romansh} +\DeclareLanguageAlias {Russian}{russian} +\DeclareLanguageAlias {Samin}{samin} +\DeclareLanguageAlias {north sami}{samin} +\DeclareLanguageAlias {North Sami}{north sami} +\DeclareLanguageAlias {northern sami}{north sami} +\DeclareLanguageAlias {Northern Sami}{northern sami} +\DeclareLanguageAlias {Sanskrit}{sanskrit} +\DeclareLanguageAlias {Serbocroatian}{serbocroatian} +\DeclareLanguageAlias {serbo-croatian}{serbocroatian} +\DeclareLanguageAlias {Serbo-Croatian}{serbocroatian} +\DeclareLanguageDialect{serbian}{serbocroatian} +\DeclareLanguageAlias {Serbian}{serbian} +\DeclareLanguageAlias {serbianc}{serbian} +\DeclareLanguageDialect{croatian}{serbocroatian} +\DeclareLanguageAlias {Croatian}{croatian} +\DeclareLanguageAlias {Slovak}{slovak} +\DeclareLanguageAlias {Slovenian}{slovenian} +\DeclareLanguageAlias {slovene}{slovenian} +\DeclareLanguageAlias {Slovene}{slovene} +\DeclareLanguageAlias {Sorbian}{sorbian} +\DeclareLanguageDialect{lowersorbian}{sorbian} +\DeclareLanguageDialect{uppersorbian}{sorbian} +\DeclareLanguageAlias {Lowersorbian}{lowersorbian} +\DeclareLanguageAlias {Uppersorbian}{uppersorbian} +\DeclareLanguageAlias {lsorbian}{lowersorbian} +\DeclareLanguageAlias {usorbian}{uppersorbian} +\DeclareLanguageAlias {lower sorbian}{lowersorbian} +\DeclareLanguageAlias {upper sorbian}{uppersorbian} +\DeclareLanguageAlias {lower Sorbian}{lowersorbian} +\DeclareLanguageAlias {upper Sorbian}{uppersorbian} +\DeclareLanguageAlias {Lower Sorbian}{lowersorbian} +\DeclareLanguageAlias {Upper Sorbian}{uppersorbian} +\DeclareLanguageAlias {Spanglish}{spanglish} +\DeclareLanguageAlias {Spanish}{spanish} +\DeclareLanguageAlias {Swedish}{swedish} +\DeclareLanguageDialect{swissgerman}{german} +\DeclareLanguageDialect{swissfrench}{french} +\DeclareLanguageDialect{swissitalian}{italian} +\DeclareLanguageDialect{swissromansh}{romansh} +\DeclareLanguageAlias {Swissgerman}{swissgerman} +\DeclareLanguageAlias {swiss german}{swissgerman} +\DeclareLanguageAlias {Swiss German}{swissgerman} +\DeclareLanguageAlias {Swissfrench}{swissfrench} +\DeclareLanguageAlias {swiss french}{swissfrench} +\DeclareLanguageAlias {Swiss French}{swissfrench} +\DeclareLanguageAlias {Swissitalian}{swissitalian} +\DeclareLanguageAlias {swiss italian}{swissitalian} +\DeclareLanguageAlias {Swiss Italian}{swissitalian} +\DeclareLanguageAlias {Swissromansh}{swissromansh} +\DeclareLanguageAlias {swiss romansh}{swissromansh} +\DeclareLanguageAlias {Swiss Romansh}{swissromansh} +% this is to be discussed: swiss could also be an alias of french, italian or +% romansh: +\DeclareLanguageAlias {swiss}{swissgerman} +\DeclareLanguageAlias {Swiss}{swiss} +% \DeclareLanguageAlias {Syriac}{syriac} +\DeclareLanguageAlias {Tamil}{tamil} +\DeclareLanguageAlias {Telugu}{telugu} +\DeclareLanguageAlias {Thai}{thai} +\DeclareLanguageAlias {thaicjk}{thai} +\DeclareLanguageAlias {Thaicjk}{thaicjk} +\DeclareLanguageAlias {Tibetan}{tibetan} +\DeclareLanguageAlias {Turkish}{turkish} +\DeclareLanguageAlias {Turkmen}{turkmen} +\DeclareLanguageAlias {Ukrainian}{ukrainian} +\DeclareLanguageAlias {Vietnamese}{vietnamese} +\DeclareLanguageAlias {Welsh}{welsh} + +% ========================================================================== +% OK, we have everything, do we? No, wait: let's load the basic dictionary +% that is part of this package if it is available for the document language +% -------------------------------------------------------------------------- +% 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 +2013/08/05 v1.1 - added /loads/ of languages, now the list of babel and + polyglossia languages hopefully is complete + - a few languages had falsely been declared as dialect + instead of an alias + - added weekday names and month names to basic dictionary + - new command \baselanguage + - new commands \GetLCTranslation, \GetLCTranslationFor, + \GetLCTranslationWarn and \GetLCTranslationForWarn + - load basic dictionary also for dialects and if it + doesn't exist load it for the corresponding base + language instead +2013/09/30 v1.1a - Bug fix in \NewTranslation und \RenewTranslation +2014/01/10 v1.2 - \ifcurrentlanguage, \ifcurrentbaselanguage + - require cnltx-base + - change the `no language package' warning into an info + - \ProvideTranslation + - \NewDictTranslation, \RenewDictTranslation, + \ProvideDictTranslation + - translations in dictionaries are provided + - \baselanguagename +2014/01/23 v1.2a - add \detokenize{} so that translation keys with + non-ascii chars can safely be used + - fix bug in dialect declaration + - rename \baselanguagename => \baselanguage + - drop earlier \baselanguage (it was and still is + 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 +2015/11/07 v1.2e - Some fixes to the French translations in the basic + dictionary, thanks to Denis Bitouz\'e + - add Macedonian language +2016/04/19 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 +2016/06/02 v1.4 - new commands \declaretranslation, \newtranslation, + \renewtranslation and \providetranslation which can be + used after begin document + - fallback versions for each definition command +2016/06/02 v1.4a - rename new commands: they conflict with the translator + package! +2017/03/03 v1.5 - remove dependency on cnltx-base + - add Dutch dictionary (thanks to kwikwi) + - add Catalan dictionary (thanks to kwikwi) +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 +2017/07/03 v1.6a - fix issue #6 (bug in \@trnslt@save@translation@for) +2017/07/06 v1.7 - return translation values in \unexpanded +2017/08/31 v1.7a - add missing dependency on pdftexcmds diff --git a/macros/latex/contrib/translations/translations_en.pdf b/macros/latex/contrib/translations/translations_en.pdf new file mode 100644 index 0000000000..425752712f Binary files /dev/null and b/macros/latex/contrib/translations/translations_en.pdf differ diff --git a/macros/latex/contrib/translations/translations_en.tex b/macros/latex/contrib/translations/translations_en.tex new file mode 100644 index 0000000000..a39561bdc2 --- /dev/null +++ b/macros/latex/contrib/translations/translations_en.tex @@ -0,0 +1,778 @@ +% !arara: pdflatex: { shell: on } +% !arara: biber +% arara: pdflatex +% arara: pdflatex +% -------------------------------------------------------------------------- +% the TRANSLATIONS package +% +% internationalizations of LaTeX2e packages +% +% -------------------------------------------------------------------------- +% Clemens Niederberger +% Web: https://github.com/cgnieder/translations +% E-Mail: contact@mychemistry.eu +% -------------------------------------------------------------------------- +% Copyright 2012-2017 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. +% -------------------------------------------------------------------------- +\documentclass[load-preamble+,french,spanish,ngerman,english]{cnltx-doc} +% ---------------------------------------------------------------------------- +% document layout and typographic features +\setcnltx{ + package = {translations} , + authors = Clemens Niederberger , + email = contact@mychemistry.eu , + url = https://github.com/cgnieder/translations , + info = {Internationalization of \LaTeXe\ Packages} , + add-cmds = { + baselanguage, + DeclareDictTranslation, + DeclareLanguage, + DeclareLanguageAlias, + DeclareLanguageDialect, + DeclareTranslation, + declaretranslation, + DeclareTranslationFallback, + declaretranslationfallback, + GetTranslation, + GetTranslationFor, + IfTranslation, + LoadDictionary, + LoadDictionaryFor, + NewTranslation, + definetranslation, + NewTranslationFallback, + definetranslationfallback, + ProvideDictionaryFor, + ProvideDictTranslation, + ProvideTranslation, + addtranslation, + ProvideTranslationFallback, + addtranslationfallback, + RenewTranslation, + redefinetranslation, + RenewTranslationFallback, + redefinetranslationfallback, + SaveTranslation, + SaveTranslationFor + } , + add-silent-cmds = { + cuisine,kitchen,mypackage@title + } , + makeindex-setup = {options={-s cnltx.ist},columns=3,columnsep=1em} , + index-setup = {othercode=\footnotesize,level=\addsec,noclearpage} +} + +\microtypesetup{tracking=scshape} + +\defbibheading{bibliography}[\bibname]{\addsec{#1}} + +\usepackage{csquotes} + +\usepackage{embrac}[2012/06/29] + \ChangeEmph{[}[,.02em]{]}[.055em,-.08em] + \ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em] + +% ---------------------------------------------------------------------------- +% other packages, bibliography, index +\usepackage{array,longtable,booktabs} +\AfterPackage!{hyperref}{\usepackage[sort]{cleveref}} + +% ---------------------------------------------------------------------------- +% example definitions that have to be done in the preamble: +\DeclareTranslation{English}{Kueche}{kitchen} +\DeclareTranslation{German}{Kueche}{K\"uche} +\DeclareTranslation{Spanish}{Kueche}{cocina} +\DeclareTranslation{French}{Kueche}{cuisine} +\DeclareTranslation{English}{farbe}{color} +\DeclareTranslation{British}{farbe}{colour} +\LoadDictionaryFor{German}{translations-basic-dictionary} + +% ---------------------------------------------------------------------------- +\usepackage{bbding} + +\newrobustcmd\fnote[1]{\textsuperscript{#1}} + +\begin{document} + +\section{Motivation} +This package provides means for package authors to have an easy interface for +internationalization of their packages. The functionality of this package is +in many parts also covered by the package +\pkg{translator}~\cite{pkg:translator} (part of the \pkg*{beamer} bundle). +Internationalization is also possible with \pkg{babel}~\cite{pkg:babel} and +it's \cs*{addto}\cs*{captions\meta{language}} mechanism or \KOMAScript's +\cs*{providecaptionname} and similar commands. However, I believe that +\translations\ is more flexible than all of these. Unlike \pkg{translator} it +detects the used (\pkg{babel} or \pkg{polyglossia}~\cite{pkg:polyglossia}) +language itself and provides expandable retrieving of the translated key. +\translations\ also provides support for language dialects which means package +authors can for example distinguish between British, Australian, Canadian and +US~English. + +The first draft of the package was written since I missed an expandable +version of \pkg{translator}'s \cs*{translate} command. Once I had the +package available I began using it in various of my other packages so it got +extended to the needs I faced there. + + +\section{License and Requirements}\label{sec:license} +\license + +\translations\ requires the packages \pkg{etoolbox}~\cite{pkg:etoolbox} and +\pkg{scrlfile} (part of the \KOMAScript\ bundle~\cite{bnd:koma-script}). + + +\section{Usage} +\subsection{Background} +The \translations\ package enables the author of a package or a class (or a +document) to declare translations of key words in different languages and +fetch these translations in the document depending on the active language as +set by \pkg{babel} or \pkg{polyglossia}. Since \translations\ checks which +language is active it is generally not necessary (although possible) to +specify the language for which a translation should be fetched manually. + +\translations\ knows of three types of languages: main languages (see +\cref{tab:languages} on \cpageref{tab:languages}), language dialects (see +\cref{tab:dialects} on \cpageref{tab:dialects}), and language aliases (see +\cref{tab:aliases} on \cpageref{tab:aliases}). For the commands declaring or +fetching a translation base languages and language aliases are equivalent. +Dialects are similar to aliases but there are important differences. An alias +can for example be an alias of a dialect. + +\Cref{fig:scheme} shows what happens if \translations\ is asked to fetch a +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}, + every node/.style={ + draw, + rounded corners=3pt, + align=left, + anchor=north, + font=\small\sffamily + } + ] + \node {check if any\fnote{a} translation is defined in given language} + child { + node[text width=\nodewidth] + {\yes check if language is a dialect} + child { + node[text width=\nodewidth/2] + {\yes check if dialect translation is given} + child { + node[text width=\nodewidth/2.75] + {\yes use dialect translation} + } + child { + node[text width=\nodewidth/2.75] + {\no use lan\-guage\fnote{b} translation} + } + } + child { + node[text width=\nodewidth/2] + {\no use translation}} + } + child { + node[text width=\nodewidth] + {\no check if fallback translation is given} + child { + node[text width=\nodewidth/2.75] + {\yes use fallback translation} + } + child { + node[text width=\nodewidth/2.75] + {\no use literal key} + } + } ; + \end{tikzpicture} + \caption{Schematic representation of \translations' translating + mechansim. Notes: \fnote{a} except for a possible fallback + translation. \fnote{b} \ie, the base language of the dialect.} + \label{fig:scheme} +\end{figure} + +What happens if you declare a translation? There are four cases: +\begin{enumerate} + \item You declare a translation for a base language: this is the normal case + where an internal macro is defined which can be fetched by the + \cs{GetTranslation} command (see \cref{ssec:commands}). + \item You declare a translation for a language alias: this is the very same + as the first case since the same internal macro is defined. + \item You declare a translation for a dialect: this is two-fold. Either a + translation for the base language exists so only the translation for the + dialect is saved. If the translation for the base language does not exist + it is defined to be the same as the one for the dialect. + \item You declare a translation for an alias of a dialect: this is the very + same as the third case as again the internal macros are the same. +\end{enumerate} + +\emph{Beware that if the current language is a language using a non-latin + font, a translation is missing for said language, and the fallback + translation needs a Latin script font then \emph{nothing} might be printed.} + +\subsection{Available Commands}\label{ssec:commands} +Below the commands provided by \translations\ are explained. The symbol +\textcolor{expandable}{\expandablesign} means that the command is expandable. +Commands without the marker aren't expandable. + +\begin{commands} + \command{DeclareLanguage}[\marg{lang}] + Declare a language that can be used by \translations. If the language + already exists it will be silently redefined. This command can only be + used in the preamble. It should never be necessary to use this command as + \translations\ already declares loads of languages (\cref{sec:languages}). + Should you miss one please send me an email and I'll add it to + \translations. + \command{DeclareLanguageAlias}[\marg{lang2}\marg{lang1}] + Declares \meta{lang2} to be an alias of \meta{lang1}. If \meta{lang1} + doesn't exist yet a warning will be raised and it will be defined. This + command can only be used in the preamble. It should never be necessary to + use this command as \translations\ already declares loads of languages + (\cref{sec:languages}). Should you miss one please send me an email and + I'll add it to \translations. + \command{DeclareLanguageDialect}[\marg{dialect}\marg{lang}] + Declares \meta{dialect} to be a dialect of language \meta{lang}. If a + translation for \meta{dialect} is provided it is used by the translation + macros. If there is none the corresponding translation for \meta{lang} + is used instead. It should never be necessary to use this command as + \translations\ already declares loads of languages (\cref{sec:languages}). + Should you miss one please send me an email and I'll add it to + \translations. + \command{NewTranslation}[\marg{lang}\marg{key}\marg{translation}] + Defines a translation of key \meta{key} for the language \meta{lang}. + An error will be raised if a translation of \meta{key} in language + \marg{lang} already exists. This command can only be used in the + preamble. + \command{NewTranslationFallback}[\marg{key}\marg{translation}] + \sinceversion{1.4}Defines a fallback translation of key \meta{key} for the + language \meta{lang}. An error will be raised if a fallback translation of + \meta{key} already exists. This command can only be used in the preamble. + \command{RenewTranslation}[\marg{lang}\marg{key}\marg{translation}] + Redefines a translation of key \meta{key} for the language \meta{lang}. + An error will be raised if no translation of \meta{key} in language + \meta{lang} exists. This command can only be used in the preamble. + \command{RenewTranslationFallback}[\marg{key}\marg{translation}] + \sinceversion{1.4}Renews a fallback translation. This command can only be + used in the preamble. + \command{ProvideTranslation}[\marg{lang}\marg{key}\marg{translation}] + \sinceversion{1.2}Provides a translation of key \meta{key} for the + language \meta{lang}. If a translation of \meta{key} in language + \meta{lang} already exists it won't be overwritten and no error will be + raised. This command can only be used in the preamble. + \command{ProvideTranslationFallback}[\marg{key}\marg{translation}] + \sinceversion{1.4}Provides a fallback translation. This command can only + be used in the preamble. + \command{DeclareTranslation}[\marg{lang}\marg{key}\marg{translation}] + Defines a translation of key \meta{key} for the language \meta{lang}. + No error will be raised if a translation of \meta{key} already exists. + This command can only be used in the preamble. + \command{DeclareTranslationFallback}[\marg{key}\marg{fallback}] + Declares a fallback translation. This command can only be used in the + preamble. + \command{definetranslation}[\marg{lang}\marg{key}\marg{translation}] + \sinceversion{1.4}A version of \cs{NewTranslation} that \emph{can} be used + after begin document. + \command{definetranslationfallback}[\marg{key}\marg{translation}] + \sinceversion{1.4}A version of \cs{NewTranslationFallback} that \emph{can} + be used after begin document. + \command{redefinetranslation}[\marg{lang}\marg{key}\marg{translation}] + \sinceversion{1.4}A version of \cs{RenewTranslation} that \emph{can} be + used after begin document. + \command{redefinetranslationfallback}[\marg{key}\marg{translation}] + \sinceversion{1.4}A version of \cs{RenewTranslationFallback} that + \emph{can} be used after begin document. + \command{addtranslation}[\marg{lang}\marg{key}\marg{translation}] + \sinceversion{1.4}A version of \cs{ProvideTranslation} that \emph{can} be + used after begin document. + \command{addtranslationfallback}[\marg{key}\marg{translation}] + \sinceversion{1.4}A version of \cs{ProvideTranslationFallback} that + \emph{can} be used after begin document. + \command{declaretranslation}[\marg{lang}\marg{key}\marg{translation}] + \sinceversion{1.4}A version of \cs{DeclareTranslation} that \emph{can} be + used after begin document. + \command{declaretranslationfallback}[\marg{key}\marg{translation}] + \sinceversion{1.4}A version of \cs{DeclareTranslationFallback} that + \emph{can} be used after begin document. + \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. + \expandable\command{GetTranslation}[\marg{key}] + Fetches and prints the translation of \meta{key} for the currently active + language (as for example set by \pkg{babel}). This command is expandable. + \expandable\command{GetLCTranslationFor}[\marg{lang}\marg{key}] + \sinceversion{1.1}Fetches and prints the translation of \meta{key} for + the language \meta{lang}. This command ensures that the fetched + translation is set lowercase. This command is expandable (well, sort + of: in an \cs*{edef} it leaves \cs*{lowercase}\marg{translation} in the + input stream where \meta{translation} is what \cs{GetTranslationFor} would + expand to). + \expandable\command{GetLCTranslation}[\marg{key}] + \sinceversion{1.1}Fetches and prints the translation of \meta{key} for + the currently active language (as for example set by \pkg{babel}). This + command ensures that the fetched translation is set lowercase. This + command is expandable (well, sort of: in an \cs*{edef} it leaves + \cs*{lowercase}\marg{translation} in the input stream where + \meta{translation} is what \cs{GetTranslation} would expand to). + \command{GetTranslationForWarn}[\marg{lang}\marg{key}] + \sinceversion{1.0}Fetches and prints the translation of \meta{key} for + the language \meta{lang}. Issues a warning if no translation is + available at the cost of expandability. + \command{GetTranslationWarn}[\marg{key}] + \sinceversion{1.0}Fetches and prints the translation of \meta{key} for + the currently active language (as for example set by \pkg{babel}). + Issues a warning if no translation is available at the cost of + expandability. + \command{GetLCTranslationForWarn}[\marg{lang}\marg{key}] + \sinceversion{1.1}Fetches and prints the translation of \meta{key} for + the language \meta{lang}. This command ensures that the fetched + translation is set lowercase. Issues a warning if no translation is + available at the cost of expandability. + \command{GetLCTranslationWarn}[\marg{key}] + \sinceversion{1.1}Fetches and prints the translation of \meta{key} for + the currently active language (as for example set by \pkg{babel}). This + command ensures that the fetched translation is set lowercase. Issues a + warning if no translation is available at the cost of expandability. + \command{SaveTranslationFor}[\marg{cmd}\marg{lang}\marg{key}] + Fetches and saves the translation of \meta{key} for the language + \meta{lang} in the macro \meta{cmd}. + \command{SaveTranslation}[\marg{cmd}\marg{key}] + Fetches and saves the translation of \meta{key} for the currently active + language (as for example set by \pkg{babel}) in the macro \meta{cmd}. + \command{LoadDictionary}[\marg{name}] + Loads a file named \code{\meta{name}-\meta{lang}.trsl} where \meta{lang} + corresponds to the lowercase name of the current language as defined with + \cs{DeclareLanguage}. This file should contain the translations for the + specified language. + \command{LoadDictionaryFor}[\marg{lang}\marg{name}] + Loads a file named \code{\meta{name}-\meta{lang}.trsl}. + \command{NewDictTranslation}[\marg{key}\marg{translation}] + \sinceversion{0.10}This command is to be used in a dictionary file and + picks up the language of that file. Issues an error if either the + translation for the \meta{key} or the dictionary entry for the \meta{key} + already exists. + \command{RenewDictTranslation}[\marg{key}\marg{translation}] + \sinceversion{0.10}This command is to be used in a dictionary file and + picks up the language of that file. Issues an error if either the + translation for the \meta{key} or the dictionary entry for the \meta{key} + doesn't exist. + \command{ProvideDictTranslation}[\marg{key}\marg{translation}] + \sinceversion{0.10}This command is to be used in a dictionary file and + picks up the language of that file. Only defines the translation and adds + a corresponding dictionary entry if they don't exist yet. This command is + used in the dictionaries that a part of \translations. + \command{DeclareDictTranslation}[\marg{key}\marg{translation}] + This command is to be used in a dictionary file and picks up the language + of that file, see \cref{sec:dictionaries} for an example. Defines the + translation and adds a dictionary entry regardless if they exist or not. + \command{ProvideDictionaryFor}[\marg{lang}\marg{name}\oarg{date}] + Needs to be in a dictionary file. This command tells \translations\ that + the file indeed is a dictionary and also sets the language for the + dictionary which is used by \cs{DeclareDictTranslation}. + \expandable\command{PrintDictionaryFor}% + [\marg{lang}\marg{name}\marg{pre}\marg{mid}\marg{post}] + \sinceversion{1.0}Prints all entries of dictionary \meta{name} in + language \meta{lang} in the order the entries have been declared. For + every entry the code\par + \meta{pre}\meta{key}\meta{mid}\meta{translation}\meta{post}\par + is printed. The dictionary must have been loaded of course. There is + probably only a very limited number of use cases for this command. (It + was for example used to print \cref{tab:dict}.) + \expandable\command{baselanguage}[\marg{lang}] + \changedversion{1.2a}Returns the (internal) base name of the given language, + language alias or language dialect. For a dialect this expands to the + name of language it is a dialect of. For a base language (see + section~\ref{ssec:languages:base}) this usually simply is the lowercase + version of the name.\par + \verbcode+\baselanguage{English}+ $\Rightarrow$ \code{english}\\ + \verbcode+\baselanguage{American}+ $\Rightarrow$ \code{english} + \expandable\command{ifcurrentlanguage}[\marg{lang}\marg{true}\marg{false}] + \sinceversion{1.2}Places \meta{true} in the input stream if the current + language is \meta{lang}. Note: a dialect counts as a language of it's own + here. \cs{ifcurrentlanguage}\Marg{English} will for example be + \meta{false} if the current \pkg{babel} language is \code{american}. + \expandable\command{ifcurrentbaselanguage}[\marg{lang}\marg{true}\marg{false}] + \sinceversion{1.2}Places \meta{true} in the input stream if the current + language is \meta{lang}. Note: a dialect does notcount as a language of + it's own here. If the current \pkg{babel} language is \code{american} + then \cs{ifcurrentbaselanguage}\Marg{English} will be \meta{true}. +\end{commands} + +\subsection{A Small Example} +This section demonstrates with two short examples how the macros are used. +The first example covers the basics: declaring of translations and then +retrieving and typesetting them. + +\begin{example} + % in the preamble: + % \DeclareTranslation{English}{Kueche}{kitchen} + % \DeclareTranslation{German}{Kueche}{K\"uche} + % \DeclareTranslation{Spanish}{Kueche}{cocina} + % \DeclareTranslation{French}{Kueche}{cuisine} + + \GetTranslation{Kueche} + \SaveTranslation\kitchen{Kueche} + \SaveTranslationFor\cuisine{french}{Kueche} + + \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 +the translation for the main language if no extra translation was declared: + +\begin{example} + % in the preamble: + % \DeclareTranslation{English}{farbe}{color} + % \DeclareTranslation{British}{farbe}{colour} + + \GetTranslationFor{English}{farbe} + \GetTranslationFor{British}{farbe} + \GetTranslationFor{American}{farbe} +\end{example} + +\subsection{Usage in Packages} +\subsubsection{Basic Structure} +A typical usage in a package would look as follows: +\begin{sourcecode} + \RequirePackage{translations} + \DeclareTranslationFallback{mypackage-title}{Nice Title} + \DeclareTranslation{English}{mypackage-title}{Nice Title} + \DeclareTranslation{French}{mypackage-title}{Beau Titre} + \DeclareTranslation{German}{mypackage-title}{Sch\"{o}ner Titel} + ... + \newcommand*\mypackage@title{\GetTranslation{mypackage-title}} +\end{sourcecode} + +That is, a package defines some unique key for an expression and at least +defines a fallback translation. Additionally translations for as many +languages as the author wants are defined. A user then may add +\cs{DeclareTranslation}\marg{language}\marg{translation} if they find their +translation missing. + +\subsubsection{The `fallback' language} +If a user has neither loaded \pkg{babel} nor \pkg{polyglossia} \translations\ +will use English as language and translate to English if the translation was +provided. If the user \emph{has} loaded one of the language packages but has +chosen a language for which no translation is defined the language `fallback' +will be used, \ie, the translation provided with +\cs{DeclareTranslationFallback}. If no fallback translation is provided +either the translation will expand to the literal string. + +The following three examples should make this concept clear: + +\begin{example}[compile] + \documentclass[margin=5mm]{standalone} + \usepackage{translations} + \DeclareTranslation{German}{foo-literal}{foo-german} + \begin{document} + \GetTranslation{foo-literal} % foo-literal + \end{document} +\end{example} + +\begin{example}[compile] + \documentclass[margin=5mm]{standalone} + \usepackage{translations} + \DeclareTranslationFallback{foo-literal}{foo} + \DeclareTranslation{German}{foo-literal}{foo-german} + \begin{document} + \GetTranslation{foo-literal} % foo + \end{document} +\end{example} + +\begin{example}[compile] + \documentclass[margin=5mm]{standalone} + \usepackage[ngerman]{babel} + \usepackage{translations} + \DeclareTranslationFallback{foo-literal}{foo} + \DeclareTranslation{German}{foo-literal}{foo-german} + \begin{document} + \GetTranslation{foo-literal} % foo-german + \end{document} +\end{example} + +\subsection{Dictionaries}\label{sec:dictionaries} +\subsubsection{Background} +\translations\ provides the means to write dictionary files that can be loaded +by packages or in a document. Dictionaries can be loaded for the currently +active language with \cs{LoadDictionary} or for a specific language with +\cs{LoadDictionaryFor}. + +\begin{commands} + \command{LoadDictionary}[\marg{name}] + Loads a file named \code{\meta{name}-\meta{lang}.trsl} where \meta{lang} + corresponds to the lowercase name of the current language or base language + as defined with \cs{DeclareLanguage}. This file should contain the + translations for the specified language. This means if \meta{lang} is a + dialect and a dictionary exists the dictionary is used. If it doesn't + exist but there is a dictionary for the base language that one is used. + \command{LoadDictionaryFor}[\marg{lang}\marg{name}] + Loads a file named \code{\meta{name}-\meta{lang}.trsl} where \meta{lang} + corresponds to the lowercase name of the current language or base language + as defined with \cs{DeclareLanguage}. This file should contain the + translations for the specified language. This means if \meta{lang} is a + dialect and a dictionary exists the dictionary is used. If it doesn't + exist but there is a dictionary for the base language that one is used. + \command{LoadDictionaryForDialect}[\marg{lang}\marg{name}] + \sinceversion{1.3}Loads a file named \code{\meta{name}-\meta{lang}.trsl} + where \meta{lang} corresponds to the lowercase name of the current + language as defined with \cs{DeclareLanguage}. This file should contain + the translations for the specified language. This command \emph{does not + look} for a base language dictionary. +\end{commands} + +A package could provide dictionary files for its language dependent settings +and include the needed one at begin document. The basics for creating a +dictionary file are explained in section~\ref{sec:own-dictionaries}. + +\translations\ already provides a few basic dictionary files. If the main +document language fits to one of the provided files the corresponding basic +dictionary is loaded at begin document by \translations, see +section~\ref{sec:transl-basic-dict} for more on this. + +\subsubsection{Own Dictionaries}\label{sec:own-dictionaries} +A typical dictionary file should look as follows: +\begin{sourcecode} + % this is file housing-german.trsl + \ProvideDictionaryFor{German}{housing}[] + \ProvideDictTranslation{kitchen (housing)}{K\"uche} + \ProvideDictTranslation{bathroom (housing)}{Bad} + \ProvideDictTranslation{living room (housing)}{Wohnzimmer} + \ProvideDictTranslation{bedroom (housing)}{Schlafzimmer} + ... + \endinput +\end{sourcecode} + +The usage is similar to the one in a package: unique keys are given +translations, this time for the language the dictionary file is declared for +only. Translations can be declared by one of the following commands: +\begin{commands} + \command{NewDictTranslation}[\marg{key}\marg{translation}] + \sinceversion{0.10}This command is to be used in a dictionary file and + picks up the language of that file. Issues an error if either the + translation for the \meta{key} or the dictionary entry for the \meta{key} + already exists. + \command{RenewDictTranslation}[\marg{key}\marg{translation}] + \sinceversion{0.10}This command is to be used in a dictionary file and + picks up the language of that file. Issues an error if either the + translation for the \meta{key} or the dictionary entry for the \meta{key} + doesn't exist. + \command{ProvideDictTranslation}[\marg{key}\marg{translation}] + \sinceversion{0.10}This command is to be used in a dictionary file and + picks up the language of that file. Only defines the translation and adds + a corresponding dictionary entry if they don't exist yet. This command is + used in the dictionaries that a part of \translations. + \command{DeclareDictTranslation}[\marg{key}\marg{translation}] + This command is to be used in a dictionary file and picks up the language + of that file, see \cref{sec:dictionaries} for an example. Defines the + translation and adds a dictionary entry regardless if they exist or not. +\end{commands} + +Every dictionary file \emph{must} contain the declaration +\cs{ProvideDictionaryFor}: +\begin{commands} + \command{ProvideDictionaryFor}[\marg{lang}\marg{name}\oarg{date}] + Needs to be in a dictionary file. This command tells \translations\ that + the file indeed is a dictionary and also sets the language for the + dictionary which is used by \cs{NewDictTranslation} or similar commands. +\end{commands} + +\subsubsection{\translations' Basic Dictionaries}\label{sec:transl-basic-dict} +\translations\ already provides a basic dictionary for the languages +\begin{itemize} + \item Catalan, + \item English, + \item Dutch, + \item French, + \item German, and + \item Spanish. +\end{itemize} +The corresponding dictionary is loaded automatically if the document language +is one of these languages. If you'd like to contribute and add the basic +dictionary in your language this is more than welcome and highly appreciated! +The easiest way to do this would be to copy one of the existing files +\code{translations-basic-dictionary-\meta{lang}.trsl} and modify the file +accordingly. You can then send me the file via email and I'll add it to +\translations. + +\Cref{tab:dict} lists all words provided by the basic dictionary for German. + +\begin{longtable}{ll} + \caption{All entries of \translations' basic dictionary in German.\label{tab:dict}} \\ + \toprule + \rmfamily\bfseries key & \bfseries translation \\ + \midrule + \endfirsthead + \toprule + \rmfamily\bfseries key & \bfseries translation \\ + \midrule + \endhead + \bottomrule + \endlastfoot + \midrule + & \hfill\emph{continues} \\ + \endfoot + \PrintDictionaryFor{German}{translations-basic-dictionary}{\ttfamily}{&}{\\} +\end{longtable} + + +\section{Defined Languages}\label{sec:languages} +\subsection{Base Languages}\label{ssec:languages:base} +Quite a number of languages already are defined, either directly or via an +alias. So, before you define a language you should take a look at the tables +below if the language doesn't already exist. \Cref{tab:languages} lists all +base languages, ``fallback'' being a dummy language used for fallback +translations. \Cref{tab:languages,tab:dialects,tab:aliases} list \emph{all} +language names known to \translations. However, they're not sorted +alphabetically but listed in the order they have been defined. I tried to +make the definitions in an alphabetical order but sometimes rather grouped +related language names together. + +If you miss a language or recognize a language that has falsely been declared +as an alias but should rather be a dialect or base language itself (or any +variation of this theme) please let me know, preferably with a short +explanation what's wrong and why. + +\newcounter{column} +\def\seplang{% + \stepcounter{column}% + \ifnumless{\value{column}}{5} + {&} + {\\\setcounter{column}{0}}% +} +\def\do#1{#1\seplang} +\makeatletter +\begin{longtable}{lllll} + \caption{Base languages defined by \translations, from left to right in + the order of definition.\label{tab:languages}} \\ + \toprule + \endfirsthead + \toprule + \endhead + \bottomrule + \endlastfoot + \midrule + &&&& \hfill\emph{continues} \\ + \endfoot + \dolistloop\@trnslt@languages +\end{longtable} +\makeatother + +\subsection{Language Dialects}\label{ssec:languages:dialects} +\translations\ also defines a few dialects of thebase languages. They are +listed in \cref{tab:dialects}. The decision what is a dialect and what is an +alias is not always clear. I am no linguist so I looked up information +available on the internet. A language that was described as +\enquote{standardized register} was always defined as a dialect. For some +other languages it seemed to make sense, such as British or Austrian. The +decisions are open for debate. + +\setcounter{column}{0} +\gdef\seplang{% + \ifnumgreater{\value{column}}{3} + {\setcounter{column}{1}} + {\stepcounter{column}}% + \ifnumless{\value{column}}{4} + {&} + {\\}% +} +\def\aliases#1#2{#1\seplang #2\seplang} +\def\do#1{\aliases#1} +\makeatletter +\begin{longtable}{ll@{\hspace*{4em}}ll} + \caption{All dialects defined by \translations, from left to right in the + order of definition.\label{tab:dialects}}\\ + \toprule + \bfseries dialect & \bfseries language & + \bfseries dialect & \bfseries language \\ + \midrule + \endfirsthead + \toprule + \bfseries dialect & \bfseries language & + \bfseries dialect & \bfseries language \\ + \midrule + \endhead + \bottomrule + \endlastfoot + \midrule + &&& \hfill\emph{continues} \\ + \endfoot + \dolistloop\@trnslt@dialects@pair +\end{longtable} +\makeatother + +\subsection{Language Aliases}\label{ssec:languages:aliases} +To most of the base languages and dialects at least one alias exists, the +uppercase variant. This is due to the fact that it is common to write +language names uppercased. For a number of languages aliases were defined in +order to match \pkg{babel}'s or \pkg{polyglossia}'s names for the +languages. Others are defined because there apparently exist more than one +name for the same language. The decisions are not consistent. For example it +could be argued that \enquote{deutsch} is an alias of \enquote{German}. I am +open to suggestions and improvements. All defined aliases are listed in +\cref{tab:aliases}. + +\setcounter{column}{0} +\makeatletter +\begin{longtable}{ll@{\hspace*{4em}}ll} + \caption{All language aliases defined by \translations, from left to right + in the order of definition.\label{tab:aliases}}\\ + \toprule + \bfseries alias & \bfseries language & + \bfseries alias & \bfseries language \\ + \midrule + \endfirsthead + \toprule + \bfseries alias & \bfseries language & + \bfseries alias & \bfseries language \\ + \midrule + \endhead + \bottomrule + \endlastfoot + \midrule + &&& \hfill\emph{continues} \\ + \endfoot + \dolistloop\@trnslt@aliases@pair +\end{longtable} +\makeatother + +These languages \emph{should} cover all languages which are currently covered +by \pkg{babel} and \pkg{polyglossia} but very likely this is not the +case. Should you miss a language please send me an email so I can add it to +\translations. + +% \section{Implementation} +% \lstinputlisting[style=cnltx]{translations.sty} + +\end{document} -- cgit v1.2.3