Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Extract installer messages to separate localized script

  • Loading branch information...
commit b1c81da101c86dbfba80fdc1631cd2d0314fcf0d 1 parent 72e993d
@deadprogram deadprogram authored
Showing with 45 additions and 15 deletions.
  1. +11 −1 build_installer.sh
  2. +15 −0 i18n/en.sh
  3. +4 −4 install_gems.sh
  4. +15 −10 installer.sh
View
12 build_installer.sh
@@ -10,6 +10,10 @@ cleanup() {
then
rm -r "resources/KidsRuby.app"
fi
+ if [ -d "resources/i18n" ]
+ then
+ rm -r "resources/i18n"
+ fi
if [ -d "build/KidsRubyInstaller.app" ]
then
rm -r "build/KidsRubyInstaller.app"
@@ -34,8 +38,13 @@ copy_scripts() {
cp kidsirb.sh resources
}
+copy_i18n() {
+ mkdir resources/i18n
+ cp i18n/* resources/i18n
+}
+
build_installer() {
- /usr/local/bin/platypus -AR -l -i 'kidsruby.icns' -a 'KidsRuby Installer for OSX' -o 'Progress Bar' -p '/bin/sh' -u 'The Hybrid Group + Friends' -V "$1" -I 'org.kidsruby.installer' -f 'resources/git-1.7.6-i386-snow-leopard.dmg' -f 'resources/ruby-1.9.2-p290.universal.tar.gz' -f 'resources/yaml-0.1.4.universal.tar.gz' -f 'resources/qt-mac-opensource-4.7.3.dmg' -f 'resources/qtbindings-4.7.3-universal-darwin-10.gem' -f 'resources/kidsruby.tar.gz' -f 'resources/kidsirb.sh' -f 'resources/KidsRuby.app.tar.gz' -f "resources/gosu-0.7.36.2-universal-darwin.gem" -f "resources/htmlentities-4.3.0.gem" -f "resources/rubywarrior-0.1.2.gem" -f "resources/install_gems.sh" -g '#000000' -b '#ffffff' -c 'installer.sh' 'build/KidsRubyInstaller.app'
+ /usr/local/bin/platypus -AR -l -i 'kidsruby.icns' -a 'KidsRuby Installer for OSX' -o 'Progress Bar' -p '/bin/sh' -u 'The Hybrid Group + Friends' -V "$1" -I 'org.kidsruby.installer' -f 'resources/git-1.7.6-i386-snow-leopard.dmg' -f 'resources/ruby-1.9.2-p290.universal.tar.gz' -f 'resources/yaml-0.1.4.universal.tar.gz' -f 'resources/qt-mac-opensource-4.7.3.dmg' -f 'resources/qtbindings-4.7.3-universal-darwin-10.gem' -f 'resources/kidsruby.tar.gz' -f 'resources/kidsirb.sh' -f 'resources/KidsRuby.app.tar.gz' -f "resources/gosu-0.7.36.2-universal-darwin.gem" -f "resources/htmlentities-4.3.0.gem" -f "resources/rubywarrior-0.1.2.gem" -f "resources/install_gems.sh" -f "resources/i18n/en.sh" -g '#000000' -b '#ffffff' -c 'installer.sh' 'build/KidsRubyInstaller.app'
}
build_dmg() {
@@ -48,5 +57,6 @@ build_dmg() {
cleanup
build_launcher
copy_scripts
+copy_i18n
build_installer
build_dmg
View
15 i18n/en.sh
@@ -0,0 +1,15 @@
+export KIDSRUBY_START_INSTALL="Starting KidsRuby install..."
+export KIDSRUBY_CREATE_INSTALL_DIRECTORY="Creating installation directory..."
+export KIDSRUBY_CREATE_CODE_DIRECTORY="Creating code directory..."
+export KIDSRUBY_INSTALLING_QT="Installing Qt..."
+export KIDSRUBY_INSTALLING_GIT="Installing git..."
+export KIDSRUBY_INSTALLING_RUBY="Installing Ruby 1.9.2..."
+export KIDSRUBY_INSTALLING_EDITOR="Installing KidsRuby editor..."
+export KIDSRUBY_INSTALLING_COMMANDS="Installing commands..."
+export KIDSRUBY_END_INSTALL="KidsRuby installation complete. Have fun!"
+
+export KIDSRUBY_INSTALLING_GEMS="Installing gems..."
+export KIDSRUBY_INSTALLING_QTBINDINGS="Installing qtbindings gem..."
+export KIDSRUBY_INSTALLING_GOSU="Installing gosu gem.."
+
+export KIDSRUBY_ERROR_NOT_SUPPORTED="Sorry, KidsRuby is not currently supported on your operating system."
View
8 install_gems.sh
@@ -2,18 +2,18 @@
GEMPATH=$1/ruby/bin/gem
install_gems() {
- echo "Installing gems..."
+ echo $KIDSRUBY_INSTALLING_GEMS
${GEMPATH} install htmlentities-4.3.0.gem 2>&1
${GEMPATH} install rubywarrior-0.1.2.gem 2>&1
}
install_qtbindings() {
- echo "Installing qtbindings gem..."
- "${GEMPATH}" install qtbindings-4.7.3-universal-darwin-10.gem 2>&1
+ echo $KIDSRUBY_INSTALLING_QTBINDINGS
+ ${GEMPATH} install qtbindings-4.7.3-universal-darwin-10.gem 2>&1
}
install_gosu() {
- echo "Installing gosu gem.."
+ echo $KIDSRUBY_INSTALLING_GOSU
${GEMPATH} install gosu-0.7.36.2-universal-darwin.gem 2>&1
}
View
25 installer.sh
@@ -2,6 +2,11 @@
INSTALLDIR="/Applications/KidsRuby"
CODEDIR="/usr/local/kidsruby"
+# i18n
+SHORTLANG=$(defaults read .GlobalPreferences AppleLanguages | tr -d [:space:] | cut -c2-3)
+KIDSRUBY_INSTALLER=$SHORTLANG".sh"
+source $KIDSRUBY_INSTALLER
+
# determine OSX version
TIGER=4
LEOPARD=5
@@ -9,19 +14,19 @@ SNOW_LEOPARD=6
LION=7
osx_version=$(sw_vers -productVersion | awk 'BEGIN {FS="."}{print $2}')
if [ $osx_version -eq $LEOPARD -o $osx_version -eq $SNOW_LEOPARD -o $osx_version -eq $LION ]; then
- echo "Starting KidsRuby install..."
+ echo $KIDSRUBY_START_INSTALL
else
- echo "Sorry, KidsRuby is not currently supported on your operating system."
+ echo $KIDSRUBY_ERROR_NOT_SUPPORTED
exit
fi
create_install_dir() {
- echo "Creating installation directory..."
+ echo $KIDSRUBY_CREATE_INSTALL_DIRECTORY
if [ ! -d "$INSTALLDIR" ]
then
mkdir "$INSTALLDIR"
fi
- echo "Creating code directory..."
+ echo $KIDSRUBY_CREATE_CODE_DIRECTORY
if [ ! -d "$CODEDIR" ]
then
mkdir "$CODEDIR"
@@ -34,21 +39,21 @@ create_install_dir() {
}
install_qt() {
- echo "Installing Qt..."
+ echo $KIDSRUBY_INSTALLING_QT
hdiutil attach qt-mac-opensource-4.7.3.dmg
/usr/sbin/installer -verbose -pkg "/Volumes/Qt 4.7.3/Qt.mpkg" -target /
hdiutil detach "/Volumes/Qt 4.7.3"
}
install_git() {
- echo "Installing git..."
+ echo $KIDSRUBY_INSTALLING_GIT
hdiutil attach git-1.7.6-i386-snow-leopard.dmg
/usr/sbin/installer -verbose -pkg "/Volumes/Git 1.7.6 i386 Snow Leopard/git-1.7.6-i386-snow-leopard.pkg" -target /
hdiutil detach "/Volumes/Git 1.7.6 i386 Snow Leopard"
}
install_ruby() {
- echo "Installing Ruby 1.9.2..."
+ echo $KIDSRUBY_INSTALLING_RUBY
tar -xvzf ruby-1.9.2-p290.universal.tar.gz -C "$CODEDIR"
export PATH="$CODEDIR/ruby/bin:$PATH"
chmod -R a+rw "$CODEDIR"
@@ -69,12 +74,12 @@ symlink_qtbindings() {
}
install_kidsruby() {
- echo "Installing kidsruby editor..."
+ echo $KIDSRUBY_INSTALLING_EDITOR
tar -xvzf kidsruby.tar.gz -C "$INSTALLDIR"
}
install_commands() {
- echo "Installing commands..."
+ echo $KIDSRUBY_INSTALLING_COMMANDS
tar -xvzf KidsRuby.app.tar.gz -C "$INSTALLDIR"
cp kidsirb.sh "$INSTALLDIR"
}
@@ -89,4 +94,4 @@ symlink_qtbindings
install_kidsruby
install_commands
-echo "KidsRuby installation complete. Have fun!"
+echo $KIDSRUBY_END_INSTALL
Please sign in to comment.
Something went wrong with that request. Please try again.