summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf
blob: 291afeb01cfbcec511afee5f9c3062bcf62eb7ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
\ProvidesFile{gloss-english.ldf}[polyglossia: module for english]
\PolyglossiaSetup{english}{
  hyphennames={english,american,usenglish,USenglish},
  hyphenmins={2,3},
  fontsetup=true,
}

\newif\if@british@locale
\@british@localefalse
\providebool{@british@hyphen}
\providebool{english@ordinalmonthday}

\define@boolkey{english}[english@]{ordinalmonthday}[true]{}

%% English is a special case in that \l@english is reserved for US English, so
%% we need to handle it differently
\define@key{english}{variant}{%
  %needs to be reset for loop over hyphennames below:
  \def\do##1{%
      \xpg@ifdefined{#1}%
        {\csletcs{l@english}{l@#1}\listbreak}%
        {}%
  }%
  \ifstrequal{#1}{uk}%
    {\@british@localetrue
     \xpg@info{Option: english variant=british}}%
    {\ifstrequal{#1}{british}%
      {\@british@localetrue
      \xpg@info{Option: english variant=british}}%
        {\ifstrequal{#1}{us}% these patterns are the default so we don't need to reset them
          {\@british@hyphenfalse\english@ordinalmonthdayfalse
           \xpg@info{Option: english variant=american}}%
          {\ifstrequal{#1}{american}%
            {\@british@hyphenfalse\english@ordinalmonthdayfalse
            \xpg@info{Option: english variant=american}}%
            {\ifstrequal{#1}{usmax}%
              {\@british@hyphenfalse\english@ordinalmonthdayfalse
                \ifluatex\else\setkeys[xpg@setup]{english}{hyphennames={usenglishmax}}\fi
                \xpg@info{Option: english variant=american (with additional patterns)}%
                \xpg@ifdefined{usenglishmax}{}%
                  {\xpg@warning{No hyphenation patterns were loaded for "US English Max"\MessageBreak
                    I will use the standard patterns for US English instead}%
                  \adddialect\l@usenglishmax\l@english\relax}%
                \gdef\english@language{\language=\l@usenglishmax}}%
                {\ifstrequal{#1}{australian}%
                  {\@british@hyphentrue\english@ordinalmonthdayfalse
                  \xpg@info{Option: english variant=australian}}%
                  {\ifstrequal{#1}{newzealand}%
                    {\@british@hyphentrue\english@ordinalmonthdayfalse
                      \xpg@info{Option: english variant=newzealand}}%
                      {\xpg@warning{Unknown English variant `#1'}}%
  }}}}}}%
  \if@british@locale\@british@hyphentrue\english@ordinalmonthdaytrue\fi
  \if@british@hyphen
    \ifluatex\else\setkeys[xpg@setup]{english}{hyphennames={ukenglish,british,UKenglish}}\fi
    \xpg@ifdefined{ukenglish}{}%
      {\xpg@warning{No hyphenation patterns were loaded for British English\MessageBreak
         I will use the patterns for US English instead}%
       \adddialect\l@ukenglish\l@english\relax}%
    \gdef\english@language{\language=\l@ukenglish\xpg@set@language@luatex@ii{ukenglish}}%
  \fi
  % and we reset \do to its previous definition here:
  \def\do##1{\setotherlanguage{#1}}%
}

\def\captionsenglish{%
   \def\prefacename{Preface}%
   \def\refname{References}%
   \def\abstractname{Abstract}%
   \def\bibname{Bibliography}%
   \def\chaptername{Chapter}%
   \def\appendixname{Appendix}%
   \def\contentsname{Contents}%
   \def\listfigurename{List of Figures}%
   \def\listtablename{List of Tables}%
   \def\indexname{Index}%
   \def\figurename{Figure}%
   \def\tablename{Table}%
   \def\partname{Part}%
   \def\enclname{encl}%
   \def\ccname{cc}%
   \def\headtoname{To}%
   \def\pagename{Page}%
   \def\seename{see}%
   \def\alsoname{see also}%
   \def\proofname{Proof}%
}
\def\dateenglish{%
   \def\english@day{%
     \ifenglish@ordinalmonthday
       \ifcase\day\or
        1st\or 2nd\or 3rd\or 4th\or 5th\or
        6th\or 7th\or 8th\or 9th\or 10th\or
        11th\or 12th\or 13th\or 14th\or 15th\or
        16th\or 17th\or 18th\or 19th\or 20th\or
        21st\or 22nd\or 23rd\or 24th\or 25th\or
        26th\or 27th\or 28th\or 29th\or 30th\or
        31st\fi
     \else\number\day\fi}%
     \def\english@month{\ifcase\month\or
      January\or February\or March\or April\or May\or June\or
      July\or August\or September\or October\or November\or December\fi}%
   \def\today{%
    \if@british@locale
      \english@day\space\english@month\space\number\year
    \else
      \english@month\space\english@day, \number\year
    \fi}%
}

\endinput