Locale

From Alpine Linux
Revision as of 18:22, 14 July 2025 by Prabuanand (talk | contribs) (moved content to own page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Musl does not implement most of the locale features that glibc implements.

To Fix unicode defaults: sed -i 's/#unicode="NO"/#unicode="NO"\nunicode="YES"/' /etc/rc.conf

Musl does not implement most of the locale features that glibc implements. The musl-locales package provides translations with varying degrees of completion. The below command installs a limited set of locales (languages) for musl (C library) generated console messages.

# apk add musl-locales

The musl-locales package also provides locale command. To list defined locales:

locale -a

This package includes a file /etc/profile.d/00locale.sh. You'll need to re-login or source it manually for locales to work.

Copy the default locale settings file /etc/profile.d/20locale.sh to a custom override file:

# cp /etc/profile.d/20locale.sh /etc/profile.d/20locale.sh.sh

Now custom override file can be edited with nano /etc/profile.d/locale.sh.sh.

See also