unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54139: 27.2; Translating the Emacs Menu
@ 2022-02-24  8:30 Dr. Arne Babenhauserheide
  2022-02-24  9:34 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Dr. Arne Babenhauserheide @ 2022-02-24  8:30 UTC (permalink / raw)
  To: 54139

[-- Attachment #1: Type: text/plain, Size: 1633 bytes --]


For newcomers the Menu is very useful to start into Emacs. But it is
only available in English.

It would be great to be able to translate it, for example by setting
some translation strings.

One way to get the initial steps could be to have (bindings--define-key
...) check a table of known translations and use a translated string if
available.

A more advanced method would be shelling out to gettext to benefit from
existing translation platforms.

Here’s an unclean proof of concept that might break your Emacs and is
not fit for Emacs itself due to using advice:

(defun translate-bindings (orig-fun &rest args)
  (let* ((menu (nth 0 args))
         (key (nth 1 args))
         (entry (nth 2 args))
         (new-entry (cond
                     ((and (< 1 (length entry)) (stringp (nth 0 entry)))
                      (let ((name (nth 0 entry)))
                        (cons (concat "translated: " name) (cdr entry))))
                     ((and (< 2 (length entry)) (stringp (nth 1 entry)))
                      (let ((name (nth 1 entry)))
                        (cons (car entry) (cons (concat "translated: " name) (cdr (cdr entry))))))
                     (t entry))))
    (print (and (< 2 (length entry)) (stringp (nth 1 entry))))
    (print new-entry)
    (apply orig-fun menu key (list new-entry))))
(advice-add 'bindings--define-key :around #'translate-bindings)
(require 'menu-bar)
(bindings--define-key global-map [menu-bar edit]
   (cons "Edit" menu-bar-edit-menu))

Best wishes,
Arne


-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#54139: 27.2; Translating the Emacs Menu
  2022-02-24  8:30 bug#54139: 27.2; Translating the Emacs Menu Dr. Arne Babenhauserheide
@ 2022-02-24  9:34 ` Lars Ingebrigtsen
  2022-03-26 16:37   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2022-02-24  9:34 UTC (permalink / raw)
  To: Dr. Arne Babenhauserheide; +Cc: 54139

"Dr. Arne Babenhauserheide" <arne_bab@web.de> writes:

> For newcomers the Menu is very useful to start into Emacs. But it is
> only available in English.
>
> It would be great to be able to translate it, for example by setting
> some translation strings.

I don't think translating just the menus would help much -- for this to
make sense, we'd need to internationalise the source code so that
messages are also localised.

And there's an etc/TODO item for that.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#54139: 27.2; Translating the Emacs Menu
  2022-02-24  9:34 ` Lars Ingebrigtsen
@ 2022-03-26 16:37   ` Lars Ingebrigtsen
  2022-03-26 22:43     ` Dr. Arne Babenhauserheide
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-26 16:37 UTC (permalink / raw)
  To: Dr. Arne Babenhauserheide; +Cc: 54139

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I don't think translating just the menus would help much -- for this to
> make sense, we'd need to internationalise the source code so that
> messages are also localised.
>
> And there's an etc/TODO item for that.

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#54139: 27.2; Translating the Emacs Menu
  2022-03-26 16:37   ` Lars Ingebrigtsen
@ 2022-03-26 22:43     ` Dr. Arne Babenhauserheide
  0 siblings, 0 replies; 4+ messages in thread
From: Dr. Arne Babenhauserheide @ 2022-03-26 22:43 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54139

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]


Lars Ingebrigtsen <larsi@gnus.org> writes:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> I don't think translating just the menus would help much -- for this to
>> make sense, we'd need to internationalise the source code so that
>> messages are also localised.

I think there is a point to that: Users who do not need the full
commands of Emacs translated, but simply want the efficient large-file
handling and fontification. 

A translated menu and a toolbar make this much easier.

Another group are those who speak some English, but have an easier time
reading their native language. When reading English at a word per
second, a translated menu helps a lot already, but messages can still be
deciphered when needed.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-26 22:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24  8:30 bug#54139: 27.2; Translating the Emacs Menu Dr. Arne Babenhauserheide
2022-02-24  9:34 ` Lars Ingebrigtsen
2022-03-26 16:37   ` Lars Ingebrigtsen
2022-03-26 22:43     ` Dr. Arne Babenhauserheide

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).