| 1 | #!/bin/sh |
| 2 | set -e |
| 3 | |
| 4 | domain=drascula |
| 5 | |
| 6 | if [ $(which gettext) ]; then |
| 7 | gettext="gettext --domain=$domain -s --" |
| 8 | else |
| 9 | gettext=echo |
| 10 | fi |
| 11 | |
| 12 | usage() |
| 13 | { |
| 14 | $gettext "Usage: drascula [OPTION]" |
| 15 | $gettext "Start Drascula: The Vampire Strikes Back" |
| 16 | echo |
| 17 | $gettext "--help display this help and exit" |
| 18 | $gettext "--version display version information and exit" |
| 19 | $gettext "--en play the English version of Drascula" |
| 20 | $gettext "--de play the German version of Drascula" |
| 21 | $gettext "--fr play the French version of Drascula" |
| 22 | $gettext "--it play the Italian version of Drascula" |
| 23 | $gettext "--es play the Spanish version of Drascula" |
| 24 | } |
| 25 | |
| 26 | version() |
| 27 | { |
| 28 | $gettext "Drascula: The Vampire Strikes Back 1.0" |
| 29 | $gettext "Copyright (C) Alcachofa Soft S.L" |
| 30 | $gettext "ScummVM engine Copyright (C) The ScummVM Team" |
| 31 | } |
| 32 | |
| 33 | if [ "$#" -gt "1" ]; then |
| 34 | usage |
| 35 | exit 1 |
| 36 | elif [ "$#" -lt "1" ]; then |
| 37 | GAME_LANG=$( |
| 38 | echo $LANGUAGE $LANG en | tr ': ' '\n' | cut -c1-2 | while read lang; |
| 39 | do |
| 40 | if [ "$lang" = "en" \ |
| 41 | -o \( "$lang" = "de" -a -f /usr/share/scummvm/drascula/de/drascula.dat \) \ |
| 42 | -o \( "$lang" = "fr" -a -f /usr/share/scummvm/drascula/fr/drascula.dat \) \ |
| 43 | -o \( "$lang" = "it" -a -f /usr/share/scummvm/drascula/it/drascula.dat \) \ |
| 44 | -o \( "$lang" = "es" -a -f /usr/share/scummvm/drascula/es/drascula.dat \) ] |
| 45 | then |
| 46 | echo $lang |
| 47 | break |
| 48 | fi |
| 49 | done |
| 50 | ) |
| 51 | if [ "$GAME_LANG" = "en" ]; then |
| 52 | /usr/games/scummvm -m 128 -p /usr/share/scummvm/drascula/en drascula |
| 53 | else |
| 54 | /usr/games/scummvm -q $GAME_LANG -n -m 128 -p /usr/share/scummvm/drascula/$GAME_LANG drascula |
| 55 | fi |
| 56 | else |
| 57 | case "$1" in |
| 58 | --help) |
| 59 | usage |
| 60 | ;; |
| 61 | --version) |
| 62 | version |
| 63 | ;; |
| 64 | --en) |
| 65 | /usr/games/scummvm -m 128 -p /usr/share/scummvm/drascula/en drascula |
| 66 | ;; |
| 67 | --de) |
| 68 | if [ -f /usr/share/scummvm/drascula/de/drascula.dat ] |
| 69 | then |
| 70 | /usr/games/scummvm -q de -n -m 128 -p /usr/share/scummvm/drascula/de drascula |
| 71 | else |
| 72 | $gettext "Please install the drascula-german package." |
| 73 | fi |
| 74 | ;; |
| 75 | |
| 76 | --fr) |
| 77 | if [ -f /usr/share/scummvm/drascula/fr/drascula.dat ] |
| 78 | then |
| 79 | /usr/games/scummvm -q fr -n -m 128 -p /usr/share/scummvm/drascula/fr drascula |
| 80 | else |
| 81 | $gettext "Please install the drascula-french package." |
| 82 | fi |
| 83 | ;; |
| 84 | --it) |
| 85 | if [ -f /usr/share/scummvm/drascula/it/drascula.dat ] |
| 86 | then |
| 87 | /usr/games/scummvm -q it -n -m 128 -p /usr/share/scummvm/drascula/it drascula |
| 88 | else |
| 89 | $gettext "Please install the drascula-italian package." |
| 90 | fi |
| 91 | ;; |
| 92 | --es) |
| 93 | if [ -f /usr/share/scummvm/drascula/es/drascula.dat ] |
| 94 | then |
| 95 | /usr/games/scummvm -q es -n -m 128 -p /usr/share/scummvm/drascula/es drascula |
| 96 | else |
| 97 | $gettext "Please install the drascula-spanish package." |
| 98 | fi |
| 99 | ;; |
| 100 | *) |
| 101 | usage |
| 102 | exit 1 |
| 103 | ;; |
| 104 | esac |
| 105 | fi |
| 106 | |
| 107 | exit 0 |