summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/polyglossia/gloss-punjabi.ldf
blob: dd350cb47ef014b5a18c85267527def62d270cbb (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
% Language definition file (part of polyglossia v2.3 -- 2024/09/23)
%
% UTF-8 strings kindly provided by 
% Arvinder Singh Kang, <17-11-2022>
% Amanpreet Singh Brar <17-11-2022>
% Amandeep Singh Saini <17-11-2022>

\ProvidesFile{gloss-punjabi.ldf}[polyglossia: module for Panjabi/Punjabi/pa-Gurmukhi]
\RequirePackage{gurmukhidigits}
\PolyglossiaSetup{punjabi}{
  bcp47=pa,
  bcp47-language=pa,
  bcp47-script=Guru,
  script=Gurmukhi,
  scripttag=gur,
  langtag=pan,
%%  hyphennames={panjabi,punjabi,gurmukhi}, TODO: implement fallback patterns (with ! prefix)
  fontsetup=true,
  localnumeral=punjabinumerals
  %TODO nouppercase=true,
}

% BCP-47 compliant aliases
\setlanguagealias*{punjabi}{pa}

\def\punjabi@language{%
  % patterns are spelled panjabi
  \SetupPolyglossiaLangPatterns{panjabi}%
}

\newif\ifpunjabi@gurmukhi@numerals
\punjabi@gurmukhi@numeralstrue

\DeclareKeys[polyglossia/gloss/punjabi]
  {
    numerals.choice:,
    numerals / gurmukhi.code =
      {%
        \punjabi@gurmukhi@numeralstrue
        \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-guru}%
      },
    numerals / western.code =
      {%
        \punjabi@gurmukhi@numeralsfalse
        \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-latn}%
      },
    numerals.default:n = gurmukhi,
    numerals/unknown.code = \xpg@warning{Unknown Punjabi numeral `#1'}
  }

% Register default options
\InitializeGlossOptions{punjabi}{numerals=gurmukhi}

\newcommand{\punjabinumerals}[2]{\punjabinumber{#2}}

\def\punjabinumber#1{%
  \ifpunjabi@gurmukhi@numerals
    \gurmukhidigits{\number#1}%
  \else
    \number#1%
  \fi}

\let\punjabinumeral=\punjabinumber

\def\captionspunjabi{%
     \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\datepunjabi{%
  \def\today{\punjabinumber\day\space\ifcase\month\or
    ਜਨਵਰੀ\or
    ਫਰਵਰੀ\or
    ਮਾਰਚ\or
    ਅਪ੍ਰੈਲ\or
    ਮਈ\or
    ਜੂਨ\or
    ਜੁਲਾਈ\or
    ਅਗਸਤ\or
    ਸਤੰਬਰ\or
    ਅਕਤੂਬਰ\or
    ਨਵੰਬਰ\or
    ਦਸੰਬਰ\fi
    \space\punjabinumber\year}%
}

\endinput