%D \module
%D   [       file=lang-chi,
%D        version=2002.06.25, % 1998.10.10,
%D          title=\CONTEXT\ Language Macros,
%D       subtitle=Chinese,
%D         author={Hans Hagen \& Wang Lei},
%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=\koencoding\koleftsentence,
   \c!rightsentence=\koencoding\korightsentence,
   \c!leftsubsentence=\koencoding\koleftsubsentence,
   \c!rightsubsentence=\koencoding\korightsubsentence,
   \c!leftquote=\koencoding\koupperleftsinglequote,
   \c!rightquote=\koencoding\koupperrightsinglequote,
   \c!leftquotation=\koencoding\koupperleftdoublequote,
   \c!rightquotation=\koencoding\koupperrightdoublequote,
   \c!date={\v!year,\koyear,\ ,\v!month,\komonth,\ ,\v!day,\koday},
   \c!state=\v!stop]


\setupheadtext [\s!ko]       [\v!content={\koencoding\koencodedcontents}]
\setupheadtext [\s!ko]        [\v!tables={\koencoding\koencodedtables}]
\setupheadtext [\s!ko]       [\v!figures={\koencoding\koencodedfigures}]
\setupheadtext [\s!ko]      [\v!graphics={\koencoding\koencodedgraphics}]% RG & XJF
\setupheadtext [\s!ko]    [\v!intermezzi={\koencoding\koencodedintermezzo}]% RG & XJF
\setupheadtext [\s!ko]         [\v!index={\koencoding\koencodedindex}]
\setupheadtext [\s!ko] [\v!abbreviations={\koencoding\koencodedabbreviations}]
\setupheadtext [\s!ko]         [\v!logos={\koencoding\koencodedlogos}]
\setupheadtext [\s!ko]         [\v!units={\koencoding\koencodedunits}]

\setuplabeltext [\s!ko]        [\v!table={\koencoding\koencodedtable}]
\setuplabeltext [\s!ko]       [\v!figure={\koencoding\koencodedfigure}]
\setuplabeltext [\s!ko]   [\v!intermezzo={\koencoding\koencodedintermezzo}]% RG & XJF
\setuplabeltext [\s!ko]      [\v!graphic={\koencoding\koencodedillustration}]% RG & XJF
\setuplabeltext [\s!ko]     [\v!appendix={\koencoding\koencodedappendix}]% RG
\setuplabeltext [\s!ko]         [\v!part={\koencoding\koencodedintro,\koencoding\koencodedpart}]
\setuplabeltext [\s!ko]      [\v!chapter={\koencoding\koencodedintro,\koencoding\koencodedchapter}]
\setuplabeltext [\s!ko]      [\v!section={\koencoding\koencodedintro,\koencoding\koencodedsection}]
\setuplabeltext [\s!ko]         [\v!line={\koencoding\koencodedline}]% RG & XJF
\setuplabeltext [\s!ko]        [\v!lines={\koencoding\koencodedline}]% RG & XJF

\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.

\startlanguagespecifics[\s!ko]

\setuplabeltext [\s!ko]   [\v!january=\koencoding\koencodedjanuary]
\setuplabeltext [\s!ko]  [\v!february=\koencoding\koencodedfebrary]
\setuplabeltext [\s!ko]     [\v!march=\koencoding\koencodedmarch]
\setuplabeltext [\s!ko]     [\v!april=\koencoding\koencodedapril]
\setuplabeltext [\s!ko]       [\v!may=\koencoding\koencodedmay]
\setuplabeltext [\s!ko]      [\v!june=\koencoding\koencodedjune]
\setuplabeltext [\s!ko]      [\v!july=\koencoding\koencodedjuly]
\setuplabeltext [\s!ko]    [\v!august=\koencoding\koencodedaugust]
\setuplabeltext [\s!ko] [\v!september=\koencoding\koencodedseptember]
\setuplabeltext [\s!ko]   [\v!october=\koencoding\koencodedoctober]
\setuplabeltext [\s!ko]  [\v!november=\koencoding\koencodednovember]
\setuplabeltext [\s!ko]  [\v!december=\koencoding\koencodeddecember]
\setuplabeltext [\s!ko]    [\v!sunday=\koencoding\koencodedsunday]
\setuplabeltext [\s!ko]    [\v!monday=\koencoding\koencodedmonday]
\setuplabeltext [\s!ko]   [\v!tuesday=\koencoding\koencodedtuesday]
\setuplabeltext [\s!ko] [\v!wednesday=\koencoding\koencodedwednesday]
\setuplabeltext [\s!ko]  [\v!thursday=\koencoding\koencodedthursday]
\setuplabeltext [\s!ko]    [\v!friday=\koencoding\koencodedfriday]
\setuplabeltext [\s!ko]  [\v!saturday=\koencoding\koencodedsaturday]

