Dear Lukas, Thank you for the explanation.
I guessed that your original
[[\\def\\lang{English}]]
No errors message, but it's not working as the way as I want. It just print "def langEnglish".
[[\def\lang{English}]]
This cause the error message and halt the compiling. Best regards, Dalyoung metapost > loading 'metafun.mp' (experimental metapost version two) ! Undefined control sequence. system > tex > error on line 84 in file test-font.tex: Undefined control sequence ... 74 75 76 \startluacode 77 if languages.current() == "kr" then 78 -- context.setvalue("lang","한글") 79 context([[\def\lang{한글}]]) 80 else 81 -- context.setvalue("lang","English") 82 context("\\def\\lang{English}") 83 end 84 >> \stopluacode 85 86 currentlanguage: \lang 87 88 \section{one.two} 89 90 \doifelse\currentmainlanguage{en}{\def\lang{English}}{\def\lang{영어가 아님}}\par 91 92 currentlanguage: \lang 93 %currentmainlanguage: 94 %\doifelse\currentmainlanguage{kr}{Korean}{Not Korean}\par \lang #1->\edef \biblanguage {#1}\ifcsname \??pb \s!language #1\endcsname \l... <argument> ...,"한글") context([[\def \lang { 한글}]]) else -- conte... \dodostartluacode ...and \directlua \zerocount {#1 }} l.84 \stopluacode ?