Сondition to change language of the month on titlepage doesn't work.
How to write condition to activate russian or english date depending on the choice?
XeLaTeX is used.
My code doesn't work. MWE:
\documentclass[10pt, oneside, a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{polyglossia}
\setotherlanguage{russian}
\foreignlanguage{russian}
\usepackage{datetime}
\ifthenelse{\umruslang>0}
{ %rus
\newcommand{\rus}[1]{\foreignlanguage{russian}{#1}}
\newdateformat{docdatef}{\rus{\monthname\ \THEYEAR}}
}
{%eng
\newdateformat{docdatef}{\monthname\ \THEYEAR}
}
Best Answer
The language definition file
dt-russian.def
(provided bydatetime
) uses commands like\cyrya
in the month names, which aren't provided with XeLaTeX. However,datetime
has been replaced bydatetime2
and the correspondingdatetime2-russian
module (which needs to be installed separately) provides UTF-8 support.MWE: