File indexing completed on 2021-12-21 12:18:00

0001 #!/bin/sh
0002 # Script to add a new language to khangman
0003 
0004 # Check parameters
0005 if test $# = 0 || test $# -gt 1 || test $1 = "--help" ; then
0006   echo "usage: add_language <language_code>"
0007   exit
0008 fi
0009 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.
0010 
0011 The script will carry on, please just do not commit the files. Please NEVER commit in a BRANCH."
0012 
0013 # Check for valid language code
0014 all_langs=$KDEDIR/share/locale/all_languages
0015 if test -e $all_langs ; then
0016   grep -q "^\[$1\]$" $all_langs
0017   if test $? != 0 ; then
0018     echo "add_language: error: \"$1\" is not a valid language code"
0019     exit
0020   fi
0021 fi
0022 
0023 # Set up variables
0024 code=$1
0025 dir=khangman/data
0026 lang=$dir/$code
0027 en=$dir/en
0028 
0029 # Check if directory already exists
0030 if test -e $lang ; then
0031   echo "add_language: error: \"$1\" already exists"
0032   exit
0033 fi
0034 
0035 # Create the directory and copy files to it
0036 mkdir $lang
0037 cp $dir/en/*.txt $lang
0038 sed -e "s/\/en/\/$code/" $en/Makefile.am > $lang/Makefile.am
0039 touch $dir/Makefile.am
0040 
0041 # Tell user what to do
0042 echo "The language $code has been successfully added!"
0043 echo ""
0044 echo "Please edit the following files and translate the english words and english hints:"
0045 ls $lang/*.txt
0046 echo ""
0047 echo "The files now use the kvtml format."
0048 echo "See https://edu.kde.org/khangman/add_language.php for more information."
0049 echo "Thanks a lot for your contribution!"