summaryrefslogtreecommitdiffstats
path: root/khangman/add_language
blob: 19f4954c635ce7f97c111599b6b18d8605f0f47e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
# Script to add a new language to khangman

# Check parameters
if test $# = 0 || test $# -gt 1 || test $1 = "--help" ; then
  echo "usage: add_language <language_code>"
  exit
fi
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.

The script will carry on, please just do not commit the files. Please NEVER commit in a BRANCH."

# Check for valid language code
all_langs=$TDEDIR/share/locale/all_languages
if test -e $all_langs ; then
  grep -q "^\[$1\]$" $all_langs
  if test $? != 0 ; then
    echo "add_language: error: \"$1\" is not a valid language code"
    exit
  fi
fi

# Set up variables
code=$1
dir=khangman/data
lang=$dir/$code
en=$dir/en

# Check if directory already exists
if test -e $lang ; then
  echo "add_language: error: \"$1\" already exists"
  exit
fi

# Create the directory and copy files to it
mkdir $lang
cp $dir/en/*.txt $lang
sed -e "s/\/en/\/$code/" $en/Makefile.am > $lang/Makefile.am
touch $dir/Makefile.am

# Tell user what to do
echo "The language $code has been successfully added!"
echo ""
echo "Please edit the following files and translate the english words and english hints:"
ls $lang/*.txt
echo ""
echo "The files now use the kvtml format."
echo "See http://edu.kde.org/khangman/add_language.php for more information."
echo "Thanks a lot for your contribution!"