moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / khangman / add_language
blob7f9e8da96cf8206712567d6ce08d9fbc275e2240
1 #!/bin/sh
2 # Script to add a new language to khangman
4 # Check parameters
5 if test $# = 0 || test $# -gt 1 || test $1 = "--help" ; then
6 echo "usage: add_language <language_code>"
7 exit
8 fi
9 echo "Please send your files tarred and zipped to annemarie.mahfouf@free.fr and note anything specific to your language such as special characters. Please add all special characters in a text file. Thanks a lot.
11 The script will carry on, please just do not commit the files. Please NEVER commit in a BRANCH."
13 # Check for valid language code
14 all_langs=$KDEDIR/share/locale/all_languages
15 if test -e $all_langs ; then
16 grep -q "^\[$1\]$" $all_langs
17 if test $? != 0 ; then
18 echo "add_language: error: \"$1\" is not a valid language code"
19 exit
23 # Set up variables
24 code=$1
25 dir=khangman/data
26 lang=$dir/$code
27 en=$dir/en
29 # Check if directory already exists
30 if test -e $lang ; then
31 echo "add_language: error: \"$1\" already exists"
32 exit
35 # Create the directory and copy files to it
36 mkdir $lang
37 cp $dir/en/*.txt $lang
38 sed -e "s/\/en/\/$code/" $en/Makefile.am > $lang/Makefile.am
39 touch $dir/Makefile.am
41 # Tell user what to do
42 echo "The language $code has been successfully added!"
43 echo ""
44 echo "Please edit the following files and translate the english words and english hints:"
45 ls $lang/*.txt
46 echo ""
47 echo "The files now use the kvtml format."
48 echo "See http://edu.kde.org/khangman/add_language.php for more information."
49 echo "Thanks a lot for your contribution!"