Language Server for gettext po files.
Project description
po-language-server
This is a Markov-chain based completion language
server for
gettext po
files.
Installation
python3 -m pip install po-language-server
It should be compatible with vim, emacs, vscode, and other text editors acting as language server clients. I only tried it using emacs though.
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-language-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.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d32187b296ccf6581c01453ce8c402421aed2f03c5d38220e1bd01b77b742feb |
|
MD5 | 7284688054043dcd4dab6bd2772e2128 |
|
BLAKE2b-256 | d9dfe5dbb64a0a4b5ffbaf9af4bf674e2b2bfaac95c8c8bc2071b608e539f874 |