From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aHdLNAEKkWDbfAAAgWs5BA (envelope-from ) for ; Tue, 04 May 2021 10:46:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id gFr/LwEKkWBpSwAA1q6Kng (envelope-from ) for ; Tue, 04 May 2021 08:46:57 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D779BDB38 for ; Tue, 4 May 2021 10:46:55 +0200 (CEST) Received: from localhost ([::1]:60926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldqha-0006jw-R0 for larch@yhetil.org; Tue, 04 May 2021 04:46:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqfi-0006ho-N1 for emacs-orgmode@gnu.org; Tue, 04 May 2021 04:44:50 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:40607) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqfg-0000I7-3R for emacs-orgmode@gnu.org; Tue, 04 May 2021 04:44:50 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5A5AB5C0164 for ; Tue, 4 May 2021 04:44:46 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 04 May 2021 04:44:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aleks.bg; h= references:from:to:subject:in-reply-to:date:message-id :mime-version:content-type:content-transfer-encoding; s=fm2; bh= SaEM5SYhicSKWXruaG4EIlyGW6qwkjPvVNGbidiru0s=; b=YeGd4n0aQLQHISyB p33l5S4SY7ZbPe7/ASkfCWEp50Czwmm16CIdCKdwrfW/6gq0U/amwzeIMu7ch0rD OLOqu3FxWPXDclsrLn7m8TfijujBYrc+dUM1Bx9dhczXH/Irh46Ms5fLWQRleTo9 d2uzkn1vBseCeqTCWPO8H9aZYWYdHpPyK/KJVAjAzX3BYKhnH3/ByFTSYWWmqlG5 q48K+FjH44yBEQ9kl07w5597S/0/YsDdWAM4LiWYsEDqz9QEK5vwtd/B8lI6gXUD Wi0jom0lMmJirSjIAT9Rcz0D9D2fvkmD+l8GAFpJ0h789pf9T/2PyJtxaUGHNfvx DVaQ7w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=SaEM5SYhicSKWXruaG4EIlyGW6qwkjPvVNGbidiru 0s=; b=KcaN9FKyZiLOtF8CL0gNULfOZJc/2q+RhhMjEAu8eeRhKJoeZBcuJC745 gTczmw5+F5Xkl+PWfbuF5HQIjPjHRNnWR0fHXsb96sR7LHFTyUIixC+SMqjVMyHb zcWou2m10uRfVA62NAuRdAbNIMepiG4tjOxFsdYOUeoWlCP9aMVY2xEgpTTCKqHH TQDK8bOuFvuScZNoAFu/IGeDMfzgAXuenxEc0y1JQRDtnGTBLEZnHOnDiluzMZi8 XqJmlpKEdWgppBUwGi6KmMIhc8ht2b9qI0eYxksuyIulwx4cIUlBGP2slOc6xphe aU7srK+xj/72kKMDmRzewFUSxPi8Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdefiedgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvufgjfffkgggtgfesthhqredttderjeenucfhrhhomheptehlvghk shgrnhgurghrucffihhmihhtrhhovhcuoehmrghilhesrghlvghkshdrsghgqeenucggtf frrghtthgvrhhnpeduueeitdeitedvjeejteffueeluedujeeljeekveelteffuefgudfh hfeugeduvdenucffohhmrghinhepshhtrggtkhhovhgvrhhflhhofidrtghomhdpuhhnih dqvghrlhgrnhhgvghnrdguvgdpfiefrdhorhhgnecukfhppeekjedrudeluddrvdekrddv gedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grihhlsegrlhgvkhhsrdgsgh X-ME-Proxy: Received: from NOAH185-L (unknown [87.191.28.242]) by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 4 May 2021 04:44:45 -0400 (EDT) References: <871raosx9a.fsf@posteo.net> <87k0og8fss.fsf@list.aleks.bg> <874kfjtv5u.fsf@posteo.net> User-agent: mu4e 1.5.5; emacs 28.0.50 From: Aleksandar Dimitrov To: org-mode-email Subject: Re: About multilingual documents In-reply-to: <874kfjtv5u.fsf@posteo.net> Date: Tue, 04 May 2021 10:44:43 +0200 Message-ID: <87bl9qvqf8.fsf@aleks.bg> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=66.111.4.28; envelope-from=mail@aleks.bg; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620118017; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=SaEM5SYhicSKWXruaG4EIlyGW6qwkjPvVNGbidiru0s=; b=iD8ZG7lQVV248KC6BKwEImitMyO7Cw4id3E5Be+hm+hn6xE4xzTiThPFrtKNnUXLDOQyy4 hcBS14WwPnJYEO8rEXdQ0yMNw+jt0DEjzVHov0jD7QNYcd2j4TDebSKtHtOoYRFfv0Xjf0 Te4vUUO2XQ5cZxceEmy2bdiBUJ0i1vFfp33KTu4HkySCAzVzsPX4oAbbwhsjTemHo6W2yh eK9ZRKbv35Ii59hmHZkioqwcIc+fgTld1/gqdkkV6J02r5ozGbl8d6n2jX38OloKD7yA6c CfOR51LXh1M7hla65bk5TwM8+gYbJOLI8wskSbb3xN9lZRa2FjT+Qip6lsT/TA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620118017; a=rsa-sha256; cv=none; b=RRj1bXy5TvRafVCOrUnM9gVUvOOVmamdazmXTlVHVkNjunDINebyY7jfzAdZZvbtwaS/4b h1w7Nz2AX/yUSYTA0yVQZwRF6Mc7S4gSIHkTq8Nl3Mor5LjkaHoFkpi1XPlT6kYUWZh/TD EwnigGDdSocyPvsWp8AGGJVSTRO95oDXQjumbZwLr1meI8vUg5+UiYq+7v1dzYoYwiVWXe Gc8LDqa8rlThtUMfFFM3L8khJhGVVukgbHPFLmHCL2aZCRkO0h4VZojbnd5p/pIvXqL+K9 Tcz3QoVU3bPRpi7TBHeG6VKOXGqMP/8E7oKH94GrYlRYKmJxT0fpmCqAP+mPpw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=aleks.bg header.s=fm2 header.b=YeGd4n0a; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=KcaN9FKy; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.66 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=aleks.bg header.s=fm2 header.b=YeGd4n0a; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=KcaN9FKy; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: D779BDB38 X-Spam-Score: -2.66 X-Migadu-Scanner: scn0.migadu.com X-TUID: g5yB04VZBmXx Hi Juan, > Thank you very much for your interesting comments. I think your idea of > applying org-babel to (multi) language support is tremendously > suggestive and, of course, more org-centric. I suppose it could be > applied also to languages within the paragraph by inline blocks... I > really liked what you propose. > > Well, I admit that my marks are a bit exotic :-D. The main problem I see > is that they are not as robust as Org's own marks, since they are > controlled by an export filter. Doing some further tests, by the way, I > think it would be better to add the filter to > `org-export-filter-plain-text-functions', instead of > `...final-output-functions'. I also see that it would be convenient to > avoid their expansion in verbatim texts, with a `(unless > (org-in-verbatim-emphasis)...)'. What I like about =3Dorg-edit-special=3D is that it gives you a dedicated little environment in a different language (either natural, or programming language!) This allows me to focus on the task of editing it really easily. I must admit that I find the inline org-src notation (of which I didn't know yet) somewhat jarring, and certainly less pleasant to read. Perhaps we could use a similar mechanism to =3Dorg-hide-emphasis-markers=3D to make it more pleasant to read. [1] > Anyway, I think (in general terms) it would be interesting for Org to > incorporate some multilingual support and the ability to toggle between > languages in a document, and the idea you propose seems to > me that it makes a lot of sense. I definitely agree that Org would benefit from more multilingual support. I'm not very experienced in emacs-lisp but would love to contribut= e. One problem I foresee is the translation of locales into LaTeX macros for either (LaTeX)-Babel or Polyglossia (which is what I use.) So a string like "en" or "en_UK" (which is readily understood by ([ai]|hun)spell) would have to be translated to the necessary macros. For example for Polyglossia [2] the preamble would read \setdefaultlanguage[variant=3Duk]{english} And then the inline commands would have to be rendered as \textenglish{=E2=80=A6} or \textlang{english}{=E2=80=A6} (probably the latt= er would be easier.) I forgot what it is for LaTeX-Babel. Note that the HTML export backend, too, could (or should) support declaring multiple languages. [3] There's a lot of work in there, but I would say that any implementation effort should focus on one thing first. That could be switching the dictionary on org-edit-special if a :lang-variable is set, or it could be re-using what you, Juan, already wrote for LaTeX-Babel exports. Support for Polyglossia or HTML could come at a later time. Cheers, Aleks [1] https://stackoverflow.com/questions/20309842/how-to-syntax-highlight-fo= r-org-mode-inline-source-code-src-lang/28059832#28059832 [2] https://ftp.rrze.uni-erlangen.de/ctan/macros/unicodetex/latex/polygloss= ia/polyglossia.pdf [3] https://www.w3.org/International/questions/qa-html-language-declarations > > Best regards, > > Juan Manuel=20 > > Aleksandar Dimitrov writes: > >> Hi Juan, >> >> this sounds very interesting to me, as I, too, mostly write in Org >> and, sometimes write documents in multiple languages, usually with >> different varieties of either Latin or Cyrillic. >> >> I have some suggestions: >> >> Apart from the export, one of my biggest gripes is >> flyspell. Specifically, the fact that you have to choose one language to >> spell check the entire document with. That is insufficient in my case. >> >> I think that the syntax you're suggesting looks good, but I'm not >> sure how well it'd fit into org-mode's ecosystem. I had something in >> mind that was closer to how org-babel works (it's called *babel* >> for a reason, isn't it? :D) >> >> #+begin_src org :lang pl >> =E2=80=A6 po polsku >> #+end_src >> >> #+begin_src org :lang de >> =E2=80=A6 auf deutsch >> #+end_src >> >> >> This would make use of org-mode's edit special environment function. It >> would make it easier to persuade flyspell to do the right thing. You >> could, perhaps, add >> >> #+LANGUAGE: en >> >> to the parent document, and then org would take care to set the correct >> flyspell language (and the correct macros on LaTeX-export) and change >> these parameters in the special environments. >> >> I'm not 100% sure it should be #+begin_src org, maybe introducing a >> different special environment would be better, say #+begin_lang XX where >> XX is the ISO-code of said language, or the locale (think en_US >> vs. en_GB.) >> >> The drawback, and the clear disadvantage compared to your method is that >> this works great only when the languages are separated by paragraph >> breaks. >> >> Therefore, I think our suggestions might be somewhat orthogonal. Yours >> could be a shorthand syntax for introducing inline foreign-language >> snippets. >> >> What do you think? >> >> Regards, >> Aleks >> >> Juan Manuel Mac=C3=ADas writes: >> >>> Hi all, >>> >>> I'm curious to see how other Org users deal with multilingual documents, >>> that is, those documents (for example, philology or linguistics texts) >>> that contain a significant number of online quotes in other languages. >>> Naturally, this makes more sense in the LaTeX backend, since it is >>> convenient to enclose these quotes in a \foreignlanguage command to >>> ensure that LaTeX at least apply the correct hyphenation patterns for >>> words in other languages. >>> >>> Luckily, in the latest versions of Babel (the Babel of LaTeX) you don't >>> need to do this when it comes to languages whose script is different >>> from Latin (e.g. Greek, languages with Cyrillic, Arabic, Hindi, etc.). >>> We can, for example, define Russian and Greek as: >>> >>> #+begin_src latex >>> \babelprovide[onchar=3Dids fonts,hyphenrules=3Drussian]{russian} >>> \babelprovide[onchar=3Dids fonts,hyphenrules=3Dancientgreek]{greek} >>> #+end_src >>> >>> And also the fonts for both languages: >>> >>> #+begin_src latex >>> \babelfont[russian]{rm}{Linux Libertine O} >>> \babelfont[greek]{rm}]{Free Serif} >>> #+end_src >>> >>> For Latin-based scripts it is still necessary enclose the text in the >>> \foreignlanguage command. And now comes the question: how do Org users >>> who work in multilingual documents to obtain this command when exporting >>> to Latex? >>> >>> I usually use macros, which always tend to work fine. But lately I have >>> been testing an alternative markup system using an export filter. The >>> idea would be something like: >>> >>> %(lang) lorem ipsum dolor %() >>> >>> I start from a list of the most used languages: >>> >>> #+begin_src emacs-lisp >>> (langs '(("en" "english") >>> ("fr" "french") >>> ("de" "german") >>> ("it" "italian") >>> ("pt" "portuguese"))) >>> #+end_src >>> >>> And other possible languages that Babel supports can be indicated >>> explicitly, by prepending "--": >>> >>> %(fr) ... %() >>> >>> %(--esperanto) ... %() >>> >>> (If someone wants to try it, I attach a small Org document). >>> >>> Best regards, >>> >>> Juan Manuel >> >> > > --=20