Musl: Difference between revisions
Prabuanand (talk | contribs) (Added language support and locale information from Post installation page the content added by user Guest09248 on 6 January 2022 00:13) |
Prabuanand (talk | contribs) (removed the Todo tag and added links, rephrased sentence) |
||
Line 2: | Line 2: | ||
== Locale == | == Locale == | ||
To Fix unicode defaults: | To Fix unicode defaults: | ||
<code>sed -i 's/#unicode="NO"/#unicode="NO"\nunicode="YES"/' /etc/rc.conf</code> | <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}} | Musl does not implement most of the locale features that glibc implements. The {{Pkg|musl-locales}} package provides [https://git.adelielinux.org/adelie/musl-locales translations] with varying degrees of completion. The below command installs a limited set of locales (languages) for musl (C library) generated console messages. | ||
The below command installs a limited set of locales (languages) for musl (C library) generated console messages. | |||
{{Cmd|# apk add musl-locales}} | {{Cmd|# apk add musl-locales}} | ||
To list defined locales | The {{Pkg|musl-locales}} package also provides <code>locale</code> command. To list defined locales: | ||
{{cmd|locale -a}} | {{cmd|locale -a}} | ||
{ | This package includes a file in {[Path|/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 {{Path|/etc/profile.d/20locale.sh}} to a custom override file: | |||
{{Cmd|# cp /etc/profile.d/20locale.sh /etc/profile.d/20locale.sh.sh}} | |||
Now custom override file can be edited with <Code>nano /etc/profile.d/locale.sh.sh</Code>. | |||
== Language support == | == Language support == | ||
<!-- | <!--Need to identify proper page for maintaining this information, if this is not appropriate --> | ||
Need to identify proper page for maintaining this information, if this is not appropriate --> | |||
To pull in the translation packages | To pull in the translation packages for all installed packages: | ||
{{Cmd|# apk add lang}} | {{Cmd|# apk add lang}} | ||
To list available hunspell dictionary packages, so that you relevant language dictionary can be added: | To list available hunspell dictionary packages, so that you relevant language dictionary can be added: | ||
{{Cmd| | {{Cmd|apk list hunspell*}} | ||
To list translation packages for your specific(xy) language: | To list translation packages for your specific(xy) language: | ||
Line 38: | Line 34: | ||
For example, to list translation packages for Portuguese(pt) language: | For example, to list translation packages for Portuguese(pt) language: | ||
{{Cmd|apk list *-pt *-pt-*}} | {{Cmd|apk list *-pt *-pt-*}} | ||
== See Also == | == See Also == | ||
* [https://wiki.musl-libc.org/functional-differences-from-glibc.html Functional differences between musl and glibc] | * [https://wiki.musl-libc.org/functional-differences-from-glibc.html Functional differences between musl and glibc] | ||
* [https://git.adelielinux.org/adelie/musl-locales Adelielinux musl-locales page] | |||
[[Category:System Administration]] | [[Category:System Administration]] |
Latest revision as of 15:00, 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 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 in {[Path|/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
.
Language support
To pull in the translation packages for 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-*