ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* High-level command for translated names
@ 2017-04-30  9:38 Henri Menke
  2017-04-30  9:41 ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Henri Menke @ 2017-04-30  9:38 UTC (permalink / raw)
  To: ntg-context

Dear list,

Inspired by this question on TeX.SX https://tex.stackexchange.com/questions/367433

How can I get the translated names for chapter and section depending on the currently active language.  I know they are there in lang-txt.lua, but cannot be accessed via \labeltext.  One can access them through Lua but that doesn't seem so elegant.



\def\chaptername{%
  \ctxlua{%
    context(languages.data.labels.texts.chapter.labels["\currentlanguage"])}}

\starttext

\language[en] \chaptername

\language[de] \chaptername

\stoptext



Cheers,
Henri
___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: High-level command for translated names
  2017-04-30  9:38 High-level command for translated names Henri Menke
@ 2017-04-30  9:41 ` Wolfgang Schuster
  2017-04-30 10:03   ` Henri Menke
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2017-04-30  9:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 569 bytes --]


> Henri Menke <mailto:henrimenke@gmail.com>
> 30. April 2017 um 11:38
> Dear list,
>
> Inspired by this question on TeX.SX 
> https://tex.stackexchange.com/questions/367433
>
> How can I get the translated names for chapter and section depending 
> on the currently active language. I know they are there in 
> lang-txt.lua, but cannot be accessed via \labeltext. One can access 
> them through Lua but that doesn't seem so elegant.
The problem are the

     ["hidden"]=true,

table entries for these labels, removing them would make the labels 
accessable.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1675 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

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

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

* Re: High-level command for translated names
  2017-04-30  9:41 ` Wolfgang Schuster
@ 2017-04-30 10:03   ` Henri Menke
  2017-04-30 10:30     ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Henri Menke @ 2017-04-30 10:03 UTC (permalink / raw)
  To: ntg-context

On 04/30/2017 09:41 PM, Wolfgang Schuster wrote:
> 
>> Henri Menke <mailto:henrimenke@gmail.com>
>> 30. April 2017 um 11:38
>> Dear list,
>>
>> Inspired by this question on TeX.SX https://tex.stackexchange.com/questions/367433
>>
>> How can I get the translated names for chapter and section depending on the currently active language. I know they are there in lang-txt.lua, but cannot be accessed via \labeltext. One can access them through Lua but that doesn't seem so elegant.
> The problem are the
> 
>     ["hidden"]=true,

Perhaps Hans can remove these in beta.  I don't see a point in having these hidden.

If we are lucky it even goes in TL2017.

> 
> table entries for these labels, removing them would make the labels accessable.
> 
> 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
> ___________________________________________________________________________________
> 

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

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

* Re: High-level command for translated names
  2017-04-30 10:03   ` Henri Menke
@ 2017-04-30 10:30     ` Wolfgang Schuster
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2017-04-30 10:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2402 bytes --]


> Henri Menke <mailto:henrimenke@gmail.com>
> 30. April 2017 um 11:38
> Dear list,
>
> Inspired by this question on TeX.SX 
> https://tex.stackexchange.com/questions/367433
>
> How can I get the translated names for chapter and section depending 
> on the currently active language. I know they are there in 
> lang-txt.lua, but cannot be accessed via \labeltext. One can access 
> them through Lua but that doesn't seem so elegant.
>
>
>
> \def\chaptername{%
> \ctxlua{%
> context(languages.data.labels.texts.chapter.labels["\currentlanguage"])}}
>
> \starttext
>
> \language[en] \chaptername
>
> \language[de] \chaptername
>
> \stoptext
>
>
>
> Cheers,
> Henri
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
> Wolfgang Schuster <mailto:schuster.wolfgang@gmail.com>
> 30. April 2017 um 11:41
>
> The problem are the
>
>     ["hidden"]=true,
>
> table entries for these labels, removing them would make the labels 
> accessable.
>
> Wolfgang
> Henri Menke <mailto:henrimenke@gmail.com>
> 30. April 2017 um 12:03
> On 04/30/2017 09:41 PM, Wolfgang Schuster wrote:
>>> Henri Menke<mailto:henrimenke@gmail.com>
>>> 30. April 2017 um 11:38
>>> Dear list,
>>>
>>> Inspired by this question on TeX.SX https://tex.stackexchange.com/questions/367433
>>>
>>> How can I get the translated names for chapter and section depending on the currently active language. I know they are there in lang-txt.lua, but cannot be accessed via \labeltext. One can access them through Lua but that doesn't seem so elegant.
>> The problem are the
>>
>>      ["hidden"]=true,
>
> Perhaps Hans can remove these in beta.  I don't see a point in having these hidden.
The problem is that \chapter uses the chapter label if set (done in 
strc-def.mkiv) and enabling the hidden
labels means changing documented setups. You shouldn’t also forget that 
label output depends on
the main language (\language changes only hyphentation patterns and 
quotation marks).

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 5779 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

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

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

end of thread, other threads:[~2017-04-30 10:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-30  9:38 High-level command for translated names Henri Menke
2017-04-30  9:41 ` Wolfgang Schuster
2017-04-30 10:03   ` Henri Menke
2017-04-30 10:30     ` Wolfgang Schuster

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