cog/Scripts/load_localization.sh

31 lines
1.1 KiB
Bash
Executable File

language=$1
if [ $language = "English" ]; then
echo "You cannot load English."
exit 1
fi
if ! [ -d Localizations/$language ]; then
echo "You do not have that language available."
exit 1
fi
if ! [ -d $language.lproj ]; then
mkdir $language.lproj
fi
if ! [ -d Prferences/General/$language.lproj ]; then
mkdir Preferences/General/$language.lproj
fi
nibtool -d Localizations/$language/MainUI.strings English.lproj/MainMenu.nib -W $language.lproj/MainMenu.nib
nibtool -d Localizations/$language/OpenURLPanel.strings English.lproj/OpenURLPanel.nib -W $language.lproj/OpenURLPanel.nib
nibtool -d Localizations/$language/PreferencesUI.strings Preferences/General/English.lproj/Preferences.nib -W Preferences/General/$language.lproj/Preferences.nib
cp Localizations/$language/MainProgram.strings $language.lproj/Localizable.strings
cp Localizations/$language/PreferencesProgram.strings Preferences/General/$language.lproj/Localizable.strings
cp Localizations/$language/Credits.html $language.lproj/Credits.html
cp -r English.lproj/Help $language.lproj/
cp Localizations/$language/help.html $language.lproj/Help/index.html