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
File details
Details for the file po-language-server-0.0.1.tar.gz
.
File metadata
- Download URL: po-language-server-0.0.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 221a540622a71363358a7e9ce069c325099b65b4f8a7dd7db071049ddda7fece |
|
MD5 | a147ce0c13367c43caa8181306025219 |
|
BLAKE2b-256 | c3378ce36574936c1c58ce7afe81aaa8a72bdcee03fa93c22aaa8779e375425f |
File details
Details for the file po_language_server-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: po_language_server-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff8e4d9f38ad3f5286695d40b5af0187afb676bd97cc16b41c3d4b85c1d9a9a4 |
|
MD5 | 0383178d59150d8fb33f2607860cac74 |
|
BLAKE2b-256 | 45a014f123ad356c17a5dcf88791bb462c5f81c30b9edcfc8eea7b15f73c3186 |