\stoplanguagespecifics

%D One can specify a split labeltext, as demonstrated in
%D the definition of the \type {part} label. Unfortunately
%D the glyphs of both part depend on the encoding. Therefore,
%D we have an encoding section here.

\unexpanded\def\koencoding{\enableencoding[\koreanencoding]} % ugly and temporary

\startencoding[cjk-uni]
  \definecommand koleftsentence            {\uchar{32}{20}\uchar{32}{20}}
  \definecommand korightsentence           {\uchar{32}{20}\uchar{32}{20}}
  \definecommand koleftsubsentence         {\uchar{32}{20}\uchar{32}{20}}
  \definecommand korightsubsentence        {\uchar{32}{20}\uchar{32}{20}}
  \definecommand koupperleftsinglequote    {\uchar{32}{24}}
  \definecommand koupperrightsinglequote   {\uchar{32}{25}}
  \definecommand koupperleftdoublequote    {\uchar{32}{28}}
  \definecommand koupperrightdoublequote   {\uchar{32}{29}}
  \definecommand koupperleftsinglequote-v  {\uchar{48}{12}}
  \definecommand koupperrightsinglequote-v {\uchar{48}{13}}
  \definecommand koupperleftdoublequote-v  {\uchar{48}{14}}
  \definecommand koupperrightdoublequote-v {\uchar{48}{15}}
  \definecommand koencodedcontents         {\uchar{414}{40}\uchar{186}{64}}%
  \definecommand koencodedtables           {\uchar{136}{92}}%\uchar{104}{60}}
  \definecommand koencodedfigures          {\uchar{173}{248}\uchar{185}{188}}
  \definecommand koencodedindex            {\uchar{204}{62}\uchar{197}{68}\uchar{188}{244}\uchar{174}{48}}
  \definecommand koencodedabbreviations    {\uchar{198}{148}\uchar{197}{125}}
  \definecommand koencodedlogos            {\uchar{184}{92}\uchar{172}{224}}
  \definecommand koencodedunits            {\uchar{178}{232}\uchar{199}{4}}
  \definecommand koencodedtable            {\uchar{136}{92}}
  \definecommand koencodedfigure           {\uchar{86}{254}}
  \definecommand koencodedintro            {\uchar{180}{228}\uchar{197}{180}\uchar{172}{0}\uchar{174}{48}}
  \definecommand koencodedpart             {\uchar{189}{128}}
  \definecommand koencodedchapter          {\uchar{199}{165}}
  \definecommand koencodedsection          {\uchar{200}{8}}
  \definecommand koencodedjanuary          {\uchar{0}{49}\uchar{198}{212}}
  \definecommand koencodedfebrary          {\uchar{0}{50}\uchar{198}{212}}
  \definecommand koencodedmarch            {\uchar{0}{51}\uchar{198}{212}}
  \definecommand koencodedapril            {\uchar{0}{52}\uchar{198}{212}}
  \definecommand koencodedmay              {\uchar{0}{53}\uchar{198}{212}}
  \definecommand koencodedjune            {\uchar{0}{54}\uchar{198}{212}}
  \definecommand koencodedjuly             {\uchar{0}{55}\uchar{198}{212}}
  \definecommand koencodedaugust           {\uchar{0}{56}\uchar{198}{212}}
  \definecommand koencodedseptember        {\uchar{0}{57}\uchar{198}{212}}
  \definecommand koencodedoctober          {\uchar{0}{49}\uchar{0}{48}\uchar{198}{212}}
  \definecommand koencodednovember         {\uchar{0}{49}\uchar{0}{49}\uchar{198}{212}}
  \definecommand koencodeddecember         {\uchar{0}{49}\uchar{0}{50}\uchar{198}{212}}
  \definecommand koencodedsunday           {\uchar{199}{124}\uchar{198}{148}\uchar{199}{124}}
  \definecommand koencodedmonday           {\uchar{198}{212}\uchar{198}{148}\uchar{199}{124}}
  \definecommand koencodedtuesday          {\uchar{214}{84}\uchar{198}{148}\uchar{199}{124}}
  \definecommand koencodedwednesday        {\uchar{194}{24}\uchar{198}{148}\uchar{199}{124}}
  \definecommand koencodedthursday         {\uchar{186}{169}\uchar{198}{148}\uchar{199}{124}}
  \definecommand koencodedfriday           {\uchar{174}{8}\uchar{198}{148}\uchar{199}{124}}
  \definecommand koencodedsaturday         {\uchar{209}{160}\uchar{198}{148}\uchar{199}{124}}
  % RG & XJF
  \definecommand koencodedgraphics         {\uchar{173}{248}\uchar{185}{188}}
  \definecommand koencodedintermezzo       {\uchar{215}{52}}%}\uchar{242}{102}}
  \definecommand koencodedillustration     {\uchar{198}{8}\uchar{194}{220}}
  \definecommand koencodedappendix         {\uchar{189}{128}\uchar{184}{93}}
 \definecommand koencodedline             {\uchar{213}{137}}
  % Tobias Burnus & XJF
  \definecommand koyear                    {\uchar{177}{68}}
  \definecommand komonth                   {\uchar{198}{212}}
  \definecommand koday                     {\uchar{199}{124}}
