From mboxrd@z Thu Jan 1 00:00:00 1970 From: Diego Zamboni Subject: Re: Localized org-mode Date: Wed, 9 May 2018 13:36:39 +0200 Message-ID: References: <1525784567.2021.47.camel@gmail.com> <87bmdqtf01.fsf@nicolasgoaziou.fr> <1525801068.2021.56.camel@gmail.com> <87bmdqrosp.fsf@nicolasgoaziou.fr> <1525851919.2021.66.camel@gmail.com> <877eodutq2.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f4ba2f056bc45081" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGNOo-00083B-35 for emacs-orgmode@gnu.org; Wed, 09 May 2018 07:36:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGNOj-00068N-B2 for emacs-orgmode@gnu.org; Wed, 09 May 2018 07:36:46 -0400 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:51653) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGNOi-00064z-UC for emacs-orgmode@gnu.org; Wed, 09 May 2018 07:36:41 -0400 Received: by mail-wm0-x231.google.com with SMTP id j4so24132197wme.1 for ; Wed, 09 May 2018 04:36:40 -0700 (PDT) In-Reply-To: <877eodutq2.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: Org-mode , ST --000000000000f4ba2f056bc45081 Content-Type: text/plain; charset="UTF-8" I really don't see the point of trying to localize org keywords. To me, they are like the keywords in any programming language - part of the language. Would you consider translating C or LISP keywords? In addition to the trouble of supporting something like this within Emacs, think of the growing ecosystem of tools which support org mode - they would all need to be aware of these localizations. It would be a nightmare to maintain. --Diego On Wed, May 9, 2018 at 10:19 AM, Nicolas Goaziou wrote: > Hello, > > ST writes: > > > So how do you solve this problem now for English ":PROPERTIES:"? > > Simple. Org does not replace anything arbitrarily. This is less > error-prone. > > > Anyway if somebody runs into it he could have at least to options: > > > > 1. write local .emacs.d/.org-de-vocabulary which will override the > > default one (or parts of it) with a synonym, like: > > PROPERTIES -> ATTRIBUTEN > > or > > PROPERTIES -> ORG_EIGENSCHAFTEN > > and then you can replace blindly before parsing. > > Again, I'm not particularly fond of having conditional syntax like this. > > > I don't know lisp :( > > You may want to look at `org-display-custom-time'. > > Basically, you search for the regexp "^[ \t]*:\\(PROPERTIES\\):", and > use `put-text-property' to change the text between (match-beginning 1) > and (match-end 1), e.g., > > (defun my-properties-translate () > (org-with-point-at 1 > (while (re-search-forward "^[ \t]*:\\(PROPERTIES\\):" nil t) > (put-text-property (match-beginning 1) (match-end 1) 'display > "ATTRIBUTEN")))) > > You need to add this function to, e.g. `org-mode-hook'. Of course this > is really basic and can be improved. > > Regards, > > -- > Nicolas Goaziou 0x80A93738 > > --000000000000f4ba2f056bc45081 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I really don't see the point of trying to localize org= keywords. To me, they are like the keywords in any programming language - = part of the language. Would you consider translating C or LISP keywords?
In addition to the trouble of supporting something like th= is within Emacs, think of the growing ecosystem of tools which support org = mode - they would all need to be aware of these localizations. It would be = a nightmare to maintain.

--Diego

On Wed, May 9, 2018 at = 10:19 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrot= e:
Hello,

ST <smntov@gmail.com> writes:=

> So how do you solve this problem now for English ":PROPERTIES:&qu= ot;?

Simple. Org does not replace anything arbitrarily. This is less
error-prone.

> Anyway if somebody runs into it he could have at least to options:
>
> 1. write local .emacs.d/.org-de-vocabulary which will override the
> default one (or parts of it) with a synonym, like:
> PROPERTIES -> ATTRIBUTEN
> or
> PROPERTIES -> ORG_EIGENSCHAFTEN
> and then you can replace blindly before parsing.

Again, I'm not particularly fond of having conditional syntax li= ke this.

> I don't know lisp :(

You may want to look at `org-display-custom-time'.

Basically, you search for the regexp "^[ \t]*:\\(PROPERTIES\\):",= and
use `put-text-property' to change the text between (match-beginning 1)<= br> and (match-end 1), e.g.,

=C2=A0 =C2=A0 (defun my-properties-translate ()
=C2=A0 =C2=A0 =C2=A0 (org-with-point-at 1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (while (re-search-forward "^[ \t]*:\\(PROP= ERTIES\\):" nil t)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (put-text-property (match-beginning 1) (= match-end 1) 'display "ATTRIBUTEN"))))

You need to add this function to, e.g. `org-mode-hook'. Of course this<= br> is really basic and can be improved.

Regards,

--
Nicolas Goaziou=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0x80A93738


--000000000000f4ba2f056bc45081--