Language Server for gettext po files.
Project description
po-language-server
This is a Markov-chain based completion language server for po
files.
Installation
python3 -m pip install po-language-server
Emacs configuration
I did not packaged it yet (feel free to help), but it's not that hard to configure:
(require 'lsp-mode)
(add-to-list 'lsp-language-id-configuration '(po-mode . "gettext"))
(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection "po-langage-server")
:activation-fn (lsp-activate-on "gettext" "plaintext")
:priority -1
:server-id 'po
))
(add-hook 'po-mode-hook #'lsp)
;; lsp-mode can only work on named buffers
(defun po-mode-name-buffer ()
(setq-local buffer-file-name "msgstr.po")
(lsp))
(defun po-mode-unname-buffer ()
(setq-local buffer-file-name nil))
(add-hook 'po-mode-hook
(lambda ()
(advice-add 'po-edit-msgstr :after 'po-mode-name-buffer)
(advice-add 'po-subedit-exit :before 'po-mode-unname-buffer)))
(add-to-list 'lsp-enabled-clients 'po)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for po_language_server-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff8e4d9f38ad3f5286695d40b5af0187afb676bd97cc16b41c3d4b85c1d9a9a4 |
|
MD5 | 0383178d59150d8fb33f2607860cac74 |
|
BLAKE2b-256 | 45a014f123ad356c17a5dcf88791bb462c5f81c30b9edcfc8eea7b15f73c3186 |