From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: Emacs as a translator's tool Date: Fri, 18 Sep 2020 12:08:28 -0700 Message-ID: <87d02inbrn.fsf@ericabrahamsen.net> References: <871rn35lqc.fsf@mbork.pl> <87zh9r45ad.fsf@mbork.pl> <87h7vz2m5g.fsf@ebih.ebihd> <87zh9qr67n.fsf@ericabrahamsen.net> <3DBA2692-28A0-4AC3-B884-78763A9C7B16@traduction-libre.org> <87tuzyr474.fsf@ericabrahamsen.net> <87h7rwtov7.fsf@ericabrahamsen.net> <87d02ktmpr.fsf@ericabrahamsen.net> <875z8c8din.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36937"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs To: Arthur Miller Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 18 22:14:34 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kJMm7-0009SB-II for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 18 Sep 2020 22:14:31 +0200 Original-Received: from localhost ([::1]:60010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJMm6-0005Hv-Io for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 18 Sep 2020 16:14:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJLkR-0006ev-65 for help-gnu-emacs@gnu.org; Fri, 18 Sep 2020 15:08:43 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:38244 helo=mail.ericabrahamsen.net) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJLkN-0002PU-8P for help-gnu-emacs@gnu.org; Fri, 18 Sep 2020 15:08:42 -0400 Original-Received: from localhost (75-172-112-137.tukw.qwest.net [75.172.112.137]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 46A25FA035; Fri, 18 Sep 2020 19:08:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1600456109; bh=NuWZlEPx9314/9RpyXnuD0BAZyAq1l7tLlHq+K2g4Hs=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=aI47fl4b/+qiIpgbno7fCcfav2IRB4ZeaOT4C19ArCLCxn8Q4ECGIoQkkG+F4aayw huCmP6w1budGMrtRIXZ78AantbdU3rRah+PrewfmqLkrhZBQZcht7Gf49nz7ZIwTsI QtVlXCeLFQDdT4BqRu7kc3za8TPcRQrMiXAulDnA= In-Reply-To: (Arthur Miller's message of "Fri, 18 Sep 2020 20:26:23 +0200") Received-SPF: pass client-ip=52.70.2.18; envelope-from=eric@ericabrahamsen.net; helo=mail.ericabrahamsen.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/18 15:08:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124096 Archived-At: [Dropping other people off cc as they might not want to stick with a pretty old thread] Arthur Miller writes: >> -------- Originalmeddelande -------- >> Fr=C3=A5n: Eric Abrahamsen >> Datum: 2020-09-17 20:27 (GMT+01:00) >> Till: arthur miller >> Kopia: Jean-Christophe Helary , >> help-gnu-emacs , Emanuel Berg , Yuri >> Khan >> =C3=84mne: Re: Emacs as a translator's tool >> >> arthur miller writes: >> >>> Sure, no rush at all. By the way, the original source is a book in pdf = format. >> >> Ha, this package won't do much at all, then! The main point is having >> source and translation together in the same buffer, and keeping >> correspondences between locations and glossary items. If the source >> isn't in Emacs at all, I don't think it will do much for you. > > Ok, text extracted fine; I am not sure how to use the tool yet; but at > least I can repport that when I tried to enable org-translate-mode I got > error: > > Symbol=E2=80=99s value as variable is void:org-export-filter-body-functio= ns > > That was solved by (require 'ox). I don't know if ox is supposed to be > included by default or not, but seems to solve it. Oops, thanks, I'll add that. > After that mode started correctly (in my org file), and asked me if I > wanted to index something: > > Project not yet segmented, segment now? (y or n) y > You=E2=80=99re 0% done! > > I have downloaded the source file just few minutes ago, so I guess I > have the latest version. > > Any pointer what to do next/how to use the tool? How should I setup the > document so it can be used with the tool? How do I set the source file > (extracted text), do I need to copy it manually or can I set it up as a > file to be imported? > > Currently I try to follow the book layout as closely as possible, so I > have a structure as this: > > * Chapter X > ** p1 > ** p2 > ... > ** pn > *Chapyter Y > ** pn+1 > .... You can check the Commentary section of the file for the basics: right now it expects three (at least) top-level Org headings, representing the source text, translated text, and glossary. So you'd move your existing translation under a new top-level heading, put the original source text under a new top-level heading, and add a third top-level heading for the glossary. How the package identifies which tree is which is very customizable, but by default it looks for a ":source:" tag on the top heading of the source tree, a ":translation:" tag on the top heading of the translation tree, and a glossary where the heading text itself is just "Glossary". If you're doing a book, I would then set `ogt-segmentation-strategy' to the symbol 'paragraph. Then turn on the minor mode, which should segment the source text. I've updated the library to also segment the translation text, which will be important to you since you've already done so much of it. I'm sort of surprised that segmentation didn't error out before -- if the code can't find a source tree, it should indicate an error. Then use "C-M-n" to start a new segment in the translation text, and "C-M-f" and "C-M-b" to move between segments. Or move around however you like, and then hit "C-M-t" to update the source window to show the location corresponding to where you are. It's early days for this library, so please be patient! Thanks for being willing to test it. Eric