ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jeong Dalyoung <haksan@me.com>
To: ntg-context@ntg.nl
Subject: Re: checking mainlanguage setup
Date: Wed, 01 Jun 2011 16:45:37 +0900	[thread overview]
Message-ID: <03D02E6E-2F85-442E-ABE8-FB63D8BC1614@me.com> (raw)
In-Reply-To: <mailman.1275.1306911210.4231.ntg-context@ntg.nl>

Dear Aditya,


> 
> context([[\def\noexpand\Lang{...}]])

not working
> 
> or
> 
> context([[\def\string\Lang{...}]])

working

> 
> I don't understand why
> 
> context([[\def\\Lang{...}]])
working, too


You are right. [[\def\\Lang{English}]] method works.

I summerize it as a test file. The first 5 methods are working well, but the last one using \noexpand cause the error.

Thank you.

Best regards,

Dalyoung

\mainlanguage[en]
\starttext
\startitemize[n]
\head Using \type{context.setvalue("Lang","English")}

\startluacode
if languages.current() == "en" then
  context.setvalue("Lang","English")
else
  context.setvalue("Lang","Not English")
end
\stopluacode
Current language: \Lang

\head Using \type{context("\\def\\Lang{English}")}

\startluacode
if languages.current() == "en" then
  context("\\def\\Lang{English}")
else
  context("\\def\\Lang{Not English}")
end
\stopluacode
Current language: \Lang

\head Using \type{context([[\def\string\Lang{English}]])}

\startluacode
if languages.current() == "en" then
  context([[\def\string\Lang{English}]])
else
  context([[\def\string\Lang{Not English}]])
end
\stopluacode
Current language: \Lang

\head Using \type{context([[\def\\Lang{English}]])}

\startluacode
if languages.current() == "en" then
  context([[\def\\Lang{English}]])
else
  context([[\def\\Lang{Not English}]])
end
\stopluacode
Current language: \Lang

\head Using \type{\doifelse\currentmainlanguage{en}...}

\doifelse\currentmainlanguage{en}
 {\def\Lang{English}}{\def\Lang{Not English}}
 Current language: \Lang

\head Using \type{context([[\def\noexpand\Lang{English}]])}

%\startluacode
% if languages.current() == "en" then
% context([[\def\noexpand\Lang{English}]])
% else
% context([[\def\noexpand\Lang{Not English}]])
% end
%\stopluacode
%Current language: \Lang
\stopitemize
\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


       reply	other threads:[~2011-06-01  7:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1275.1306911210.4231.ntg-context@ntg.nl>
2011-06-01  7:45 ` Jeong Dalyoung [this message]
2011-06-01 12:54   ` Wolfgang Schuster
     [not found] <mailman.1266.1306859874.4231.ntg-context@ntg.nl>
2011-06-01  1:16 ` Jeong Dalyoung
2011-06-01  1:32   ` Aditya Mahajan
     [not found] <mailman.1.1306836001.18520.ntg-context@ntg.nl>
2011-05-31 10:45 ` Jeong Dalyoung
2011-05-31 14:33   ` Procházka Lukáš Ing. - Pontex s. r. o.
2011-06-01  8:14     ` Hans Hagen
2011-06-01  8:22       ` Hans Hagen
     [not found] <mailman.1.1306576802.24208.ntg-context@ntg.nl>
2011-05-28 12:26 ` Jeong Dalyoung
2011-05-28 13:45   ` Hans Hagen
2011-05-31  6:48   ` Procházka Lukáš Ing. - Pontex s. r. o.
     [not found] <mailman.1220.1306501767.4231.ntg-context@ntg.nl>
2011-05-28  2:41 ` Jeong Dalyoung
2011-05-28  3:04   ` Aditya Mahajan
2011-05-27  9:49 Jeong Dalyoung
2011-05-27 10:11 ` Pontus Lurcock
2011-05-27 10:22 ` Marco
2011-05-27 10:41 ` Peter Münster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03D02E6E-2F85-442E-ABE8-FB63D8BC1614@me.com \
    --to=haksan@me.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).