summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/polyglossia/gloss-kannada.ldf
blob: 82e89390d3aed86ac984ca6d2d089cb42dd058f2 (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
%% gloss-kannada.ldf
%% Copyright 2011 Aravinda VK <hallimanearavind AT gmail.com>,
%%                Shankar Prasad <prasad.mvs AT gmail.com>,
%%                Team Sanchaya <dev AT lists.sanchaya.net>
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
% 
% The Current Maintainer of this work is Aravinda VK <hallimanearavind AT gmail.com>.
%
% This work consists of the file gloss-kannada.ldf
\ProvidesFile{gloss-kannada.ldf}[polyglossia: module for kannada]
\makeatletter
\PolyglossiaSetup{kannada}{
  script=Kannada,
  scripttag=knda,
  langtag=KNDA,
  hyphennames={kannada},
  hyphenmins={2,2}, 
  fontsetup=true
}

%% Defining Kannada digits equivalents to english
\def\kannadadigits#1{\expandafter\@kannada@digits #1@}
\def\@kannada@digits#1{%
  \ifx @#1% then terminate
  \else
    \ifx0#1೦\else\ifx1#1೧\else\ifx2#1೨\else\ifx3#1೩\else\ifx4#1೪\else\ifx5#1೫\else\ifx6#1೬\else\ifx7#1೭\else\ifx8#1೮\else\ifx9#1೯\else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
    \expandafter\@kannada@digits
  \fi
}

%% \kannada@numerals variable will be set to true or false depending on the option provided in \setmainlanguage
%% \kannada@numerals true by default or when we set \setmainlanguage[numerals=Kannada]{kannada}
%% \kannada@numerals false when we set \setmainlanguage[numerals=Western]{kannada}
\def\tmp@western{Western}
\newif\ifkannada@numerals
\kannada@numeralstrue

\define@key{kannada}{numerals}[Kannada]{%
  \def\@tmpa{#1}%
  \ifx\@tmpa\tmp@western
    \kannada@numeralsfalse
  \fi}

  
\def\captionskannada{%
  \def\prefacename{ಮುನ್ನುಡಿ}%
  \def\refname{ಉಲ್ಲೇಖಗಳು}%
  \def\abstractname{ಸಾರಾಂಶ}%
  \def\bibname{ಗ್ರಂಥಸೂಚಿ}%
  \def\chaptername{ಅಧ್ಯಾಯ}%
  \def\appendixname{ಅನುಬಂಧ}%
  \def\contentsname{ವಿಷಯಗಳು}%
  \def\listfigurename{ಚಿತ್ರಗಳ ಪಟ್ಟಿ}%
  \def\listtablename{ಕೋಷ್ಟಕಗಳ ಪಟ್ಟಿ}%
  \def\indexname{ಸೂಚಿ}%
  \def\figurename{ಚಿತ್ರ}%
  \def\tablename{ಕೋಷ್ಟಕ}%
  \def\partname{ಭಾಗ}%
  \def\enclname{encl}%
  \def\ccname{cc}%
  \def\headtoname{ಗೆ}%
  \def\pagename{ಪುಟ}%
  \def\seename{ನೋಡು}%
  \def\alsoname{ಇದನ್ನೂ ಸಹ ನೋಡು}%
  \def\proofname{ಕರಡುಪ್ರತಿ}%
}

\def\datekannada{%
  \def\kannadamonth{%
    \ifcase\month\or
    ಜನವರಿ\or
    ಫೆಬ್ರವರಿ\or
    ಮಾರ್ಚ್\or
    ಏಪ್ರಿಲ್\or
    ಮೇ\or
    ಜೂನ್\or
    ಜುಲೈ\or
    ಆಗಷ್ಟ್\or
    ಸೆಪ್ಟೆಂಬರ್\or
    ಅಕ್ಟೋಬರ್\or
    ನವಂಬರ್\or
    ಡಿಸಂಬರ್\fi}%
  \def\today{\kannadanumber\day\space\kannadamonth\space\kannadanumber\year}%
}

%% Based on the settings displays rrespective numbers
\def\kannadanumber#1{%
  \ifkannada@numerals
  \kannadadigits{\number#1}%
  \else
  \number#1%
  \fi
}

\makeatother
\endinput