% kazakh.ldf
% Babel language definition for Kazakh
% Copyright (C) 2026 Berik I. Tuleuov
% 
% This file is part of the babel-kazakh package.
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License, version 1.3c or any later version.
% The latest version of this license is available at:
%   https://www.latex-project.org/lppl/
%
% This work has the LPPL maintenance status "maintained".
% The Current Maintainer is Berik I. Tuleuov.
%
% Encoding: UTF-8

\ProvidesLanguage{kazakh}[2026/10/24 v2.0 Kazakh language support]

\LdfInit{kazakh}\captionskazakh
\ifx\undefined\l@kazakh
  \@nopatterns{Kazakh}
  \adddialect\l@kazakh0
\fi

% ------------------------------------------------
% Captions in Kazakh
% ------------------------------------------------
\addto\captionskazakh{%
  \def\prefacename{Алғысөз}%
  \def\refname{Пайдаланған әдебиет}%      Пайдаланылған әдебиеттер
  \def\abstractname{Түйіндеме}%
  \def\bibname{Әдебиет}%                  Әдебиет тізімі
  %\def\chaptername{Тарау}%
  \def\chaptername{тарау}%
  %\def\appendixname{Қосымша}%
  \def\appendixname{қосымша}%
  \def\contentsname{Мазмұны}%
  \def\listfigurename{Суреттер тізімі}%
  \def\listtablename{Кестелер тізімі}%
  \def\indexname{Көрсеткіш}%              Индекс
  %\def\figurename{Сурет}%
  %\def\tablename{Кесте}%
  %\def\partname{Бөлім}%
  \def\figurename{сурет}%
  \def\tablename{кесте}%
  \def\partname{бөлім}%
  \def\enclname{Қосымша}%
  \def\ccname{Көшірме}%
  \def\headtoname{Кімге}%
  \def\pagename{Бет}%
  \def\seename{қараңыз}%
  \def\alsoname{сондай-ақ қараңыз}%
  \def\proofname{Дәлелдеме}%              Дәлел
}

%\setlocalecaption{kazakh}{part.template}{[part][ ][[part]]}
%\setlocalecaption{kazakh}{chapter.template}{[chapter][ ][[chapter]]}
%\setlocalecaption{kazakh}{appendix.template}{[chapter][ ][[appendix]]}
%\setlocalecaption{kazakh}{figure.template}{[figure][ ][[figure]]}
%\setlocalecaption{kazakh}{table.template}{[table][ ][[table]]}

\setlocalecaption{\CurrentOption}{part.template}{[part][ ][[part]]}
\setlocalecaption{\CurrentOption}{chapter.template}{[chapter][ ][[chapter]]}
\setlocalecaption{\CurrentOption}{appendix.template}{[chapter][ ][[appendix]]}
\setlocalecaption{\CurrentOption}{figure.template}{[figure][ ][[figure]]}
\setlocalecaption{\CurrentOption}{table.template}{[table][ ][[table]]}

% ------------------------------------------------
% Number–noun order: 1 сурет, 2 кесте, 3 тарау
% ------------------------------------------------
%\addto\captionskazakh{%
%  \def\fnum@figure{\thefigure \figurename}%
%  \def\fnum@table{\thetable \tablename}%
%  \def\fnum@chapter{\thechapter \chaptername}%
%}

% ------------------------------------------------
% Date format
% ------------------------------------------------
\def\datekazakh{%
  \def\today{%
    \number\day\space
    \ifcase\month\or
      қаңтар\or ақпан\or наурыз\or сәуір\or мамыр\or маусым\or
      шілде\or тамыз\or қыркүйек\or қазан\or қараша\or желтоқсан%
    \fi
    \space\number\year\space ж.%
  }%
}

% ------------------------------------------------
% Activate language
% ------------------------------------------------
\addto\extraskazakh{%
  \lefthyphenmin=2
  \righthyphenmin=2
}

\addto\noextraskazakh{}

\ldf@finish\CurrentOption
\endinput
