checking mainlanguage setup
Dear all, Is it possible to check what is the mainlanguage set in document? Now, I use \enablemode[kr] to do something A. But, I'd like to do it automatically if possible. For example, I'd like to do the following type of setup. if mainlanguage == kr then do something A elseif mainlanguage == en then do something B else do something C endif So, if \mainlanguage[kr] is set, then do A, and etc. Thank you for reading. Best regards, Dalyoung
On Fri 27 May 2011, Jeong Dalyoung wrote:
Is it possible to check what is the mainlanguage set in document? Now, I use \enablemode[kr] to do something A. But, I'd like to do it automatically if possible.
According to http://wiki.contextgarden.net/Modes#System_modes , the mode **kr should be automatically set if kr is the main language (I haven't tried it, though). Pont
I'd like to do the following type of setup.
if mainlanguage == kr then
do something A
elseif mainlanguage == en then
do something B
else do something C
endif
\starttext \startluacode if languages.current() == "kr" then context("Something A") elseif languages.current() == "en" then context("Something B") else context("Something C") end \stopluacode \stoptext Marco
On Fri, May 27 2011, Jeong Dalyoung wrote:
Is it possible to check what is the mainlanguage set in document?
Yes. Example: %\mainlanguage[fr] %\language[fr] \starttext currentlanguage: \doifelse\currentlanguage{fr}{French}{Not French}\par currentmainlanguage: \doifelse\currentmainlanguage{fr}{French}{Not French}\par translate: \translate[fr=Français, en=French] \stoptext -- Peter
participants (4)
-
Jeong Dalyoung
-
Marco
-
pmlists@free.fr
-
Pontus Lurcock