ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Chinese setuplabeltext
@ 2012-10-29 19:20 John Devereux
  2012-10-29 19:30 ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: John Devereux @ 2012-10-29 19:20 UTC (permalink / raw)
  To: ntg-context

Hi,

There do not seem to be translations for the labels for Chinese, is that
correct? Is "zh" the correct language code?

\setuplabeltext[zh][figure=CHINESE_HERE ]
\mainlanguage[zh]
\language[zh]
\starttext
\labeltext{figure}
\stoptext

This just displays the English word "Figure".

context --version

mtx-context     | ConTeXt Process Management 0.60
mtx-context     |
mtx-context     | main context file: /opt/context/tex/texmf-context/tex/context/base/context.mkiv
mtx-context     | current version: 2012.09.16 23:18


Thanks,

John

-- 

John Devereux
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Chinese setuplabeltext
  2012-10-29 19:20 Chinese setuplabeltext John Devereux
@ 2012-10-29 19:30 ` Wolfgang Schuster
  2012-10-30  9:12   ` Chinese footnotes too wide John Devereux
  2012-10-30 11:21   ` Chinese setuplabeltext Sietse Brouwer
  0 siblings, 2 replies; 9+ messages in thread
From: Wolfgang Schuster @ 2012-10-29 19:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 29.10.2012 um 20:20 schrieb John Devereux <john@devereux.me.uk>:

> Hi,
> 
> There do not seem to be translations for the labels for Chinese, is that
> correct? Is "zh" the correct language code?

No, you need “cn” for chinese.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Chinese footnotes too wide
  2012-10-29 19:30 ` Wolfgang Schuster
@ 2012-10-30  9:12   ` John Devereux
  2012-10-30 11:54     ` Wolfgang Schuster
  2012-10-30 11:21   ` Chinese setuplabeltext Sietse Brouwer
  1 sibling, 1 reply; 9+ messages in thread
From: John Devereux @ 2012-10-30  9:12 UTC (permalink / raw)
  To: ntg-context

Wolfgang Schuster <wolfgang.schuster@gmail.com> writes:

> Am 29.10.2012 um 20:20 schrieb John Devereux <john@devereux.me.uk>:
>
>> Hi,
>> 
>> There do not seem to be translations for the labels for Chinese, is that
>> correct? Is "zh" the correct language code?
>
> No, you need “cn” for chinese.

Oh yes that works a lot better! :) 

Thanks Wolfgang.

Another issue I have is footnotes. Chinese footnotes extend past the
right hand edge of the page.

\usemodule[simplefonts]
\setmainfont[Microsoft YaHei]
\mainlanguage[cn]
\language[cn]

\starttext

Hello, World \footnote{话说林黛玉正自悲泣,忽听院门响处,只见宝钗出来了,宝玉袭人一群人送了
出来。待要上去问着宝玉,又恐当着众人问羞了宝玉不便,因而闪过一旁,让宝钗
去了,宝玉等进去关了门,方转过来,犹望着门洒了几点泪。自觉无味,方转身回
来,无精打彩的卸了残妆。}

Hello, World \footnote{There were a king with a large jaw and a queen
  with a plain face, on the throne of England; there were a king with
  a large jaw and a queen with a fair face, on the throne of
  France. In both countries it was clearer than crystal to the lords
  of the State preserves of loaves and fishes, that things in general
  were settled for ever.}

\stoptext

mtx-context     | current version: 2012.09.16 23:18

-- 

John Devereux
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Chinese setuplabeltext
  2012-10-29 19:30 ` Wolfgang Schuster
  2012-10-30  9:12   ` Chinese footnotes too wide John Devereux
@ 2012-10-30 11:21   ` Sietse Brouwer
  2012-10-30 17:25     ` Hans Hagen
  1 sibling, 1 reply; 9+ messages in thread
From: Sietse Brouwer @ 2012-10-30 11:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

John Devereux wrote:
>> There do not seem to be translations for the labels for Chinese, is that
>> correct? Is "zh" the correct language code?

Wolfgang Schuster wrote:
> No, you need “cn” for chinese.

Might it be advisable to add 'zh' as a synonym? Technically, 'cn'
means the country China, and 'zh' means the Chinese language. (Country
code vs. language code.) Thankfully 'cn' is not in use as a language
code, so retaining it won't cause any collisions.

--Sietse
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Chinese footnotes too wide
  2012-10-30  9:12   ` Chinese footnotes too wide John Devereux
@ 2012-10-30 11:54     ` Wolfgang Schuster
  2012-10-30 12:25       ` John Devereux
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2012-10-30 11:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 30.10.2012 um 10:12 schrieb John Devereux <john@devereux.me.uk>:

