[NTG-context] How to add a new unit for \unit{} command?

Wolfgang Schuster schuster.wolfgang at gmail.com
Fri Oct 18 08:39:17 CEST 2013


Am 18.10.2013 um 08:35 schrieb Romain Diss <romain.diss at yahoo.fr>:

> Le jeudi 17 octobre 2013 06:40:21 Wolfgang Schuster a écrit :
>>> \registerunit[unit][division=division]
>>> \setupunittext[division=div]
>> Context looks for language dependent value of "division"
>> and prints the value from the unittext entry, with this method you can also
>> set different texts for different languages.
> Thank you for these precisions.
> 
> Actually this feature interests me because I wondered how to translate certain
> unit labels, like for example:
> \unit{2 day} gives: "2 d" but I would like it to gives "2 j" in french.
> 
> So if I type this:
> \setupunittext[day=j]
> I get the correct translation but how can I tell Context that this is the
> translation for 'french' only?

You can use the first optional argument for the language specifier, e.g.

\setupunittext[en][day=d]
\setupunittext[fr][day=j]

Wolfgang


More information about the ntg-context mailing list