summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-01-29 22:37:53 +0000
committerKarl Berry <karl@freefriends.org>2020-01-29 22:37:53 +0000
commit015c5f064b14e4a79f151b46a6dd46b150520c81 (patch)
treecc3434d0ae73900950b37bc952816286d4d76d5c /Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf
parente9549ffe43d42fda4e5d3778e1d26fbd95e4ae9f (diff)
polyglossia (29jan20)
git-svn-id: svn://tug.org/texlive/trunk@53592 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf')
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf95
1 files changed, 67 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf
index f638bdbf7d8..0088a6438df 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf
@@ -3,6 +3,7 @@
\RequirePackage{xpg-cyrillicnumbers}
\PolyglossiaSetup{russian}{
+ bcp47=ru,
script=Cyrillic,
scripttag=cyrl,
langtag=RUS,
@@ -15,11 +16,16 @@
Localnumeral=Russiannumerals
}
+% BCP-47 compliant aliases
+\setlanguagealias*{russian}{ru}
+\setlanguagealias*[spelling=modern]{russian}{ru-luna1918}
+\setlanguagealias*[spelling=old]{russian}{ru-petr1708}
+
\newif\if@russian@modern
\define@key{russian}{spelling}[modern]{%
\ifstrequal{#1}{old}%
- {\@russian@modernfalse}%
- {\@russian@moderntrue}%
+ {\@russian@modernfalse\SetLanguageKeys{russian}{bcp47=ru-petr1708}}%
+ {\@russian@moderntrue\SetLanguageKeys{russian}{bcp47=ru}}%
}
\def\captionsrussian{%
@@ -31,13 +37,29 @@
}%
\newif\ifcyrillic@numerals
-\define@key{russian}{numerals}[arabic]{%
- \ifstrequal{#1}{cyrillic}%
- {\cyrillic@numeralstrue}%
- {\cyrillic@numeralsfalse}%
-}
+\newif\ifcyrillic@asbuk@numerals
+\define@choicekey*+{russian}{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: Russian, numerals=\val}%
+}{\xpg@warning{Unknown Russian numerals value `#1'}}
-\define@boolkey{russian}[russian@]{indentfirst}{
+\define@boolkey{russian}[russian@]{indentfirst}[true]{
\ifrussian@indentfirst
\SetLanguageKeys{russian}{indentfirst=true}
\else
@@ -45,9 +67,12 @@
\fi
}
-\define@boolkey{russian}[russian@]{babelshorthands}[false]{}
+\define@boolkey{russian}[russian@]{babelshorthands}[true]{}
+
+
+% Register default options
+\xpg@initialize@gloss@options{russian}{babelshorthands=false,spelling=modern,numerals=arabic,indentfirst=false}
-\setkeys{russian}{spelling,numerals}
\ifsystem@babelshorthands
\setkeys{russian}{babelshorthands=true}
@@ -231,7 +256,11 @@
\def\russiannumber#1{%
\ifcyrillic@numerals
- \cyr@alph{#1}%
+ \ifcyrillic@asbuk@numerals
+ \russian@asbuk@alph{#1}%
+ \else
+ \cyr@alph{#1}%
+ \fi
\else
\number#1%
\fi%
@@ -239,7 +268,11 @@
\def\Russiannumber#1{%
\ifcyrillic@numerals
- \cyr@Alph{#1}%
+ \ifcyrillic@asbuk@numerals
+ \russian@asbuk@Alph{#1}%
+ \else
+ \cyr@Alph{#1}%
+ \fi
\else
\number#1%
\fi%
@@ -248,24 +281,30 @@
\let\russiannumeral=\russiannumber
\let\Russiannumeral=\Russiannumber
-\def\Asbuk#1{\expandafter\cyr@Alph\csname c@#1\endcsname}
+\def\Asbuk#1{\expandafter\russian@asbuk@Alph\csname c@#1\endcsname}
+\def\asbuk#1{\expandafter\russian@asbuk@alph\csname c@#1\endcsname}
-\def\asbuk#1{\expandafter\cyr@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}
-% 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\russian@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}{russian@Alph}\fi}
+% This is a poor man's cyrillic alphanumeric. It just uses the alphabet and
+% thus ends at 30.
+\def\russian@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}{russian@asbuk@Alph}\fi%
+}
-%\def\russian@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}{russian@alph}\fi}
+\def\russian@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}{russian@asbuk@alph}\fi%
+}
\def\russian@numbers{%
\let\latin@alph\@alph
@@ -273,8 +312,8 @@
\ifcyrillic@numerals%
\def\russian@alph##1{\expandafter\russiannumeral\expandafter{\the##1}}%
\def\russian@Alph##1{\expandafter\Russiannumeral\expandafter{\the##1}}%
- \let\@alph\russian@alph%
- \let\@Alph\russian@Alph%
+ \let\@alph\russian@alph%
+ \let\@Alph\russian@Alph%
\fi
}