Detect the system language.
Project description
> sys-lang
Detect the system language.
Returns ISO 639-1 (e.g. en) or ISO 3166-1 alpha-2-appended (en_US) code for user's preferred language. On Windows, queries Get-Culture via PowerShell. On *nix systems, reads LC_ALL, LC_MESSAGES, LANG, and LANGUAGE.
⚡ Installation
pip install sys-lang
💻 Command line usage
sys-lang # or syslang
# e.g. => 'en_US'
CLI options:
| Option | Description |
|---|---|
-n, --no-region |
Don't include region when available |
-h, --help |
Show help screen |
-v, --version |
Show version |
--docs |
Open docs URL |
🔌 API usage
from sys_lang import get_sys_lang
print(get_sys_lang()) # e.g. => 'zh_HK'
print(get_sys_lang(region=False)) # e.g. => 'zh'
MIT License
Copyright © 2026 Adam Lui
Related
🇪🇸 latin-locales - ISO 639-1 (2-letter) codes for Latin locales.
🇨🇳 non-latin-locales - ISO 639-1 (2-letter) codes for non-Latin locales.
🌍 translate-messages - Translate en/messages.json (chrome.i18n format) to 100+ locales automatically.
🈶 is-unicode-supported - Detect whether the terminal supports advanced Unicode.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sys_lang-1.0.0.tar.gz.
File metadata
- Download URL: sys_lang-1.0.0.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cafaec33c6c4f1a3f53f605a2084101630a1b2888027645f0b868dec244d96f1
|
|
| MD5 |
851d3ba037162715b34bcf6f6f5d9915
|
|
| BLAKE2b-256 |
a200bb6deca85ad05b48da060e69cc0f62562fbba04509682d50e18064a71031
|
File details
Details for the file sys_lang-1.0.0-py3-none-any.whl.
File metadata
- Download URL: sys_lang-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bf6fd422d68eaa8484075e79581a680cb45ffa6a48a98cae4e939b5efb142e1
|
|
| MD5 |
c3c7b9b400fe9da981545994dcc99919
|
|
| BLAKE2b-256 |
e2ab0bc0df7b89a41d1230abd3fcd0218600788b0107908b30acdac5c30237cc
|