ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	"Jairo A. del Rio" <jairoadelrio6@gmail.com>
Subject: Re: List of language-specific hyphenation commands
Date: Sat, 23 May 2020 16:36:30 +0200	[thread overview]
Message-ID: <8313f09b-8a93-fc09-89fa-98899eba0b78@gmail.com> (raw)
In-Reply-To: <CAKyqqaY0ecKmgjhcgABaO98qAHC4HFUov0MMg0q-Wapd5aQ6Ew@mail.gmail.com>

Jairo A. del Rio schrieb am 22.05.2020 um 23:42:
> Hi everybody! I've read about some commands which allow hyphenation 
> according to an specific language in ConTeXt, e.g. \french{word} for 
> French hyphenation in a text the main language of which is Spanish, 
> English, etc. Unlike \language[code], I couldn't find any extensive list 
> of those commands, so where should I find them? Thank you in advance!

It's a switch and you have to put the left brace before the command, 
e.g. {\french ...}

There is no list but you can print the stored entries.

\starttext

\startluacode

function userdata.languagesyonym(language)
     context.doShowLanguage(language)
     for synonym, _ in next, languages.registered[language].synonyms do
         context.doShowLanguage(synonym)
     end
end

function userdata.checklanguage(language,meaning)
     if string.find(meaning,"\\lang_basics_set_current") then
         context.tex(language)
     end
end

\stopluacode

\def\doShowLanguage#1%
   {\doifnotinstring{-}{#1}
 
{\ctxlua{userdata.checklanguage("#1","\luaescapestring{\expandafter\meaning\csname#1\endcsname}")}}%
    \par}

\def\ShowLanguage#1%
   {\testpage[3]
    \blank[medium]
    \ctxlua{userdata.languagesyonym("#1")}}

\processcommacommand[\installedlanguages]\ShowLanguage

\stoptext

Wolfgang
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2020-05-23 14:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 21:42 Jairo A. del Rio
2020-05-23 14:36 ` Wolfgang Schuster [this message]

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=8313f09b-8a93-fc09-89fa-98899eba0b78@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=jairoadelrio6@gmail.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).