Browse Source

fix_locales

main
pvincent 5 days ago
parent
commit
46e39d0c4c
  1. 22
      lib/initiate.bash

22
lib/initiate.bash

@ -230,6 +230,27 @@ function apply_mode {
fi
}
function fix_locales {
local locale should_regenerate=false
declare -a expected_locales=(en_US.utf8 es_ES.utf8 fr_FR.utf8)
declare -A found_locales
for locale in "${expected_locales[@]}"; do found_locales["$locale"]=false; done
mapfile -t gen_locales < <(sudo locale -a)
for locale in "${gen_locales[@]}"; do
if [[ -v found_locales["$locale"] ]]; then found_locales["$locale"]=true; fi
done
for locale in "${!found_locales[@]}"; do
if [[ ${found_locales[$locale]} == 'false' ]]; then
echo "Locale: $locale missing"
sudo sed -i "s/^# *\(${locale:0:5}\.UTF-8\)/\1/" /etc/locale.gen
should_regenerate=true
fi
done
if [[ "$should_regenerate" == 'true' ]]; then
sudo locale-gen
fi
}
# MAIN
source "$MIAOU_BASH_DIR"/lib/functions.bash
@ -239,6 +260,7 @@ fetch_distro_like
install_required_packages
fix_users_bashrc
fix_terminfo_ghostty
fix_locales
ghostty_global_config
link_config_files
link_miaou_bash

Loading…
Cancel
Save