Skip to main content

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)

Metadata

Release files for po-language-server 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for po-language-server 0.0.2
File Size Uploaded
po-language-server-0.0.2.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for po-language-server 0.0.2
File Interpreter ABI Platform
po_language_server-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 6.5 kB

Release files / po-language-server-0.0.2.tar.gz

Download URL po-language-server-0.0.2.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2c5a8b33b3c79032b97dfc2805067d18a95a2b1ab96ca8c8bf9ba7409da4d73b
BLAKE2b-256 checksum
How to use checksums
c5abe0b59f0e4267c0f9d1b3749881859befefb827ecf05e323e2cd4a304db21
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / po_language_server-0.0.2-py3-none-any.whl

Download URL po_language_server-0.0.2-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d32187b296ccf6581c01453ce8c402421aed2f03c5d38220e1bd01b77b742feb
BLAKE2b-256 checksum
How to use checksums
d9dfe5dbb64a0a4b5ffbaf9af4bf674e2b2bfaac95c8c8bc2071b608e539f874
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page