Commit c3817d0a authored by Thomas Goirand's avatar Thomas Goirand

Fix message when a local is missing.

parent a5252230
......@@ -52,39 +52,10 @@ locale_warn() {
printf " The unknown environment variables are:\n %s\n" "$bad_kv"
printf " This can affect your user experience significantly, including the\n"
printf " ability to manage packages. You may install the locales by running:\n\n"
local bad invalid="" to_gen="" sfile="/usr/share/i18n/SUPPORTED"
local pkgs=""
if [ -e "$sfile" ]; then
for bad in ${bad_lcs}; do
grep -q -i "${bad}" "$sfile" &&
to_gen="${to_gen} ${bad}" ||
invalid="${invalid} ${bad}"
done
else
printf " sudo apt-get install locales\n"
to_gen=$bad_lcs
fi
to_gen=${to_gen# }
local pkgs=""
for bad in ${to_gen}; do
pkgs="${pkgs} language-pack-${bad%%_*}"
done
pkgs=${pkgs# }
if [ -n "${pkgs}" ]; then
printf " sudo apt-get install ${pkgs# }\n"
printf " or\n"
printf " sudo locale-gen ${to_gen# }\n"
printf "\n"
fi
for bad in ${invalid}; do
printf "WARNING: '${bad}' is an invalid locale\n"
done
printf "To see all available language packs, run:\n"
printf " apt-cache search \"^language-pack-[a-z][a-z]$\"\n"
printf " sudo dpkg-reconfigure locales\n\n"
printf " and select the missing language. Alternatively, you can install the\n"
printf " locales-all package:\n\n"
printf " sudo apt-get install locales-all\n\n"
printf "To disable this message for all users, run:\n"
printf " sudo touch /var/lib/cloud/instance/locale-check.skip\n"
printf "_____________________________________________________________________\n\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment