zevlg / telega.el

GNU Emacs telegram client (unofficial)
https://zevlg.github.io/telega.el/
GNU General Public License v3.0
1.09k stars 85 forks source link

`telega-i18n.el` and languages files on Guix #416

Closed aadcg closed 1 year ago

aadcg commented 1 year ago

Telega Setup

OS: Guix System Emacs: GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0) Features: svg ffmpeg Telega: telega v0.8.100 (TDLib v1.8.10-GITDIR-) (telega-server v0.8.2)

Current Behavior

I had to hardcore the the location of en.plist to start telega. Notice that Guix is a non-standard distro, so the logic that telega uses to find the file is brittle.

(defun telega-i18n--etc-langs-strings (lang)
    "Read language strings from etc/langs/LANG.plist file."
    (with-temp-buffer
      (insert-file-contents "/gnu/store/kvz0gakffdr9vqa8bqyc9yscagw0aniw-emacs-telega-0.8.03-0.01e8f9e/share/emacs/site-lisp/telega-0.8.03-0.01e8f9e/etc/langs/en.plist")
      (goto-char (point-min))
      (read (current-buffer))))

Possible Solution

I think that it would be great to introduce a variable that would set the location of telega/etc/langs. Then the value could be overwritten in the Guix package definition of telega.

Also, is there a way to disable telega-i18n.el?

zevlg commented 1 year ago

What the value for telega--lib-directory you get after loading telega.el into Emacs ?

WorldsEndless commented 1 year ago

I am also a guix user. Isn't there a stable place for linking to the file under ~/.guix-profile/share/emacs/site-lisp/? Then you wouldn't need co include the shifty hash code in there.

aadcg commented 1 year ago

@zevlg sorry for wasting your time. telega works properly on Guix, the issue was coming from my side.