News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

get_lang_files.sh with curl

Started by Ashley, March 19, 2012, 11:27:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ashley

Since the Mac doesn't come with wget, but does come with curl, a version of this script which uses the latter.

#!/bin/sh
#
# script to fetch language files (using curl)
#
cd simutrans/text
# get the translations for basis
# The first file is longer, but only because it contains SQL error messages
# - discard it after complete download (although parsing it would give us the archive's name):

curl -d "version=0&choice=all&submit=Export%21" http://simutrans-germany.com/translator/script/main.php?page=wrap > /dev/null || {
  echo "Error: generating file language_pack-Base+texts.zip failed (curl returned $?)" >&2;
  exit 3;
}
curl http://simutrans-germany.com/translator/data/tab/language_pack-Base+texts.zip > language_pack-Base+texts.zip || {
  echo "Error: download of file language_pack-Base+texts.zip failed (curl returned $?)" >&2
  rm -f "language_pack-Base+texts.zip"
  exit 4
}
unzip -tv "language_pack-Base+texts.zip" || {
   echo "Error: file language_pack-Base+texts.zip seems to be defective" >&2
   rm -f "language_pack-Base+texts.zip"
   exit 5
}
unzip "language_pack-Base+texts.zip"
#rm language_pack-Base+texts.zip
# remove Chris English (may become british ... )
rm ce.tab
cd ../..
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

prissi

mingw comes without curl but wget out of the box (as any GNU supported stuff). Either we need another switch or another script for macuser.

Ashley

Well that's why I posted this script, for Mac users to use.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

Ashley

Here's a version which will use whichever is available on the system.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

prissi

Thanks Timothy for the best solution!