Commits

Wolfgang Schuster  committed 689f894

Provide language option

  • Participants
  • Parent commits 49c97e6

Comments (0)

Files changed (4)

File files/s-cor-00.lua

 function correspondence.place(environment,settings)
     local bodyfont         = settings.bodyfont
     local whitespace       = settings.whitespace
+    local language         = settings.language
     local backgroundcolor  = settings.backgroundcolor
     context.unprotect()
     context(toks.t_correspondence_before)
     if whitespace ~= "" then
         context.setupwhitespace{whitespace}
     end
+    -- I prefer to set this with \setup…options
+    if language ~= "" then
+        context.mainlanguage{language}
+    end
     -- colored background is behind all other layers
     if backgroundcolor ~= "" then
         context.setupbackgrounds({ v_paper },{ background = v_color, backgroundcolor = backgroundcolor })

File files/s-cor-00.mkii

 %D \module
 %D   [     file=s-cor-00,
-%D      version=2012.01.21,
+%D      version=2012.02.02,
 %D        title=\CONTEXT\ User Module,
 %D     subtitle=Correspondence,
 %D       author=Wolfgang Schuster,
    \setupfooter[\c!state=\v!stop]%
    \doifsomething{\correspondenceoptionparameter\c!bodyfont  }{\setupbodyfont  [\correspondenceoptionparameter\c!bodyfont  ]}%
    \doifsomething{\correspondenceoptionparameter\c!whitespace}{\setupwhitespace[\correspondenceoptionparameter\c!whitespace]}%
+   \doifsomething{\correspondenceoptionparameter\c!language  }{\mainlanguage   [\correspondenceoptionparameter\c!language  ]}%
    % backgroundcolor is applied to the paper background
    \doifsomething{\correspondenceoptionparameter\c!backgroundcolor}%
      {\setupbackgrounds[\v!paper][\c!background=\v!color,\c!backgroundcolor=\correspondenceoptionparameter\c!backgroundcolor]}

File files/s-cor-00.mkvi

 %D \module
 %D   [     file=s-cor-00,
-%D      version=2012.01.21,
+%D      version=2012.02.02,
 %D        title=\CONTEXT\ User Module,
 %D     subtitle=Correspondence,
 %D       author=Wolfgang Schuster,
    \ctxlua{thirddata.correspondence.place("\currentcorrespondence", {
         bodyfont        = "\correspondenceoptionparameter\c!bodyfont",
         whitespace      = "\correspondenceoptionparameter\c!whitespace",
+        language        = "\correspondenceoptionparameter\c!language",
         backgroundcolor = "\correspondenceoptionparameter\c!backgroundcolor",
     } )}%
    \endgroup}
 
 \installsimplecommandhandler \????correspondencedescription {correspondencedescription} \????correspondencedescription
 
-\let\m_correspondence_description_string\empty
 \let\m_correspondence_description_format\empty
 \let\m_correspondence_description_items \empty
 
 \unexpanded\def\correspondence_description_place_text
   {\expandcheckedcsname\????correspondencedescriptionformat\m_correspondence_description_format\v!none}
 
-\setvalue{\????correspondencedescriptionformat\v!list}%
+\setvalue{\????correspondencedescriptionformat\v!list}% todo: use a simplified version of the itemize code
   {\def\correspondence_description_format_item#text{\startitem#text\stopitem}%
    \dontleavehmode\vtop\bgroup
      \leftskip\zeropoint % prevent additional offset when “location=left” is used

File files/test-4.tex

    enclosure={list:A,B,C},
    postscript=Postscript]
 
-%\setupletterdescription
-%  [enclosure]
-%  [location=top,
-%   leftmargin=1em,
-%   symbol=star]
+\setupletterdescription
+  [enclosure]
+  [location=top,
+   leftmargin=1em,
+   symbol=star]
 
 \startletter
   [opening={Dear Mr Wilson,},