The procedure to enable Portuguese - BRAZIL (BR) (pt_BR) under Alpine Linux is as follows:
- Install Locales support for musl using the apk command:
apk add musl-locales
apk add lang # pull lang packages for existing installed pkgs
- List all locales installed. For example:
locale -a
locale -a | more
locale -a | grep -i BR
- Set MUSL_LOCPATH using the export command:
export MUSL_LOCPATH=/usr/share/i18n/locales/musl
- Test it using the date command:
LC_ALL=fr_FR.UTF-8 date
LC_ALL=pt_BR.UTF-8 date
- Add the following to your shell profile file such as $HOME/.profile or $HOME/.bash_profile
export MUSL_LOCPATH=/usr/share/i18n/locales/musl
export CHARSET=pt_BR.UTF-8
export LANG=pt_BR.UTF-8
export LC_COLLATE=pt_BR.UTF-8
date