\stopencoding


% Traditional Chinese characters (only where they differ to the
% simplified ones) for lang-chi.tex and font-chi.tex.

% \startencoding[cjk-uni]
%   \defineudigit     10000 132  44
%   \defineudigit 100000000  81   4

%   \definecommand koencodedsection          {\uchar{123}{192}}
%   \definecommand koencodedfigure           {\uchar{87}{22}}
%   \definecommand koencodedunits            {\uchar{138}{8}\uchar{145}{207}\uchar{85}{174}\uchar{79}{77}}
%   \definecommand koencodedlogos            {\uchar{95}{189}\uchar{140}{182}}
%   \definecommand koencodedabbreviations    {\uchar{126}{46}\uchar{117}{101}\uchar{138}{158}}
%   \definecommand koencodedfigures          {\uchar{87}{22}\uchar{95}{98}}
%   \definecommand koencodedcontents         {\uchar{118}{238}\uchar{147}{4}}
% \stopencoding

% \startencoding[gbk]
%   \defineudigit     10000 200 102
%   \defineudigit 100000000 131 124

%   \definecommand koencodedsection          {\uchar{185}{157}}
%   \definecommand koencodedfigure           {\uchar{136}{68}}
%   \definecommand koencodedunits            {\uchar{211}{139}\uchar{193}{191}\uchar{134}{206}\uchar{206}{187}}
%   \definecommand koencodedlogos            {\uchar{187}{213}\uchar{217}{72}
%   \definecommand koencodedabbreviations    {\uchar{191}{115}\uchar{194}{212}\uchar{213}{90}}
%   \definecommand koencodedfigures          {\uchar{136}{68}\uchar{208}{206}}
%   \definecommand koencodedcontents         {\uchar{196}{191}\uchar{228}{155}}
% \stopencoding

% \startencoding[big5]
%   \defineudigit     10000 184  85
%   \defineudigit 100000000 187 245

%   \definecommand koencodedsection          {\uchar{184}{96}}
%   \definecommand koencodedfigure           {\uchar{185}{207}}
%   \definecommand koencodedunits            {\uchar{173}{112}\uchar{182}{113}\uchar{179}{230}\uchar{166}{236}}
%   \definecommand koencodedlogos            {\uchar{192}{178}\uchar{182}{83}}
%   \definecommand koencodedabbreviations    {\uchar{193}{89}\uchar{178}{164}\uchar{187}{121}}
%   \definecommand koencodedfigures          {\uchar{185}{207}\uchar{167}{206}}
%   \definecommand koencodedcontents         {\uchar{165}{216}\uchar{191}{253}}
% \stopencoding

%\stopencoding

\protect \endinput
