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