1 The Turkish language

The file turkish.dtx^{1} defines all the language definition macros for the Turkish language^{2}.

Turkish typographic rules specify that a little ‘white space’ should be added before the characters ‘:’, ‘!’ and ‘=’. In order to insert this white space automatically these characters are made ‘active’. Also \frenhspacing is set.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

1 ⟨∗code⟩

 2 \LdfInit{turkish}\captionsturkish

When this file is read as an option, i.e. by the \usepackage command, turkish could be an ‘unknown’ language in which case we have to make it known. So we check for the existence of \l@turkish to see whether we have to do something here.

 3 \ifx\l@turkish\@undefined
 4 \@nopatterns{Turkish}
 5 \adddialect\l@turkish0\fi

The next step consists of defining commands to switch to (and from) the Turkish language.

\captionsturkish The macro \captionsturkish defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 6 \addto\captionsturkish{%
 7 \def\prefacename{Preface}% <-- This needs translation!!
 8 \def\refname{Ba\c svurulan Kitaplar}%
 9 \def\abstractname{Konu}%
10 \def\bibname{Bibliografi}%
11 \def\chaptername{Anab\"ol\"um}%
12 \def\appendixname{Appendix}%
13 \def\contentsname{\.I\c cindekiler}%
14 \def\listfigurename{\c Sekiller Listesi}%
15 \def\listtablename{Tablolar\i{}n Listesi}%
16 \def\indexname{\.Index}%
17 \def\figurename{\c Sekiller}%
18 \def\tablename{Tablo}%
19 \def\partname{B\"ol\"um}%
20 \def\enclname{Ekler}%
21 \def\ccname{G\"onderen}%
22 \def\headtoname{Al\i{}c\i}%
23 \def\pagename{Sayfa}%
24 \def\subjectname{To}% <-- This needs translation!!
25 \def\seename{see}% <-- This needs translation!!
26 \def\alsoname{see also}% <-- This needs translation!!
27 \def\proofname{Proof}% <-- This needs translation!!
28 }%

1The file described in this section has version number v1.2i and was last revised on 1996/12/23.

2Mustafa Burc, z6001@rziris01.rrz.uni-hamburg.de provided the code for this file. It is based on the work by Pierre Mackay

\dateturkish The macro \dateturkish redefines the command \today to produce Turkish dates.

29 \def\dateturkish{%
30 \def\today{\number\day.~\ifcase\month\or
31  Ocak\or \c Subat\or Mart\or Nisan\or May\i{}s\or Haziran\or
32  Temmuz\or A\u gustos\or Eyl\"ul\or Ekim\or Kas\i{}m\or
33  Aral\i{}k\fi
34  \space\number\year}}

\extrasturkish \noextrasturkish The macro \extrasturkish will perform all the extra definitions needed for the Turkish language. The macro \noextrasturkish is used to cancel the actions of

\extrasturkish.

Turkish typographic rules specify that a little ‘white space’ should be added before the characters ‘:’, ‘!’ and ‘=’. In order to insert this white space automatically these characters are made \active, so they have to be treated in a special way.

35 \initiate@active@char{:}
36 \initiate@active@char{!}
37 \initiate@active@char{=}

We specify that the turkish group of shorthands should be used.

38 \addto\extrasturkish{\languageshorthands{turkish}}

These characters are ‘turned on’ once, later their definition may vary.

39 \addto\extrasturkish{%
40 \bbl@activate{:}\bbl@activate{!}\bbl@activate{=}}

For Turkish texts \frenchspacing should be in effect. We make sure this is the case and reset it if necessary.

41 \addto\extrasturkish{\bbl@frenchspacing}
42 \addto\noextrasturkish{\bbl@nonfrenchspacing}

\turkish@sh@!@ \turkish@sh@=@ \turkish@sh@:@ The definitions for the three active characters were made using intermediate macros. These are defined now. The insertion of extra ‘white space’ should only happen outside math mode, hence the check \ifmmode in the macros.

43 \declare@shorthand{turkish}{:}{%
44 \ifmmode
45  \string:%
46 \else\relax
47  \ifhmode
48  \ifdim\lastskip>\z@
49  \unskip\penalty\@M\thinspace
50  \fi
51  \fi
52  \string:%
53 \fi}
54 \declare@shorthand{turkish}{!}{%
55 \ifmmode
56  \string!%
57 \else\relax
58  \ifhmode
59  \ifdim\lastskip>\z@
60  \unskip\penalty\@M\thinspace
61  \fi

62  \fi
63  \string!%
64 \fi}
65 \declare@shorthand{turkish}{=}{%
66 \ifmmode
67  \string=%
68 \else\relax
69  \ifhmode
70  \ifdim\lastskip>\z@
71  \unskip\kern\fontdimen2\font
72  \kern-1.4\fontdimen3\font
73  \fi
74  \fi
75  \string=%
76 \fi}

The macro \ldf@finish takes care of looking for a configuration file, setting the main language to be switched on at \begin{document} and resetting the category code of @ to its original value.

77 \ldf@finish{turkish}

78 ⟨/code⟩