> Wolfgang Schuster <wolfgang.schuster@gmail.com> writes:
> 
>> Am 29.10.2012 um 20:20 schrieb John Devereux <john@devereux.me.uk>:
>> 
>>> Hi,
>>> 
>>> There do not seem to be translations for the labels for Chinese, is that
>>> correct? Is "zh" the correct language code?
>> 
>> No, you need “cn” for chinese.
> 
> Oh yes that works a lot better! :) 
> 
> Thanks Wolfgang.
> 
> Another issue I have is footnotes. Chinese footnotes extend past the
> right hand edge of the page.

By default context breaks lines only at spaces or between word which are in the hyphenations
patterns but none of this applies for chinese, to enable line breaks you have to add
\setscript[hanzi] to your document. With this commands context checks the input for chinese
and breaks lines at valid points.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Chinese footnotes too wide
  2012-10-30 11:54     ` Wolfgang Schuster
@ 2012-10-30 12:25       ` John Devereux
  2012-10-30 12:41         ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: John Devereux @ 2012-10-30 12:25 UTC (permalink / raw)
  To: ntg-context

Wolfgang Schuster <wolfgang.schuster@gmail.com> writes:

> Am 30.10.2012 um 10:12 schrieb John Devereux <john@devereux.me.uk>:
>
>> Wolfgang Schuster <wolfgang.schuster@gmail.com> writes:
>> 
>>> Am 29.10.2012 um 20:20 schrieb John Devereux <john@devereux.me.uk>:
>>> 
>>>> Hi,
>>>> 
>>>> There do not seem to be translations for the labels for Chinese, is that
>>>> correct? Is "zh" the correct language code?
>>> 
>>> No, you need “cn” for chinese.
>> 
>> Oh yes that works a lot better! :) 
>> 
>> Thanks Wolfgang.
>> 
>> Another issue I have is footnotes. Chinese footnotes extend past the
>> right hand edge of the page.
>
> By default context breaks lines only at spaces or between word which are in the hyphenations
> patterns but none of this applies for chinese, to enable line breaks you have to add
> \setscript[hanzi] to your document. With this commands context checks the input for chinese
> and breaks lines at valid points.

Hi Wolfgang,

I did actually try this too but the problem remains in the footnotes (it
fixes it for text in the main body). See:

\usemodule[simplefonts]
\setmainfont[Microsoft YaHei]
\mainlanguage[cn]
\language[cn]
\setscript[hanzi]
\setupfootnotes[split=tolerant]

\starttext

话说林黛玉正自悲泣,忽听院门响处,只见宝钗出来了,宝玉袭人一群人送了出
来。待要上去问着宝玉,又恐当着众人问羞了宝玉不便,因而闪过一旁,让宝钗
去了,宝玉等进去关了门,方转过来,犹望着门洒了几点泪。自觉无味,方转身
回来,无精打彩的卸了残妆。\footnote{话说林黛玉正自悲泣,忽听院门响
  处,只见宝钗出来了,宝玉袭人一群人送了出来。待要上去问着宝玉,又恐当
  着众人问羞了宝玉不便,因而闪过一旁,让宝钗去了,宝玉等进去关了门,方
  转过来,犹望着门洒了几点泪。自觉无味,方转身回来,无精打彩的卸了残妆。}

\blank

There were a king with a large jaw and a queen with a plain face, on
the throne of England; there were a king with a large jaw and a queen
with a fair face, on the throne of France. In both countries it was
clearer than crystal to the lords of the State preserves of loaves and
fishes, that things in general were settled for ever. \footnote{There
  were a king with a large jaw and a queen with a plain face, on the
  throne of England; there were a king with a large jaw and a queen
  with a fair face, on the throne of France. In both countries it was
  clearer than crystal to the lords of the State preserves of loaves
  and fishes, that things in general were settled for ever.}

\stoptext


-- 

