summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf
blob: 3fa551dd56adc8e825e6347be686d268791d52eb (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
106
107
108
109
110
111
112
113
114
115
% UTF-8 strings kindly provided by Zdenĕk Wagner, 10-03-2008
% with corrections and additional contributions by Anshuman Pandey
% TODO: add option for velthuis transliteration with link to
% Velthuis Devanagari project.

\ProvidesFile{gloss-hindi.ldf}[polyglossia: module for hindi]
\RequirePackage{devanagaridigits}
\PolyglossiaSetup{hindi}{
  bcp47=hi,
  script=Devanagari,
  scripttag=deva,
  langtag=HIN,
%%  hyphennames={hindi,!sanskrit}, TODO: implement fallback patterns (with ! prefix)
  fontsetup=true,
  localnumeral=hindinumerals
  %TODO nouppercase=true,
}

% BCP-47 compliant aliases
\setlanguagealias*{hindi}{hi}

\ifx\l@hindi\@undefined%
  \ifx\l@sanskrit\@undefined%
    \xpg@nopatterns{Hindi}%
    \adddialect\l@hindi\l@nohyphenation%
  \else
    \xpg@warning{No hyphenation patterns were loaded for Hindi\MessageBreak
    I will use the patterns for Sanskrit instead}
    \adddialect\l@hindi\l@sanskrit%
  \fi
\fi

\def\hindi@language{%
  \polyglossia@setup@language@patterns{hindi}%
}

\def\tmp@western{Western}
\newif\ifhindi@devanagari@numerals
\hindi@devanagari@numeralstrue

\define@key{hindi}{numerals}[Devanagari]{%
  \def\@tmpa{#1}%
  \ifx\@tmpa\tmp@western
    \hindi@devanagari@numeralsfalse
  \fi%
}

% Register default options
\xpg@initialize@gloss@options{hindi}{numerals=Devanagari}

\newcommand{\hindinumerals}[2]{\hindinumber{#2}}

\def\hindinumber#1{%
  \ifhindi@devanagari@numerals
    \devanagaridigits{\number#1}%
  \else
    \number#1%
  \fi}

\def\captionshindi{%
     \def\abstractname{सारांश}%
     \def\appendixname{परिशिष्ट}%
     \def\bibname{संदर्भ ग्रंथ}%
     \def\ccname{}%
     \def\chaptername{अध्याय}%
     \def\contentsname{विषय सूची}%
     \def\enclname{}%
     \def\figurename{चित्र}% रेखाचित्र
     \def\headpagename{पृष्ठ}%
     \def\headtoname{}%
     \def\indexname{सूची}%
     %              सूचक
     %              अनुक्रमणिका
     %              अनुक्रमणि
     \def\listfigurename{चित्रों की सूची}%
     \def\listtablename{तालिकाओं की सूची}%
     \def\pagename{पृष्ठ}%
     \def\partname{खणड}%
     \def\prefacename{प्रस्तावना}% प्राक्कथन
     \def\refname{हवाले}%
     \def\tablename{तालिका}%
     \def\seename{देखिए}%
     \def\alsoname{और देखिए}%
     \def\alsoseename{और देखिए}%
}
\def\datehindi{%
  \def\today{\hindinumber\day\space\ifcase\month\or
    जनवरी\or
    फ़रवरी\or
    मार्च\or
    अपरैल\or
    मई\or
    जून\or
    जलाई\or
    अगस्त\or
    सितम्बर\or
    अक्तूबर\or
    नवम्बर\or
    दिसम्बर\fi
    \space\hindinumber\year}%
}

% Save original \MakeUppercase definition
\let\xpg@save@MakeUppercase\MakeUppercase

\def\blockextras@hindi{%
  \def\MakeUppercase##1{##1}%
}

\def\noextras@hindi{%
   % restore original \MakeUppercase definition
   \let\MakeUppercase\xpg@save@MakeUppercase%
}

\endinput