complete locale list

This commit is contained in:
Tobias Powalowski 2023-03-05 14:05:51 +01:00
parent 4c8368f235
commit 55987b1ec5
5 changed files with 26 additions and 8 deletions

View file

@ -59,7 +59,7 @@ _set_vconsole() {
# get list of 2 sign locale
# ${KEYMAP} | grep -v '...' | grep "^[a-z]"
_KEYMAPS="us English de German es Spanish fr French pt Portuguese OTHER More"
_OTHER_KEYMAPS="bg Bulgarian br Brazil ca Canada cz Czech dk Danish et Estonian fi Finnish gr Greek hu Hungarian it Italian lt Lithuanian lv Latvian mk Macedonian nl Dutch no Norwegian pl Polish ro Romanian sk Slovak sr Serbian sv Swedish uk Ukrainian"
_OTHER_KEYMAPS="be Belarusian bg Bulgarian br Brazil ca Canada cz Czech dk Danish et Estonian fi Finnish gr Greek hu Hungarian it Italian lt Lithuanian lv Latvian mk Macedonian nl Dutch no Norwegian pl Polish ro Romanian ru Russian sk Slovak sr Serbian sv Swedish uk Ukrainian"
_CANCEL=""
#shellcheck disable=SC2086
_dialog --menu "Select A Keymap Region:" 13 30 7 ${_KEYMAPS} 2>${_ANSWER} || _CANCEL="1"

View file

@ -35,11 +35,17 @@ _do_locale() {
_set_locale() {
_LOCALE=""
_LOCALES="en_US English de_DE German es_ES Spanish fr_FR French pt_PT Portuguese"
_LOCALES="en_US English de_DE German es_ES Spanish fr_FR French pt_PT Portuguese OTHER Other"
_OTHER_LOCALES="be_BY Belarusian bg_BG Bulgarian cs_CZ Czech da_DK Danish fi_FI Finnish el_GR Greek hu_HU Hungarian it_IT Italian lt_LT Lithuanian lv_LV Latvian mk_MK Macedonian nl_NL Dutch nn_NO Norwegian pl_PL Polish ro_RO Romanian ru_RU Russian sk_SK Slovak sr_RS Serbian sv_SE Swedish uk_UA Ukrainian"
_CANCEL=""
#shellcheck disable=SC2086
_dialog --menu "Select A System Wide Locale:" 12 35 5 ${_LOCALES} 2>${_ANSWER} || _abort
_LOCALE=$(cat ${_ANSWER})
if [[ "${_LOCALE}" == "OTHER" ]]; then
#shellcheck disable=SC2086
_dialog --menu "Select A System Wide Locale:" 18 30 12 ${_OTHER_KEYMAPS} 2>${_ANSWER} || abort
_LOCALE=$(cat ${_ANSWER})
fi
if [[ -n ${_LOCALE} ]]; then
_dialog --yesno "Do you want to use ${_LOCALE}.UTF-8 as System Wide Locale?" 5 60 || _LOCALE=""
fi

View file

@ -65,8 +65,10 @@ _clean_container() {
rm -r "${1}"/usr/share/{aclocal,applications,audit,awk,common-lisp,emacs,et,fish,gdb,gettext,gettext-[0-9]*,glib-[0-9]*,gnupg,gtk-doc,iana-etc,icons,icu,keyutils,libalpm,libgpg-error,makepkg-template,misc,mkinitcpio,pixmaps,pkgconfig,screen,smartmontools,ss,tabset,vala,xml,zoneinfo-leaps,man,doc,info,xtables}
rm -r "${1}"/usr/lib/{audit,awk,binfmt.d,cmake,dracut,e2fsprogs,engines-[0-9]*,environment.d,gawk,getconf,gettext,girepository-[0-9]*,glib-[0-9]*,gnupg,gssproxy,icu,krb5,ldscripts,libnl,pkgconfig,python[0-9]*,rsync,sasl2,siconv,tar,xfsprogs,xtables}
# locale cleaning
find ${1}/usr/share/locale/ -mindepth 2 ! -path '*/de/*' ! -path '*/en/*' ! -path '*/fr/*' ! -path '*/es/*' \
! -path '*/pt/*' -delete &>/dev/null
find ${1}/usr/share/locale/ -mindepth 2 ! -path '*/be/*' ! -path '*/bg/*' ! -path '*/cs/*' ! -path '*/da/*' ! -path '*/de/*' \
! -path '*/en/*' ! -path '*/el/*' ! -path '*/es/*' ! -path '*/fi/*' ! -path '*/fr/*' ! -path '*/hu/*' ! -path '*/it/*' \
! -path '*/lt/*' ! -path '*/lv/*' ! -path '*/mk/*' ! -path '*/nl/*' ! -path '*/nn/*' ! -path '*/pl/*' ! -path '*/pt/*' \
! -path '*/ro/*' ! -path '*/ru/*' ! -path '*/sk/*' ! -path '*/sr/*' ! -path '*/sv/*' ! -path '*/uk/*' -delete &>/dev/null
find ${1}/usr/share/i18n/charmaps ! -name 'UTF-8.gz' -delete &>/dev/null
fi
}

View file

@ -299,14 +299,24 @@ _prepare_graphic() {
done
# install firefox langpacks
if [[ "${_STANDARD_BROWSER}" == "firefox" ]]; then
pacman -S firefox-i18n-{de,en-us,fr,es-es,pt-pt} --noconfirm &>/dev/null || exit 1
for i in be bg cs da de el fi fr hu it lt lv mk nl nn pl ro ru sk sr uk; do
grep -q ${i} /etc/locale.conf && pacman -S firefox-i18n-${i} --noconfirm &>/dev/null || exit 1
done
grep -q en_US && pacman -S firefox-i18n-en-us --noconfirm &>/dev/null || exit 1
grep -q es_ES && pacman -S firefox-i18n-es-es --noconfirm &>/dev/null || exit 1
grep -q pt_PT && pacman -S firefox-i18n-pt-pt --noconfirm &>/dev/null || exit 1
grep -q sv_SE && pacman -S firefox-i18n-sv-se --noconfirm &>/dev/null || exit 1
fi
if [[ ! -e "/.full_system" ]]; then
echo "Removing not used icons..."
rm -rf /usr/share/icons/breeze-dark
echo "Cleanup locale and i18n..."
find /usr/share/locale/ -mindepth 2 ! -path '*/de/*' ! -path '*/en/*' \
! -path '*/fr/*' ! -path '*/es/*' ! -path '*/pt/*' -delete &>/dev/null
find ${1}/usr/share/locale/ -mindepth 2 ! -path '*/be/*' ! -path '*/bg/*' ! -path '*/cs/*' \
! -path '*/da/*' ! -path '*/de/*' ! -path '*/en/*' ! -path '*/el/*' ! -path '*/es/*' \
! -path '*/fi/*' ! -path '*/fr/*' ! -path '*/hu/*' ! -path '*/it/*' ! -path '*/lt/*' \
! -path '*/lv/*' ! -path '*/mk/*' ! -path '*/nl/*' ! -path '*/nn/*' ! -path '*/pl/*' \
! -path '*/pt/*' ! -path '*/ro/*' ! -path '*/ru/*' ! -path '*/sk/*' ! -path '*/sr/*' \
! -path '*/sv/*' ! -path '*/uk/*' -delete &>/dev/null
find /usr/share/i18n/charmaps ! -name 'UTF-8.gz' -delete &>/dev/null
fi
systemd-sysusers >/dev/tty7 2>&1

View file

@ -62,7 +62,7 @@ build ()
### add locale support
map add_binary locale-gen localedef
add_file /etc/locale.gen
_LANG="en de es fr pt"
_LANG="be bg cs da de en el es fi fr hu it lt lv mk nl nn pl pt ro ru sk sr sv uk"
for i in ${_LANG}; do
add_full_dir /usr/share/locale/${i}
done