%D \module
%D   [   file=lang-kor,
%D    version=2007. 12. 5, % 1998.10.10,
%D      title=\CONTEXT\ Language Macros,
%D   subtitle=Korean,
%D     author={Hans Hagen \& },
%D       date=\currentdate,
%D  copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{Context Language Macros / Korean}

%D This module is coded using the \UNICODE\ support built in
%D \CONTEXT. Therefore, \type {\uchar} is used instead of latin
%D characters.

\unprotect

\definesystemconstant{korean}   \definesystemconstant{ko}

\installlanguage
  [\s!ko]
  [\c!leftsentence={\uchar{32}{20}\uchar{32}{20}},
   \c!rightsentence={\uchar{32}{20}\uchar{32}{20}},
   \c!leftsubsentence={\uchar{32}{20}\uchar{32}{20}},
   \c!rightsubsentence={\uchar{32}{20}\uchar{32}{20}},
   \c!leftquote={\uchar{32}{24}},
   \c!rightquote={\uchar{32}{25}},
   \c!leftquotation={\uchar{32}{28}},
   \c!rightquotation={\uchar{32}{29}},
   \c!date={\v!year,{\uchar{177}{68}},\ ,\v!month,\ ,\v!day,{\uchar{199}{124}}},
   \c!state=\v!stop]



\setupheadtext [\s!ko]   [\v!content={\uchar{204}{40}~\uchar{184}{64}}]
\setupheadtext [\s!ko]   [\v!tables={\uchar{212}{92}\ \uchar{204}{40}\uchar{184}{64}}]
\setupheadtext [\s!ko]   [\v!figures={\uchar{173}{248}\uchar{185}{188}\ \uchar{204}{40}\uchar{184}{64}}]
\setupheadtext [\s!ko]   [\v!graphics={\uchar{173}{248}\uchar{185}{188}\ \uchar{204}{40}\uchar{184}{64}}]
%\setupheadtext [\s!ko]    [\v!intermezzi={\koencoding\koencodedintermezzo}]% RG & XJF
\setupheadtext [\s!ko]   [\v!index={\uchar{204}{62}\uchar{197}{68}\uchar{188}{244}\uchar{174}{48}}]
\setupheadtext [\s!ko]   [\v!abbreviations={\uchar{198}{148}\uchar{197}{125}}]
\setupheadtext [\s!ko]   [\v!logos={\uchar{184}{92}\uchar{172}{224}}]
\setupheadtext [\s!ko]   [\v!units={\uchar{178}{232}\uchar{199}{4}}]

\setuplabeltext [\s!ko]  [\v!table={\uchar{212}{92}~}]
\setuplabeltext [\s!ko]  [\v!figure={\uchar{173}{248}\uchar{185}{188}~}]
%\setuplabeltext [\s!ko]   [\v!intermezzo={\koencoding\koencodedintermezzo}]% 
\setuplabeltext [\s!ko]  [\v!graphic={\uchar{173}{248}\uchar{185}{188}~}]%
\setuplabeltext [\s!ko]  [\v!appendix={\uchar{189}{128}\uchar{184}{93}}]%
\setuplabeltext [\s!ko]  [\v!part={\uchar{200}{28}~,\ \uchar{189}{128}}]
\setuplabeltext [\s!ko]  [\v!chapter={\uchar{200}{28}~,\ \uchar{199}{165}}]
\setuplabeltext [\s!ko]  [\v!section={\uchar{200}{28}~,\ \uchar{200}{8}}]

%C '제 1 장', '제 1절'은 \setuphead에서 지정할 수도 있습니다.

\setuplabeltext [\s!ko]  [\v!line={\uchar{213}{137}}]%
\setuplabeltext [\s!ko]  [\v!lines={\uchar{213}{137}}]%
\setuplabeltext [\s!ko]  [\v!page={\uchar{202}{189}}]%
\setuplabeltext [\s!ko]  [\v!atpage={,\uchar{202}{189}}]%

\setuplabeltext [\s!ko]  [\v!subsection=]
\setuplabeltext [\s!ko]  [\v!subsubsection=]
\setuplabeltext [\s!ko]  [\v!subsubsubsection=]

%D From this definition one can deduce that language, input
%D encoding, font encoding, and glyph meaning form a pretty
%D complex four dimensional space.

\expandafter\ifx\csname luatexversion\endcsname\relax % if not luatex
    \startlanguagespecifics[\s!ko]
\fi

\setuplabeltext [\s!ko]  [\v!january={1\uchar{198}{212}}]
\setuplabeltext [\s!ko]  [\v!february={2\uchar{198}{212}}]
\setuplabeltext [\s!ko]  [\v!march={3\uchar{198}{212}}]
\setuplabeltext [\s!ko]  [\v!april={4\uchar{198}{212}}]
\setuplabeltext [\s!ko]  [\v!may={5\uchar{198}{212}}]
\setuplabeltext [\s!ko]  [\v!june={6\uchar{198}{212}}]
\setuplabeltext [\s!ko]  [\v!july={7\uchar{198}{212}}]
\setuplabeltext [\s!ko]  [\v!august={8\uchar{198}{212}}]
\setuplabeltext [\s!ko]  [\v!september={9\uchar{198}{212}}]
\setuplabeltext [\s!ko]  [\v!october={10\uchar{198}{212}}]
\setuplabeltext [\s!ko]  [\v!november={11\uchar{198}{212}} ]
\setuplabeltext [\s!ko]  [\v!december={12\uchar{198}{212}}]

\setuplabeltext [\s!ko]  [\v!sunday={\uchar{199}{124}\uchar{198}{148}\uchar{199}{124}}]
\setuplabeltext [\s!ko]  [\v!monday={\uchar{198}{212}\uchar{198}{148}\uchar{199}{124}}]
\setuplabeltext [\s!ko]  [\v!tuesday={\uchar{214}{84}\uchar{198}{148}\uchar{199}{124}}]
\setuplabeltext [\s!ko]  [\v!wednesday={\uchar{194}{24}\uchar{198}{148}\uchar{199}{124}}]
\setuplabeltext [\s!ko]  [\v!thursday={\uchar{186}{169}\uchar{198}{148}\uchar{199}{124}}]
\setuplabeltext [\s!ko]  [\v!friday={\uchar{174}{8}\uchar{198}{148}\uchar{199}{124}}]
\setuplabeltext [\s!ko]  [\v!saturday={\uchar{209}{160}\uchar{198}{148}\uchar{199}{124}}]

\expandafter\ifx\csname luatexversion\endcsname\relax % if not luatex
    \stoplanguagespecifics
\fi

\setupsection [\s!section-1] [\c!headconversion=\s!korean]
\setupsection [\s!section-2] [\c!headconversion=\s!korean]
\setupsection [\s!section-3] [\c!headconversion=\s!korean]

\setupsection [\s!section-2] [\v!appendix\c!conversion=]

\setuphead [\v!chapter]    [\c!distance=1.25em]
\setuphead [\v!section]    [\c!distance=1.25em]
\setuphead [\v!subsection] [\c!distance=1.00em]

\setuplist [\v!chapter] [\c!headlabel=\v!yes,\c!headconversion=\v!yes,\c!width=5em]
\setuplist [\v!section] [\c!headlabel=\v!yes,\c!headconversion=\v!yes,\c!width=5em]

\setupmarking [\v!chapter\v!number] [\c!headlabel=\v!yes,\c!headconversion=\v!yes]
\setupmarking [\v!section\v!number] [\c!headlabel=\v!yes,\c!headconversion=\v!yes]

\setuplabeltext [ko]   [\v!subsection={\symbol[S]\kern.25em}]
\setuplabeltext [ko]   [\v!subsubsection={\symbol[S]\kern.25em}]
\setuplabeltext [ko]   [\v!subsubsubsection={\symbol[S]\kern.25em}]
\setuplabeltext [ko]   [\v!subsubsubsubsection={\symbol[S]\kern.25em}]

%C 그림 혹은 표를 참고하려면 아래에 정의된 명령을 사용하시기 바랍니다. (\infigure, \intable, \inchapter, \insection)

\definereferenceformat [intable]   [\c!label=\v!table]
\definereferenceformat [infigure]  [\c!label=\v!figure]
\definereferenceformat [inchapter] [\c!label=\v!chapter]
\definereferenceformat [insection] [\c!label=\v!section]

% important

\setuptyping[\c!tab=\v!no]


\protect \endinput