John Devereux
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Chinese footnotes too wide
  2012-10-30 12:25       ` John Devereux
@ 2012-10-30 12:41         ` Wolfgang Schuster
  2012-10-30 13:14           ` John Devereux
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2012-10-30 12:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 30.10.2012 um 13:25 schrieb John Devereux <john@devereux.me.uk>:

> Wolfgang Schuster <wolfgang.schuster@gmail.com> writes:
> 
>> Am 30.10.2012 um 10:12 schrieb John Devereux <john@devereux.me.uk>:
>> 
>>> Wolfgang Schuster <wolfgang.schuster@gmail.com> writes:
>>> 
>>>> Am 29.10.2012 um 20:20 schrieb John Devereux <john@devereux.me.uk>:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> There do not seem to be translations for the labels for Chinese, is that
>>>>> correct? Is "zh" the correct language code?
>>>> 
>>>> No, you need “cn” for chinese.
>>> 
>>> Oh yes that works a lot better! :) 
>>> 
>>> Thanks Wolfgang.
>>> 
>>> Another issue I have is footnotes. Chinese footnotes extend past the
>>> right hand edge of the page.
>> 
>> By default context breaks lines only at spaces or between word which are in the hyphenations
>> patterns but none of this applies for chinese, to enable line breaks you have to add
>> \setscript[hanzi] to your document. With this commands context checks the input for chinese
>> and breaks lines at valid points.
> 
> Hi Wolfgang,
> 
> I did actually try this too but the problem remains in the footnotes (it
> fixes it for text in the main body). See:
> 
> \usemodule[simplefonts]
> \setmainfont[Microsoft YaHei]
> \mainlanguage[cn]
> \language[cn]
> \setscript[hanzi]
> \setupfootnotes[split=tolerant]


Add this the following code to your document, context resets a few settings for footnotes to prevent
unwanted side effects from a few commands and I guess this disables also the chinese line break mechanism.

\startsetups footnote:hanzi
  \setscript[hanzi]
\stopsetups

\setupnote[footnote][setups={footnote:hanzi}]

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Chinese footnotes too wide
  2012-10-30 12:41         ` Wolfgang Schuster
@ 2012-10-30 13:14           ` John Devereux
  0 siblings, 0 replies; 9+ messages in thread
From: John Devereux @ 2012-10-30 13:14 UTC (permalink / raw)
  To: ntg-context

Wolfgang Schuster <wolfgang.schuster@gmail.com> writes:

> Am 30.10.2012 um 13:25 schrieb John Devereux <john@devereux.me.uk>:
>
>> Wolfgang Schuster <wolfgang.schuster@gmail.com> writes:
>> 
>>> Am 30.10.2012 um 10:12 schrieb John Devereux <john@devereux.me.uk>:
>>> 
>>>> Wolfgang Schuster <wolfgang.schuster@gmail.com> writes:
>>>> 
>>>>> Am 29.10.2012 um 20:20 schrieb John Devereux <john@devereux.me.uk>:
>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> There do not seem to be translations for the labels for Chinese, is that
>>>>>> correct? Is "zh" the correct language code?
>>>>> 
>>>>> No, you need “cn” for chinese.
>>>> 
>>>> Oh yes that works a lot better! :) 
>>>> 
>>>> Thanks Wolfgang.
>>>> 
>>>> Another issue I have is footnotes. Chinese footnotes extend past the
>>>> right hand edge of the page.
>>> 
>>> By default context breaks lines only at spaces or between word which are in the hyphenations
>>> patterns but none of this applies for chinese, to enable line breaks you have to add
>>> \setscript[hanzi] to your document. With this commands context checks the input for chinese
>>> and breaks lines at valid points.
>> 
>> Hi Wolfgang,
>> 
>> I did actually try this too but the problem remains in the footnotes (it
>> fixes it for text in the main body). See:
>> 
>> \usemodule[simplefonts]
>> \setmainfont[Microsoft YaHei]
>> \mainlanguage[cn]
>> \language[cn]
>> \setscript[hanzi]
>> \setupfootnotes[split=tolerant]
>
>
> Add this the following code to your document, context resets a few settings for footnotes to prevent
> unwanted side effects from a few commands and I guess this disables also the chinese line break mechanism.
>
> \startsetups footnote:hanzi
>   \setscript[hanzi]
> \stopsetups
>
> \setupnote[footnote][setups={footnote:hanzi}]
>
> Wolfgang

Beautiful, that did it, thank you very much.

-- 

John Devereux
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Chinese setuplabeltext
  2012-10-30 11:21   ` Chinese setuplabeltext Sietse Brouwer
@ 2012-10-30 17:25     ` Hans Hagen
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2012-10-30 17:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 30-10-2012 12:21, Sietse Brouwer wrote:
> John Devereux wrote:
>>> There do not seem to be translations for the labels for Chinese, is that
>>> correct? Is "zh" the correct language code?
>
> Wolfgang Schuster wrote:
>> No, you need “cn” for chinese.
>
> Might it be advisable to add 'zh' as a synonym? Technically, 'cn'
> means the country China, and 'zh' means the Chinese language. (Country
> code vs. language code.) Thankfully 'cn' is not in use as a language
> code, so retaining it won't cause any collisions.

we shouldn't confuse scripts with languages

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-10-30 17:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-29 19:20 Chinese setuplabeltext John Devereux
2012-10-29 19:30 ` Wolfgang Schuster
2012-10-30  9:12   ` Chinese footnotes too wide John Devereux
2012-10-30 11:54     ` Wolfgang Schuster
2012-10-30 12:25       ` John Devereux
2012-10-30 12:41         ` Wolfgang Schuster
2012-10-30 13:14           ` John Devereux
2012-10-30 11:21   ` Chinese setuplabeltext Sietse Brouwer
2012-10-30 17:25     ` Hans Hagen

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).