Skip to main content

> 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.

More Python utilities / Discuss / Report bug / Report vulnerability / Back to top ↑

Metadata

Release files for sys-lang 1.0.1

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

Source distribution (sdist)

Source distribution for sys-lang 1.0.1
File Size Uploaded
sys_lang-1.0.1.tar.gz 16.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sys-lang 1.0.1
File Interpreter ABI Platform
sys_lang-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.0 kB

Release files / sys_lang-1.0.1.tar.gz

Download URL sys_lang-1.0.1.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
26d18c1a1f152b9da5ead8e6bf374e0e1959a253ea8b7adbad9c14b2b2b8a4b5
BLAKE2b-256 checksum
How to use checksums
c5ae6bbf6c155e972cf5e141072884609cc4fae364f1eddb660b3af8dd228151
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release files / sys_lang-1.0.1-py3-none-any.whl

Download URL sys_lang-1.0.1-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
429794ff82f4a5edcdf71e6d1b5cba5806f8c9c8fddc42ca87a932881973dfb7
BLAKE2b-256 checksum
How to use checksums
99942c991a967a25f0433d8e789427677851e38abc665929800611ae4fc8f471
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

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