| 1 |
% Language definition file (part of polyglossia v2.10 -- 2026/04/18) |
| 2 |
% |
| 3 |
\ProvidesFile{gloss-portuguese.ldf}[polyglossia: module for Portuguese] |
| 4 |
|
| 5 |
\PolyglossiaSetup{portuguese}{ |
| 6 |
bcp47=pt-PT, |
| 7 |
bcp47-language=pt, |
| 8 |
bcp47-region=PT, |
| 9 |
bcp47-script=Latn, |
| 10 |
babelname=portuges, |
| 11 |
hyphennames={portuges,portuguese}, |
| 12 |
hyphenmins={2,3}, |
| 13 |
langtag=PTG, |
| 14 |
} |
| 15 |
|
| 16 |
% BCP-47 compliant aliases |
| 17 |
\setlanguagealias*[variant=portuguese]{portuguese}{pt-PT} |
| 18 |
\setlanguagealias*[variant=brazilian]{portuguese}{pt-BR} |
| 19 |
\setlanguagealias*{portuguese}{pt} |
| 20 |
|
| 21 |
% Babel aliases |
| 22 |
\setlanguagealias[variant=portuguese]{portuguese}{portuges} |
| 23 |
\setlanguagealias[variant=brazilian]{portuguese}{brazil} |
| 24 |
|
| 25 |
\ifluatex |
| 26 |
\RequirePackage{luavlna} |
| 27 |
\fi |
| 28 |
|
| 29 |
\def\portuguese@variant{portuges} |
| 30 |
|
| 31 |
\DeclareKeys[polyglossia/gloss/portuguese] |
| 32 |
{ |
| 33 |
babelshorthands.if = portuguese@babelshorthands, |
| 34 |
babelshorthands.default:n = true, |
| 35 |
splithyphens.if = portuguese@splithyphens, |
| 36 |
splithyphens.default:n = true, |
| 37 |
variant.choice:, |
| 38 |
variant / portuguese.code = |
| 39 |
{% |
| 40 |
\def\portuguese@variant{portuges}% |
| 41 |
\SetLanguageKeys{portuguese}{babelname=portuges,bcp47=pt-PT,bcp47-language=pt,bcp47-region=PT}% |
| 42 |
}, |
| 43 |
variant / brazilian.code = |
| 44 |
{% |
| 45 |
\def\portuguese@variant{brazil}% |
| 46 |
\SetLanguageKeys{portuguese}{babelname=brazil,bcp47=pt-BR,bcp47-language=pt,bcp47-region=BR}% |
| 47 |
% There are no specific brazil patterns |
| 48 |
\AddDialectIfNeeded{brazil}{portuges}% |
| 49 |
}, |
| 50 |
variant.default:n = portuguese, |
| 51 |
variant/unknown.code = \xpg@warning{Unknown portuguese variant `#1'}, |
| 52 |
} |
| 53 |
|
| 54 |
\ifsystem@babelshorthands |
| 55 |
\SetGlossOptions{portuguese}{babelshorthands=true} |
| 56 |
% Register default options |
| 57 |
\InitializeGlossOptions{portuguese}{variant=portuguese, |
| 58 |
babelshorthands=true, |
| 59 |
splithyphens=true} |
| 60 |
\else |
| 61 |
\SetGlossOptions{portuguese}{babelshorthands=false} |
| 62 |
% Register default options |
| 63 |
\InitializeGlossOptions{portuguese}{variant=portuguese, |
| 64 |
babelshorthands=false, |
| 65 |
splithyphens=true} |
| 66 |
\fi |
| 67 |
|
| 68 |
\InitializeBabelShorthands |
| 69 |
|
| 70 |
\let\xpg@hyphen@char- |
| 71 |
\def\portuguese@@splhyphen#1{% |
| 72 |
\def\portuguese@sh@tmp{% |
| 73 |
\ifx\portuguese@sh@next\xpg@hyphen@char#1% |
| 74 |
\else\expandafter\portuguese@@@splhyphen{#1}\fi% |
| 75 |
}% |
| 76 |
\futurelet\portuguese@sh@next\portuguese@sh@tmp% |
| 77 |
} |
| 78 |
|
| 79 |
\def\portuguese@@@splhyphen#1{% |
| 80 |
\ifnum\hyphenchar \font>0% |
| 81 |
\kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}% |
| 82 |
\nobreak\hskip\z@% |
| 83 |
\else% |
| 84 |
#1% |
| 85 |
\fi% |
| 86 |
} |
| 87 |
|
| 88 |
\def\portuguese@splhyphen{% |
| 89 |
\portuguese@@splhyphen{-}% |
| 90 |
} |
| 91 |
|
| 92 |
\def\portuguese@shorthands{% |
| 93 |
\xpg@activate@shorthands% |
| 94 |
\def\language@group{portuguese}% |
| 95 |
\declare@shorthand{portuguese}{"=}{\portuguese@splhyphen}% |
| 96 |
\declare@shorthand{portuguese}{""}{\xpg@invisible@break}% |
| 97 |
\declare@shorthand{portuguese}{"~}{\xpg@nobreak@hyphen}% |
| 98 |
\declare@shorthand{portuguese}{"-}{\xpg@add@hyphenation@point}% |
| 99 |
\declare@shorthand{portuguese}{"|}{\xpg@ligature@break}% |
| 100 |
\declare@shorthand{portuguese}{"/}{\xpg@breakable@slash}% |
| 101 |
\declare@shorthand{portuguese}{"<}{«}% |
| 102 |
\declare@shorthand{portuguese}{">}{»}% |
| 103 |
} |
| 104 |
|
| 105 |
\def\noportuguese@shorthands{% |
| 106 |
\xpg@deactivate@shorthands% |
| 107 |
} |
| 108 |
|
| 109 |
\ifxetex |
| 110 |
% splithyphens |
| 111 |
\newXeTeXintercharclass\portuguese@hyphen % - |
| 112 |
\fi |
| 113 |
|
| 114 |
\def\portuguese@hyphens{% |
| 115 |
\ifluatex |
| 116 |
\AfterPreamble{\enablesplithyphens{portuguese}}% |
| 117 |
\else |
| 118 |
\XeTeXinterchartokenstate=1 |
| 119 |
\XeTeXcharclass `\- \portuguese@hyphen |
| 120 |
\XeTeXinterchartoks \z@ \portuguese@hyphen = {\portuguese@@splhyphen}% "-" -> "\portuguese@@splhyphen-" |
| 121 |
\fi% |
| 122 |
} |
| 123 |
|
| 124 |
\def\noportuguese@hyphens{% |
| 125 |
\ifluatex |
| 126 |
\AfterPreamble{\disablesplithyphens{portuguese}}% |
| 127 |
\else |
| 128 |
\XeTeXcharclass `\- \z@ |
| 129 |
\fi% |
| 130 |
} |
| 131 |
|
| 132 |
\def\portuguese@language{% |
| 133 |
\SetupPolyglossiaLangPatterns{\portuguese@variant}% |
| 134 |
}% |
| 135 |
|
| 136 |
\def\captionsportuguese@portuges{% |
| 137 |
\def\refname{Referências}% |
| 138 |
\def\abstractname{Resumo}% |
| 139 |
\def\bibname{Bibliografia}% |
| 140 |
\def\prefacename{Prefácio}% |
| 141 |
\def\chaptername{Capítulo}% |
| 142 |
\def\appendixname{Apêndice}% |
| 143 |
\def\contentsname{Conteúdo}% |
| 144 |
\def\listfigurename{Lista de Figuras}% |
| 145 |
\def\listtablename{Lista de Tabelas}% |
| 146 |
\def\indexname{Índice}% |
| 147 |
\def\figurename{Figura}% |
| 148 |
\def\tablename{Tabela}% |
| 149 |
\def\partname{Parte}% |
| 150 |
\def\pagename{Página}% |
| 151 |
\def\seename{ver}% |
| 152 |
\def\alsoname{ver também}% |
| 153 |
\def\enclname{Anexo}% |
| 154 |
\def\ccname{Com cópia a}% |
| 155 |
\def\headtoname{Para}% |
| 156 |
\def\proofname{Demonstração}% |
| 157 |
\def\glossaryname{Glossário}% |
| 158 |
} |
| 159 |
|
| 160 |
\def\captionsportuguese@brazil{% |
| 161 |
\def\refname{Referências}% |
| 162 |
\def\abstractname{Resumo}% |
| 163 |
\def\bibname{Referências Bibliográficas}% |
| 164 |
\def\prefacename{Prefácio}% |
| 165 |
\def\chaptername{Capítulo}% |
| 166 |
\def\appendixname{Apêndice}% |
| 167 |
\def\contentsname{Sumário}% |
| 168 |
\def\listfigurename{Lista de Figuras}% |
| 169 |
\def\listtablename{Lista de Tabelas}% |
| 170 |
\def\indexname{Índice Remissivo}% |
| 171 |
\def\figurename{Figura}% |
| 172 |
\def\tablename{Tabela}% |
| 173 |
\def\partname{Parte}% |
| 174 |
\def\pagename{Página}% |
| 175 |
\def\seename{veja}% |
| 176 |
\def\alsoname{veja também}% |
| 177 |
\def\enclname{Anexo}% |
| 178 |
\def\ccname{Cópia para}% |
| 179 |
\def\headtoname{Para}% |
| 180 |
\def\proofname{Demonstração}% |
| 181 |
\def\glossaryname{Glossário}% |
| 182 |
} |
| 183 |
|
| 184 |
\def\captionsportuguese{% |
| 185 |
\csname captionsportuguese@\portuguese@variant\endcsname% |
| 186 |
} |
| 187 |
|
| 188 |
\def\dateportuguese@portuges{% |
| 189 |
\def\today{\number\day\space de\space\ifcase\month\or |
| 190 |
Janeiro\or Fevereiro\or Março\or Abril\or Maio\or Junho\or |
| 191 |
Julho\or Agosto\or Setembro\or Outubro\or Novembro\or Dezembro\fi |
| 192 |
\space de\space\number\year}% |
| 193 |
} |
| 194 |
|
| 195 |
|
| 196 |
\def\dateportuguese@brazil{% |
| 197 |
\def\today{\number\day\space de\space\ifcase\month\or |
| 198 |
janeiro\or fevereiro\or março\or abril\or maio\or junho\or |
| 199 |
julho\or agosto\or setembro\or outubro\or novembro\or dezembro% |
| 200 |
\fi\space de\space\number\year}% |
| 201 |
} |
| 202 |
|
| 203 |
\def\dateportuguese{% |
| 204 |
\csname dateportuguese@\portuguese@variant\endcsname% |
| 205 |
} |
| 206 |
|
| 207 |
\def\noextras@portuguese{% |
| 208 |
\ifportuguese@babelshorthands\noportuguese@shorthands\fi% |
| 209 |
\noportuguese@hyphens% |
| 210 |
} |
| 211 |
|
| 212 |
\def\blockextras@portuguese{% |
| 213 |
\ifportuguese@babelshorthands\portuguese@shorthands\else\noportuguese@shorthands\fi% |
| 214 |
\ifportuguese@splithyphens\portuguese@hyphens\else\noportuguese@hyphens\fi% |
| 215 |
} |
| 216 |
|
| 217 |
\def\inlineextras@portuguese{% |
| 218 |
\ifportuguese@babelshorthands\portuguese@shorthands\else\noportuguese@shorthands\fi% |
| 219 |
\ifportuguese@splithyphens\portuguese@hyphens\else\noportuguese@hyphens\fi% |
| 220 |
} |
| 221 |
|
| 222 |
\def\nestedextras@portuguese{% |
| 223 |
\ifluatex% |
| 224 |
\ifportuguese@splithyphens\portuguese@hyphens\else\noportuguese@hyphens\fi% |
| 225 |
\fi% |
| 226 |
} |
| 227 |
|
| 228 |
\endinput |