diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/lang-ini.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/lang-ini.mkiv | 54 |
1 files changed, 17 insertions, 37 deletions
diff --git a/Master/texmf-dist/tex/context/base/lang-ini.mkiv b/Master/texmf-dist/tex/context/base/lang-ini.mkiv index f88281a609f..45bb71b85d9 100644 --- a/Master/texmf-dist/tex/context/base/lang-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/lang-ini.mkiv @@ -73,7 +73,7 @@ \let\currentlanguage \empty \let\currentmainlanguage\empty -\def\setupcurrentlanguage[#1]{\setcurrentlanguage\currentmainlanguage{#1}} +\unexpanded\def\setupcurrentlanguage[#1]{\setcurrentlanguage\currentmainlanguage{#1}} \def\setcurrentlanguage#1#2% sets modes: **id (currentmain) *id (current) {\edef\xaskedlanguage{#1}% otherwise clash with \askedlanguage @@ -199,7 +199,7 @@ %D %D Beware, this command can only be used when a language is installed. -\unprotected \def\setuplanguage +\unexpanded\def\setuplanguage {\dodoubleempty\dosetuplanguage} \def\dosetuplanguage[#1][#2]% handy patch for testing @@ -241,8 +241,8 @@ \setuplanguage [\s!default] [\c!compoundhyphen=\compoundhyphen, - \c!leftcompoundhyphen=\compoundhyphen, - \c!rightcompoundhyphen=] + \c!rightcompoundhyphen=\compoundhyphen, + \c!leftcompoundhyphen=] %D The values \type {leftsentence} and \type %D {rightsentence} can be (and are) used to implement @@ -303,7 +303,7 @@ \def\dosetnormallanguage#1#2% current default {\edef\askedlanguagepatterns{\specificlanguageparameter{#1}\s!patterns}% - \normallanguage=\ctxlua{tex.sprint(languages.enable({"\askedlanguagepatterns","#1","\askedlanguagepatterns","#2"}))}% + \normallanguage=\ctxlua{tex.sprint(languages.enable({"\askedlanguagepatterns","#1","#2"}))}% \ifproductionrun \setxvalue{\??la\??la#1#2}{\number\normallanguage}% \fi} @@ -317,11 +317,13 @@ \newtoks \everylanguage -\def\sethyphenationvariables - {\lefthyphenmin 0\languageparameter\s!lefthyphenmin \relax - \righthyphenmin0\languageparameter\s!righthyphenmin\relax - \lefthyphenmin \numexpr\lefthyphenmin +\hyphenminoffset\relax - \righthyphenmin\numexpr\righthyphenmin+\hyphenminoffset\relax} +\def\sethyphenationvariables % as we can have cloning we need to set it each time, unless we move all to lua + {\ctxlua{languages.setup(tex.language, { + lefthyphen = "\languageparameter\c!lefthyphen", + righthyphen = "\languageparameter\c!righthyphen", + } )}% + \lefthyphenmin \numexpr0\languageparameter\s!lefthyphenmin +\hyphenminoffset\relax + \righthyphenmin\numexpr0\languageparameter\s!righthyphenmin+\hyphenminoffset\relax} \def\docomplexlanguage% assumes that \currentlanguage is set {\edef\currentdefaultlanguage{\defaultlanguage\currentlanguage}% @@ -332,6 +334,11 @@ % will be definable and move to core-spa ! \doifelse{\languageparameter\c!spacing}\v!broad\nonfrenchspacing\frenchspacing} +% \mainlanguage[nl] \setuplanguage[nl][lefthyphen=,righthyphen=?] +% +% \dorecurse{100}{dit is toch wel een heel\normalhyphendiscretionary lang\normalhyphendiscretionary woord \recurselevel\ } +% \dorecurse{100}{dit is toch wel een heellangwoord \recurselevel\ } + % The following may be a solution for the fact that one cannot % change catcodes of characters like : and ; inside an environment. @@ -546,33 +553,6 @@ \let\preloadallpatterns\relax % just for old times sake \let\preloadlanguages \relax % just for old times sake -%D This might bexcome a seperate file: - -% mkiv only -- todo: internationalize command names - -% \loadspellchecklist[en][words-en.txt] -% \loadspellchecklist[us][words-en.txt] -% \loadspellchecklist[nl][words-nl.txt] -% \setupspellchecking[state=start] - -\def\loadspellchecklist - {\dodoubleempty\doloadspellchecklist} - -\def\doloadspellchecklist[#1][#2]% - {\ctxlua{languages.words.load("#1","#2")}} - -\def\setupspellchecking - {\dosingleargument\dosetupspellchecking} - -\def\setupspellchecking[#1]% todo colors - {\getparameters[\??wl][#1]% - \doifelse\@@wlstate\v!start - {\ctxlua{languages.words.enable=true }} - {\ctxlua{languages.words.enable=false}}} - -\setupspellchecking - [\c!state=\v!stop] - \uchyph=1 \exhyphenchar=45 % to permit breaking at explicit hyphens |