| 1 |
% Language definition file (part of polyglossia v2.10 -- 2026/04/18) |
| 2 |
% |
| 3 |
\ProvidesFile{gloss-mongolian.ldf}[polyglossia: module for Mongolian] |
| 4 |
|
| 5 |
\RequirePackage{xpg-cyrillicnumbers} |
| 6 |
|
| 7 |
\PolyglossiaSetup{mongolian}{ |
| 8 |
bcp47=mn, |
| 9 |
bcp47-language=mn, |
| 10 |
bcp47-script=Cyrl, |
| 11 |
script=Cyrillic, |
| 12 |
scripttag=cyrl, |
| 13 |
langtag=MNG, |
| 14 |
hyphennames={mongolian}, |
| 15 |
hyphenmins={2,2}, |
| 16 |
frenchspacing=true, |
| 17 |
localnumeral=mongoliannumerals, |
| 18 |
Localnumeral=Mongoliannumerals |
| 19 |
} |
| 20 |
|
| 21 |
% BCP-47 compliant aliases |
| 22 |
\setlanguagealias*{mongolian}{mn} |
| 23 |
|
| 24 |
% This file is derived from mongolian-babel. which |
| 25 |
% provides support for Mongolian (Khalkha variety) |
| 26 |
% with Cyrillic script |
| 27 |
% TODO: Implement script=mongolian and maybe other |
| 28 |
% variants of Mongolian |
| 29 |
|
| 30 |
\newif\ifcyrillic@numerals |
| 31 |
\newif\ifcyrillic@asbuk@numerals |
| 32 |
|
| 33 |
\DeclareKeys[polyglossia/gloss/mongolian] |
| 34 |
{ |
| 35 |
babelshorthands.if = mongolian@babelshorthands, |
| 36 |
babelshorthands.default:n = true, |
| 37 |
numerals.choice:, |
| 38 |
numerals / arabic.code = |
| 39 |
{% |
| 40 |
\cyrillic@numeralsfalse |
| 41 |
\cyrillic@asbuk@numeralsfalse |
| 42 |
}, |
| 43 |
numerals / cyrillic.code = |
| 44 |
{% |
| 45 |
\cyrillic@numeralstrue |
| 46 |
\cyrillic@asbuk@numeralsfalse |
| 47 |
}, |
| 48 |
numerals / cyrillic-trad.code = |
| 49 |
{% |
| 50 |
\cyrillic@numeralstrue |
| 51 |
\cyrillic@asbuk@numeralsfalse |
| 52 |
}, |
| 53 |
numerals / cyrillic-alph.code = |
| 54 |
{% |
| 55 |
\cyrillic@numeralstrue |
| 56 |
\cyrillic@asbuk@numeralstrue |
| 57 |
}, |
| 58 |
numerals.default:n = arabic, |
| 59 |
numerals/unknown.code = \xpg@warning{Unknown Mongolian numerals value `#1'} |
| 60 |
} |
| 61 |
|
| 62 |
\ifsystem@babelshorthands |
| 63 |
\SetGlossOptions{mongolian}{babelshorthands=true} |
| 64 |
% Register default options |
| 65 |
\InitializeGlossOptions{mongolian}{babelshorthands=true,numerals=arabic} |
| 66 |
\else |
| 67 |
\SetGlossOptions{mongolian}{babelshorthands=false} |
| 68 |
% Register default options |
| 69 |
\InitializeGlossOptions{mongolian}{babelshorthands=false,numerals=arabic} |
| 70 |
\fi |
| 71 |
|
| 72 |
\InitializeBabelShorthands |
| 73 |
|
| 74 |
\def\mongolian@shorthands{% |
| 75 |
\xpg@activate@shorthands% |
| 76 |
\def\language@group{mongolian}% |
| 77 |
\declare@shorthand{mongolian}{"`}{„}% |
| 78 |
\declare@shorthand{mongolian}{"'}{“}% |
| 79 |
\declare@shorthand{mongolian}{"<}{«}% |
| 80 |
\declare@shorthand{mongolian}{">}{»}% |
| 81 |
\declare@shorthand{mongolian}{""}{\xpg@invisible@break}% |
| 82 |
\declare@shorthand{mongolian}{"~}{\xpg@nobreak@hyphen}% |
| 83 |
\declare@shorthand{mongolian}{"=}{\xpg@breakable@hyphen}% |
| 84 |
\declare@shorthand{mongolian}{"|}{\xpg@ligature@break}% |
| 85 |
\declare@shorthand{mongolian}{"-}{\xpg@cyrillic@dash}% |
| 86 |
\declare@shorthand{mongolian}{",}{\xpg@thinspace@allow@hyphenation@after}% |
| 87 |
} |
| 88 |
|
| 89 |
\ifx\cyrdash\undefined |
| 90 |
\def\cyrdash{\leavevmode\hbox to.8em{\textendash\hss\textendash}}% |
| 91 |
\fi |
| 92 |
|
| 93 |
\def\nomongolian@shorthands{% |
| 94 |
\xpg@deactivate@shorthands% |
| 95 |
} |
| 96 |
|
| 97 |
% Taken from babel-mongolian |
| 98 |
\def\captionsmongolian{% |
| 99 |
\def\prefacename{Өмнөх үг}% |
| 100 |
\def\refname{Ашигласан ном}% |
| 101 |
\def\abstractname{Удиртгал}% |
| 102 |
\def\bibname{Номзүй}% |
| 103 |
\def\chaptername{Бүлэг}% |
| 104 |
\def\appendixname{Хавсралт}% |
| 105 |
\@ifundefined{thechapter}% |
| 106 |
{\def\contentsname{Агуулга}}% |
| 107 |
{\def\contentsname{Гарчиг}}% |
| 108 |
\def\listfigurename{Зургийн жагсаалт}% |
| 109 |
\def\listtablename{Хүснэгтийн жагсаалт}% |
| 110 |
\def\indexname{Товъёг}% |
| 111 |
\def\authorname{Нэрийн хэлхээ}% |
| 112 |
\def\figurename{Зураг}% |
| 113 |
\def\tablename{Хүснэгт}% |
| 114 |
\def\partname{Хэсэг}% |
| 115 |
\def\enclname{Ишлэл}% |
| 116 |
\def\ccname{э.с.}% |
| 117 |
\def\headtoname{}% |
| 118 |
\def\pagename{тал}% |
| 119 |
\def\seename{талд үз}% |
| 120 |
\def\alsoname{мөн талд үз}% |
| 121 |
\def\proofname{Баталгаа}% |
| 122 |
} |
| 123 |
|
| 124 |
\def\datemongolian{% |
| 125 |
\def\today{\number\year~оны \ifcase\month\or |
| 126 |
1-р\or 2-р\or 3-р\or 4-р\or 5-р\or 6-р\or |
| 127 |
7-р\or 8-р\or 9-р\or 10-р\or 11-р\or 12-р\fi |
| 128 |
~сарын \number\day}} |
| 129 |
|
| 130 |
\newcommand{\mongoliannumerals}[2]{\mongoliannumber{#2}} |
| 131 |
\newcommand{\Mongoliannumerals}[2]{\Mongoliannumber{#2}} |
| 132 |
|
| 133 |
\def\mongoliannumber#1{% |
| 134 |
\ifcyrillic@numerals |
| 135 |
\ifcyrillic@asbuk@numerals |
| 136 |
\mongolian@asbuk@alph{#1}% |
| 137 |
\else |
| 138 |
\cyr@alph{#1}% |
| 139 |
\fi |
| 140 |
\else |
| 141 |
\number#1% |
| 142 |
\fi% |
| 143 |
} |
| 144 |
|
| 145 |
\def\Mongoliannumber#1{% |
| 146 |
\ifcyrillic@numerals |
| 147 |
\ifcyrillic@asbuk@numerals |
| 148 |
\mongolian@asbuk@Alph{#1}% |
| 149 |
\else |
| 150 |
\cyr@Alph{#1}% |
| 151 |
\fi |
| 152 |
\else |
| 153 |
\number#1% |
| 154 |
\fi% |
| 155 |
} |
| 156 |
|
| 157 |
\let\mongoliannumeral=\mongoliannumber |
| 158 |
\let\Mongoliannumeral=\Mongoliannumber |
| 159 |
|
| 160 |
\def\Asbuk#1{\expandafter\mongolian@asbuk@Alph\csname c@#1\endcsname} |
| 161 |
\def\asbuk#1{\expandafter\mongolian@asbuk@alph\csname c@#1\endcsname} |
| 162 |
|
| 163 |
\def\AsbukTrad#1{\expandafter\cyr@Alph\csname c@#1\endcsname} |
| 164 |
\def\asbukTrad#1{\expandafter\cyr@alph\csname c@#1\endcsname} |
| 165 |
|
| 166 |
% This is a poor man's cyrillic alphanumeric. It just uses the alphabet and |
| 167 |
% thus ends at 30. |
| 168 |
\def\mongolian@asbuk@Alph#1{\ifcase#1\or |
| 169 |
А\or Б\or В\or Г\or Д\or Е\or Ж\or |
| 170 |
З\or И\or К\or Л\or М\or Н\or О\or |
| 171 |
П\or Р\or С\or Т\or У\or Ф\or Х\or |
| 172 |
Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я% |
| 173 |
\else\xpg@ill@value{#1}{mongolian@asbuk@Alph}\fi% |
| 174 |
} |
| 175 |
|
| 176 |
\def\mongolian@asbuk@alph#1{\ifcase#1\or |
| 177 |
а\or б\or в\or г\or д\or е\or ж\or |
| 178 |
з\or и\or к\or л\or м\or н\or о\or |
| 179 |
п\or р\or с\or т\or у\or ф\or х\or |
| 180 |
ц\or ч\or ш\or щ\or э\or ю\or я% |
| 181 |
\else\xpg@ill@value{#1}{mongolian@asbuk@alph}\fi% |
| 182 |
} |
| 183 |
|
| 184 |
\def\mongolian@numbers{% |
| 185 |
\let\latin@alph\@alph |
| 186 |
\let\latin@Alph\@Alph |
| 187 |
\ifcyrillic@numerals% |
| 188 |
\def\mongolian@alph##1{\expandafter\mongoliannumeral\expandafter{\the##1}}% |
| 189 |
\def\mongolian@Alph##1{\expandafter\Mongoliannumeral\expandafter{\the##1}}% |
| 190 |
\let\@alph\mongolian@alph% |
| 191 |
\let\@Alph\mongolian@Alph% |
| 192 |
\fi |
| 193 |
} |
| 194 |
|
| 195 |
\def\nomongolian@numbers{% |
| 196 |
\let\@alph\latin@alph% |
| 197 |
\let\@Alph\latin@Alph% |
| 198 |
} |
| 199 |
|
| 200 |
\def\noextras@mongolian{% |
| 201 |
\ifcyrillic@numerals\nomongolian@numbers\fi% |
| 202 |
\ifmongolian@babelshorthands\nomongolian@shorthands\fi% |
| 203 |
} |
| 204 |
|
| 205 |
\def\blockextras@mongolian{% |
| 206 |
\ifcyrillic@numerals\mongolian@numbers\else\nomongolian@numbers\fi% |
| 207 |
\ifmongolian@babelshorthands\mongolian@shorthands\else\nomongolian@shorthands\fi% |
| 208 |
} |
| 209 |
|
| 210 |
\def\inlineextras@mongolian{% |
| 211 |
\ifmongolian@babelshorthands\mongolian@shorthands\else\nomongolian@shorthands\fi% |
| 212 |
} |
| 213 |
|
| 214 |
\endinput |
| 215 |
|