Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin...
[phpmyadmin.git] / scripts / lang-cleanup.sh
blobb09674f906194f706818588dc53c34dc25cf8804
1 #!/bin/sh
3 # $Id$
4 # vim: expandtab sw=4 ts=4 sts=4:
6 # Script for removing language selection from phpMyAdmin
8 if [ $# -lt 1 ] ; then
9 echo "Usage: lang-cleanup.sh type"
10 echo "Type can be one of:"
11 echo " all-languages - nothing will be done"
12 echo " english - no translations will be kept"
13 echo " langcode - keeps language"
14 echo
15 echo "Languages can be scpecified multiple times"
16 exit 1
19 # Expression for find
20 match=""
21 for type in "$@" ; do
22 case $type in
23 all-languages)
24 exit 0
26 english)
27 rm -rf po
28 rm -rf locale
29 exit 0
32 match="$match -and -not -name $type.po -and -not -path locale/$type/LC_MESSAGES/phpmyadmin.mo"
34 esac
35 done
37 # Delete unvanted languages
38 find po locale -type f $match -print0 | xargs -0r rm
40 # Delete empty directories
41 rmdir --ignore-fail-on-non-empty locale/*/*
42 rmdir --ignore-fail-on-non-empty locale/*