K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / share / locales /
server ip : 104.21.89.46

your ip : 172.70.80.63

H O M E


Filename/usr/share/locales/remove-language-pack
Size2.12 kb
Permissionrwxr-xr-x
Ownerroot : root
Create time27-Apr-2025 09:50
Last modified15-Feb-2014 02:34
Last accessed05-Jul-2025 21:00
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
#!/bin/sh -e

if [ -z "$1" ]; then
echo "Usage: $0 <language code> <class> [<version>]"
exit 0
fi

# Copied from locale-gen
normalize_locale() {
# Insert a leading x in case $1 begins with a dash
this_locale=x$1
charset=
if echo $this_locale | LC_ALL=C grep '\.' > /dev/null 2>&1; then
charset=$(echo $this_locale | sed -e 's/^x//' -e 's/.*\(\.[^@]*\).*/\1/' | LC_ALL=C tr '[A-Z]' '[a-z]' | LC_ALL=C sed -e 's/[^a-z0-9.]//g')
fi
modifier=
if echo $this_locale | LC_ALL=C grep '@' > /dev/null 2>&1; then
modifier=$(echo $this_locale | sed -e 's/^x//' -e 's/.*\(@[^.]*\).*/\1/')
fi
main=$(echo $this_locale | sed -e 's/^x//' -e 's/[.@].*//')
echo $main$charset$modifier
}

get_supported_local_normalized() {
[ -e /var/lib/locales/supported.d/local ] || return
sort -u /var/lib/locales/supported.d/local | while read locale charset; do
case $locale in
\#*) continue ;;
"") continue ;;
esac
normalize_locale "$locale"
done
}

remove_locale() {
this_locale=$(normalize_locale "$1")
if ! echo "$supported_local_normalized" | fgrep -qx "$this_locale"; then
if [ -e /usr/lib/locale/locale-archive ]; then
localedef --delete-from-archive "$this_locale"
else
rm -rf "/usr/lib/locale/$1"
rm -rf "/usr/lib/locale/$this_locale"
fi
fi
}

# remove binary locales
# do nothing for gnome/kde
if [ -z "$2" ]; then
# do not remove locales if we merely remove language-support-* without
# removing language-pack-*
if [ ! -e /var/lib/locales/supported.d/$1 ]; then
supported_local_normalized="$(get_supported_local_normalized)"
if [ "$1" = 'zh-hans' ]; then
remove_locale zh_CN.utf8
remove_locale zh_SG.utf8
elif [ "$1" = 'zh-hant' ]; then
remove_locale zh_HK.utf8
remove_locale zh_TW.utf8
else
if [ -e /usr/lib/locale/locale-archive ]; then
for l in $(localedef --list-archive|grep "^$1[._@]"); do
remove_locale "$l"
done
else
for dir in /usr/lib/locale/$1 /usr/lib/locale/$1[._@]*; do
remove_locale "${dir##*/}"
done
fi
fi
fi
fi

# ensure that .desktop caches are up to date
dpkg-trigger gmenucache || true