From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/114912 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerben Wierda via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: Simple question Date: Tue, 10 May 2022 18:47:32 +0200 Message-ID: <1742629B-E99B-47EA-AFE4-B65EBAE8F744@rna.nl> References: <0ef5e6ed-ac10-9ce9-88ed-7f28c6a41a05@gmail.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\)) Content-Type: multipart/mixed; boundary="===============2427785895306569778==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31557"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gerben Wierda To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue May 10 18:48:09 2022 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1noT1t-0007v1-0o for gctc-ntg-context-518@m.gmane-mx.org; Tue, 10 May 2022 18:48:09 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9D1B6289E58; Tue, 10 May 2022 18:47:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B4HqnSgTZaYP; Tue, 10 May 2022 18:47:40 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6157A289E34; Tue, 10 May 2022 18:47:40 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E1814289E2B for ; Tue, 10 May 2022 18:47:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ztC9Dh7LuE3U for ; Tue, 10 May 2022 18:47:37 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=213.125.118.53; helo=mail.rna.nl; envelope-from=gerben.wierda@rna.nl; receiver= Original-Received: from mail.rna.nl (mail.rna.nl [213.125.118.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id F0286289E29 for ; Tue, 10 May 2022 18:47:36 +0200 (CEST) Original-Received: from smtpclient.apple (hermione.rna.nl [192.168.2.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.rna.nl (Postfix) with ESMTPSA id 77730D66AD1C for ; Tue, 10 May 2022 18:47:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rna.nl; s=dkim_rsa2048; t=1652201252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bR9SuHDCJiToRHITcIGPGZQfMye9agX0ZODSrh/sopk=; b=XP3gOfT98dJF4C0149yd9S7uPgZv8/03XhWC7OPbulE3Gwj259mCplJckgBacDxKR8ywzY gN7Hw5m/2uZaJNCt18E2T8TiUsgFYh09/foJsuh8CCHIB1nWoM50YH/xJEv4usPQI9swoS iGJ3psCNMSnvgiqzxGvJqmpn+7J7sQn4+bLvzGqmrOOaNXanMJqCe6e15+naXVoG/6QP0i 9Dq8Y7EalC1r/e8AfIxxtIpc2hQZNO8694hMlDFrshP9/AXlnXFTdVCHJ1q2509SVr68t+ vqH4RfxgaZTST0b554aZCP1FwqWTqD+CR3/VxMGs2LLbtOk8jLIRCzUcKX78wA== In-Reply-To: <0ef5e6ed-ac10-9ce9-88ed-7f28c6a41a05@gmail.com> X-Mailer: Apple Mail (2.3693.60.0.1.1) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:114912 Archived-At: --===============2427785895306569778== Content-Type: multipart/alternative; boundary="Apple-Mail=_725CE531-4353-4139-8041-527C934FC755" --Apple-Mail=_725CE531-4353-4139-8041-527C934FC755 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 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=3Dfr mode=3Dsimple file.tex the result is in file-simple-fr.pdf and with=20 context language=3Dru mode=3Dnone file.tex (or no mode given) the result is file-ru.pdf G > On 10 May 2022, at 17:21, Wolfgang Schuster = wrote: >=20 > Gerben Wierda via ntg-context schrieb am 10.05.2022 um 00:15: >> What is the easiest way to have a =E2=80=98database=E2=80=99 of = translations for strings and maybe links? >>=20 >> I now have 4 languages and 2 versions so 8 documents, but I=E2=80=99d = 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.=20 >>=20 >> Something I can call like this >>=20 >> \translatephrase[English phrase][nl] >> = \translatelocation[../LMTX-Output/without-ids/en/file.pdf][nl][simple] >>=20 >> and where I can maintain all the translations a bit like this: >>=20 >> \translationentry[English phrase]{ >> \definetranslatephrase[nl]Nederlandse frase] >> \definetranslatephrase[fr][Phrase fran=C3=A7ais] >> } >> } >>=20 >> = \translatelocation[../LMTX-Output/without-ids/en/file.pdf][simple][nl][../= LMTX-Output/without-ids/nl/file-simple.pdf]] >> = \translatelocation[../LMTX-Output/without-ids/en/file.pdf][none][nl][../LM= TX-Output/without-ids/nl/file.pdf]] >>=20 >>=20 >> Where the \translatelocation command can be used inside an = \externalfigure command and \translatephrase can be used as as text. >>=20 >> In the end I=E2=80=99d like to compile with=20 >>=20 >> context language=3Dfr mode=3Dsimple mainfile.tex >>=20 >> Doable? >=20 > To set language dependent texts you can use the labeltext mechanism = which is used by ConTeXt to change the captions for floats etc. >=20 > Besides the default \labeltext and \setuplabeltext commands you can = create your own instance of the mechanism for your texts. >=20 > %%%% begin example > \definelabelclass [gerben] >=20 > \setupgerbentext [en] [phrase=3DEnglish phrase] > \setupgerbentext [nl] [phrase=3DNederlandse frase] > \setupgerbentext [fr] [phrase=3DPhrase fran=C3=A7ais] >=20 > %\mainlanguage[nl] > %\mainlanguage[fr] >=20 > \starttext > \gerbentext{phrase} > \stoptext > %%%% end example >=20 > 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. >=20 > %%%% begin example > \setupexternalfigures [location=3D{local,global,default}] >=20 > \useexternalfigure [simple] [cow.pdf] > %\useexternalfigure [simple] [hacker.png] >=20 > \starttext > \externalfigure[simple] > \stoptext > %%%% end example >=20 > Wolfgang --Apple-Mail=_725CE531-4353-4139-8041-527C934FC755 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 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=3Dfr mode=3Dsimple file.tex

the result is = in

= file-simple-fr.pdf

and with 

= context language=3Dru mode=3Dnone file.tex (or no mode given)

the result is

file-ru.pdf

G

On 10 May 2022, at 17:21, Wolfgang Schuster = <wolfgang.schuster.lists@gmail.com> wrote:

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

I now have 4 = languages and 2 versions so 8 documents, but I=E2=80=99d 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]
\translatelocation[../LMTX-Output/without-ids/en/file.pdf][nl][= simple]

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

\translationentry[English = phrase]{
= \definetranslatephrase[nl]Nederlandse frase]
= \definetranslatephrase[fr][Phrase fran=C3=A7ais]
= }
}

\translatelocation[../LMTX-Output/without-ids/en/file.pdf][simp= le][nl][../LMTX-Output/without-ids/nl/file-simple.pdf]]
\translatelocation[../LMTX-Output/without-ids/en/file.pdf][none= ][nl][../LMTX-Output/without-ids/nl/file.pdf]]


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

In the = end I=E2=80=99d like to compile with 

context language=3Dfr mode=3Dsimple = mainfile.tex

Doable?

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=3DEnglish phrase]
\setupgerbentext [nl] = [phrase=3DNederlandse frase]
\setupgerbentext [fr] [phrase=3DPhrase fran=C3=A7ais]
%\mainlanguage[nl]
%\mainlanguage[fr]

\starttext
\gerbentext{phrase}
\stoptext
%%%% 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=3D{local,global,default}]

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

\starttext
\externalfigure[simple]
\stoptext
%%%% end example

Wolfgang

= --Apple-Mail=_725CE531-4353-4139-8041-527C934FC755-- --===============2427785895306569778== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============2427785895306569778==--