summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf')
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf95
1 files changed, 68 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf
index c02dc9b3bc6..f6c78ad7595 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf
@@ -3,6 +3,7 @@
\RequirePackage{xpg-cyrillicnumbers}
\PolyglossiaSetup{belarusian}{
+ bcp47=be,
script=Cyrillic,
scripttag=cyrl,
langtag=BEL,
@@ -14,30 +15,56 @@
Localnumeral=Belarusiannumerals
}
+% BCP-47 compliant aliases
+\setlanguagealias*[spelling=classic]{belarusian}{be-tarask}
+\setlanguagealias*{belarusian}{be}
+
\def\belarusian@spelling{modern}
\define@choicekey*+{belarusian}{spelling}[\val\nr]{modern,classic,tarask}[modern]{%
\ifcase\nr\relax
% modern:
- \def\belarusian@spelling{modern}
+ \def\belarusian@spelling{modern}%
+ \SetLanguageKeys{belarusian}{bcp47=be}%
\or
% classic:
- \def\belarusian@spelling{tarask}
+ \def\belarusian@spelling{tarask}%
+ \SetLanguageKeys{belarusian}{bcp47=be-tarask}%
\or
% tarask:
- \def\belarusian@spelling{tarask}
+ \def\belarusian@spelling{tarask}%
+ \SetLanguageKeys{belarusian}{bcp47=be-tarask}%
\fi
}{\xpg@warning{Unknown Belarusian spelling `#1'}}
\newif\ifcyrillic@numerals
-\define@key{belarusian}{numerals}[arabic]{%
- \ifstrequal{#1}{cyrillic}%
- {\cyrillic@numeralstrue}%
- {\cyrillic@numeralsfalse}%
-}
+\newif\ifcyrillic@asbuk@numerals
+\define@choicekey*+{belarusian}{numerals}[\val\nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
+ \ifcase\nr\relax
+ % arabic:
+ \cyrillic@numeralsfalse%
+ \cyrillic@asbuk@numeralsfalse%
+ \or
+ % cyrillic:
+ \cyrillic@numeralstrue%
+ \cyrillic@asbuk@numeralsfalse%
+ \or
+ % cyrillic-trad:
+ \cyrillic@numeralstrue%
+ \cyrillic@asbuk@numeralsfalse%
+ \or
+ % cyrillic-alph:
+ \cyrillic@numeralstrue%
+ \cyrillic@asbuk@numeralstrue%
+ \fi
+ \xpg@info{Option: Belarusian, numerals=\val}%
+}{\xpg@warning{Unknown Belarusian numerals value `#1'}}
-\define@boolkey{belarusian}[belarusian@]{babelshorthands}[false]{}
+\define@boolkey{belarusian}[belarusian@]{babelshorthands}[true]{}
-\setkeys{belarusian}{numerals}
+% Register default options
+\xpg@initialize@gloss@options{belarusian}{babelshorthands=false,numerals=arabic,spelling=modern}
+% Register alias options
+\xpg@set@alias@values{belarusian}{spelling}{classic}{tarask}
\ifsystem@babelshorthands
\setkeys{belarusian}{babelshorthands=true}
@@ -202,7 +229,11 @@
\def\belarusiannumber#1{%
\ifcyrillic@numerals
- \cyr@alph{#1}%
+ \ifcyrillic@asbuk@numerals
+ \belarusian@asbuk@alph{#1}%
+ \else
+ \cyr@alph{#1}%
+ \fi
\else
\number#1%
\fi%
@@ -210,7 +241,11 @@
\def\Belarusiannumber#1{%
\ifcyrillic@numerals
- \cyr@Alph{#1}%
+ \ifcyrillic@asbuk@numerals
+ \belarusian@asbuk@Alph{#1}%
+ \else
+ \cyr@Alph{#1}%
+ \fi
\else
\number#1%
\fi%
@@ -219,24 +254,30 @@
\let\belarusiannumeral=\belarusiannumber
\let\Belarusiannumeral=\Belarusiannumber
-\def\Asbuk#1{\expandafter\cyr@Alph\csname c@#1\endcsname}
+\def\Asbuk#1{\expandafter\belarusian@asbuk@Alph\csname c@#1\endcsname}
+\def\asbuk#1{\expandafter\belarusian@asbuk@alph\csname c@#1\endcsname}
+
+\def\AsbukTrad#1{\expandafter\cyr@Alph\csname c@#1\endcsname}
+\def\asbukTrad#1{\expandafter\cyr@alph\csname c@#1\endcsname}
-\def\asbuk#1{\expandafter\cyr@alph\csname c@#1\endcsname}
% This is a poor man's cyrillic alphanumeric. It just uses the alphabet and
-% thus ends at 30. We now use proper cyrillic numbering.
-
-%\def\belarusian@Alph#1{\ifcase#1\or
-% А\or Б\or В\or Г\or Д\or Е\or Ж\or
-% З\or И\or К\or Л\or М\or Н\or О\or
-% П\or Р\or С\or Т\or У\or Ф\or Х\or
-% Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я\else\xpg@ill@value{#1}{belarusian@Alph}\fi}
-
-%\def\belarusian@alph#1{\ifcase#1\or
-% а\or б\or в\or г\or д\or е\or ж\or
-% з\or и\or к\or л\or м\or н\or о\or
-% п\or р\or с\or т\or у\or ф\or х\or
-% ц\or ч\or ш\or щ\or э\or ю\or я\else\xpg@ill@value{#1}{belarusian@alph}\fi}
+% thus ends at 30.
+\def\belarusian@asbuk@Alph#1{\ifcase#1\or
+ А\or Б\or В\or Г\or Д\or Е\or Ж\or
+ З\or И\or К\or Л\or М\or Н\or О\or
+ П\or Р\or С\or Т\or У\or Ф\or Х\or
+ Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я%
+ \else\xpg@ill@value{#1}{belarusian@asbuk@Alph}\fi%
+}
+
+\def\belarusian@asbuk@alph#1{\ifcase#1\or
+ а\or б\or в\or г\or д\or е\or ж\or
+ з\or и\or к\or л\or м\or н\or о\or
+ п\or р\or с\or т\or у\or ф\or х\or
+ ц\or ч\or ш\or щ\or э\or ю\or я%
+ \else\xpg@ill@value{#1}{belarusian@asbuk@alph}\fi%
+}
\def\belarusian@numbers{%
\let\latin@alph\@alph