Skip to content

feat(native): add os-locale to replacements - #1263

Merged
43081j merged 2 commits into
e18e:mainfrom
maksimgm:feat/os-locale
Nov 20, 2026
Merged

43081j merged 2 commits into
e18e:mainfrom
maksimgm:feat/os-locale

Conversation

@maksimgm

Copy link
Copy Markdown
Contributor

🔗 Linked issue

closes #1195

📚 Description

maps os-locale (~5.9M weekly downloads) to the existing native Intl.DateTimeFormat, going with the Intl option as suggested on the issue:

import { osLocale } from 'os-locale' // [!code --]

const locale = await osLocale() // [!code --]
const locale = new Intl.DateTimeFormat().resolvedOptions().locale // [!code ++]

checked against os-locale@8.0.0: same result with no env vars set (it falls back to the same Intl call). the difference is that the package reads LC_ALL/LC_MESSAGES/LANG/LANGUAGE first, so e.g. LANG=de_DE.UTF-8 gives de-DE there and the system locale with Intl

@43081j
43081j merged commit 2000b04 into e18e:main Nov 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Replacement]: os-locale

2 participants