Musl: Difference between revisions

From Alpine Linux
(New article, mostly hints on locale)
 
(Added language support and locale information from Post installation page the content added by user Guest09248 on 6 January 2022 00:13)
Line 1: Line 1:
Alpine Linux uses musl as its C standard library.
Alpine Linux uses musl as its C standard library.


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


Musl does not implement most of the locale features that glibc implements. The {{Pkg|musl-locales}} provides the <code>locale</code> command and [https://git.adelielinux.org/adelie/musl-locales translations with varying degrees of completion].
Musl does not implement most of the locale features that glibc implements. The {{Pkg|musl-locales}} provides the <code>locale</code> command and [https://git.adelielinux.org/adelie/musl-locales translations with varying degrees of completion].  


{{Note|this package includes a file in <code>/etc/profile.d/00locale.sh</code>. You'll need to re-login or source it manually for locales to work}}
The below command installs a limited set of locales (languages) for musl (C library) generated console messages.
 
{{Cmd|# apk add musl-locales}}
 
To list defined locales use the below command:
{{cmd|locale -a}}
 
{{Todo|Need to check which of the below is correct:
 
* This package includes a file in <code>/etc/profile.d/00locale.sh</code>. You'll need to re-login or source it manually for locales to work
* Copy the default locale settings file {{Path|/etc/profile.d/20locale.sh}} to custom override file{{Path|/etc/profile.d/20locale.sh.sh}} so that the custom override file can be edited with <Code>nano /etc/profile.d/locale.sh.sh</Code>.
 
{{Cmd|cp /etc/profile.d/20locale.sh /etc/profile.d/20locale.sh.sh}}
}}
 
== Language support ==
 
<!--
Need to identify proper page for maintaining this information, if this is not appropriate -->
 
To pull in the translation packages of all installed packages:
{{Cmd|# apk add lang}}
 
To list available hunspell dictionary packages, so that you relevant language dictionary can be added:
{{Cmd|# apk list hunspell*}}
 
To list translation packages for your specific(xy) language:
{{Cmd|apk list *-xy *-xy-*}}
 
For example, to list translation packages for Portuguese(pt) language:
{{Cmd|apk list *-pt *-pt-*}}
 
 
== See Also ==
 
* [https://wiki.musl-libc.org/functional-differences-from-glibc.html Functional differences between musl and glibc]
 
[[Category:System Administration]]

Revision as of 14:42, 8 November 2024

Alpine Linux uses musl as its C standard library.

Locale

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 provides the locale command and 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

To list defined locales use the below command:

locale -a

Todo: Need to check which of the below is correct:
  • This package includes a file in /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 custom override file/etc/profile.d/20locale.sh.sh so that the custom override file can be edited with nano /etc/profile.d/locale.sh.sh.

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


Language support

To pull in the translation packages of all installed packages:

# apk add lang

To list available hunspell dictionary packages, so that you relevant language dictionary can be added:

# apk list hunspell*

To list translation packages for your specific(xy) language:

apk list *-xy *-xy-*

For example, to list translation packages for Portuguese(pt) language:

apk list *-pt *-pt-*


See Also