Don't know how if there's an automatic way, perhaps look into ctx processing 
Anyway you can use
As you have to set quite a few options on the command line (modes, language) 
you'll perhaps want to use a makefile anyway.

Von: ntg-context <> im Auftrag von Gerben Wierda via 
ntg-context <>
Gesendet: Dienstag, 10. Mai 2022 18:47:32
An: mailing list for ConTeXt users
Cc: Gerben Wierda
Betreff: Re: [NTG-context] Simple question

Thank you.

Is it possible to change the name of the resulting PDF file based on the 
language and a mode?

So that with a command

context language=fr mode=simple file.tex

the result is in


and with

context language=ru mode=none file.tex (or no mode given)

the result is



On 10 May 2022, at 17:21, Wolfgang Schuster 

Gerben Wierda via ntg-context schrieb am 10.05.2022 um 00:15:
What is the easiest way to have a ‘database’ of translations for strings and 
maybe links?

I now have 4 languages and 2 versions so 8 documents, but I’d like to have all 
translatable strings together so I can maintain these in a single file. Ideally 
I can do a file where the key of the translation is one language (say English) 
and the translations are part of that.

Something I can call like this

\translatephrase[English phrase][nl]

and where I can maintain all the translations a bit like this:

\translationentry[English phrase]{
\definetranslatephrase[nl]Nederlandse frase]
\definetranslatephrase[fr][Phrase français]


Where the \translatelocation command can be used inside an \externalfigure 
command and \translatephrase can be used as as text.

In the end I’d like to compile with

context language=fr mode=simple mainfile.tex


To set language dependent texts you can use the labeltext mechanism which is 
used by ConTeXt to change the captions for floats etc.

Besides the default \labeltext and \setuplabeltext commands you can create your 
own instance of the mechanism for your texts.

%%%% begin example
\definelabelclass [gerben]

\setupgerbentext [en] [phrase=English phrase]
\setupgerbentext [nl] [phrase=Nederlandse frase]
\setupgerbentext [fr] [phrase=Phrase français]


%%%% end example

To change images you use multiple sub folders where each folder has images 
which the same name. In ConTeXt you can use a mode to choose which directory is 
used to load the image. Another method is to map the file names of the images 
to symbolic names and use only the symbolic names in your document.

%%%% begin example
\setupexternalfigures [location={local,global,default}]

\useexternalfigure [simple] [cow.pdf]
%\useexternalfigure [simple] [hacker.png]

%%%% end example


If your question is of interest to others as well, please add an entry to the 

maillist : /
webpage  : /
archive  :
wiki     :

Reply via email to