diff --git a/SABnzbdDelegate.py b/SABnzbdDelegate.py index bcda9ee..c2c7ec6 100755 --- a/SABnzbdDelegate.py +++ b/SABnzbdDelegate.py @@ -46,6 +46,7 @@ import sabnzbd.dirscanner as dirscanner from sabnzbd.bpsmeter import BPSMeter from sabnzbd.newzbin import Bookmarks from sabnzbd.database import get_history_handle +from sabnzbd.api import check_trans status_icons = {'idle':'../Resources/sab_idle.png','pause':'../Resources/sab_pause.png','clicked':'../Resources/sab_clicked.png'} start_time = NSDate.date() @@ -86,11 +87,9 @@ class SABnzbdDelegate(NSObject): #Wait for SABnzbd Initialisation #cherrypy.engine.wait(cherrypy.process.wspbus.states.STARTED) - if (debug == 1) : NSLog("[osx] yes=%s" % (T('Yes'))) - - while T('Yes')[0:1]=="#": + # Wait for translated texts to be loaded + while not check_trans(): time.sleep(0.5) - if (debug == 1) : NSLog("[osx] yes=%s" % (T('Yes'))) if (debug == 1) : NSLog("[osx] language file not loaded, waiting") #Variables diff --git a/osx/resources/update b/osx/resources/update deleted file mode 100755 index 41c9cc4..0000000 --- a/osx/resources/update +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -#SABnzbd OSX svn updater -# Usage copy this script in SABnzbd.app/Contents/Resources folder -# and launch it to get last SABnzbd revision -# THIS WILL ONLY WORK IF NO NEW MODULES HAVE BEEN ADDED TO SABnzbd -# THIS WILL NOT WORK ON 0.4.X - -#Variables -DIR_RESOURCES=`dirname $0` -DIR_TMP=$DIR_RESOURCES/tmp - -echo "1/5 > Dir : $DIR_RESOURCES" - -if [ -d $DIR_TMP ]; then - `rm -rf $DIR_TMP` - echo " tmp directory deleted" -fi - -echo "2/5 > Exporting last svn revision..." -svn export http://svn2.assembla.com/svn/SABnzbd/branches/sabnzbd-0.5.x/ $DIR_TMP>/dev/null -SVN_REV=`svn info http://svn2.assembla.com/svn/SABnzbd/branches/sabnzbd-0.5.x/ | awk '$1 == "Revision:" {print $2}'` -echo " done." - -echo "3/5 > Cleaning up for OSX binary..." -cd $DIR_TMP -unzip cherrypy*.zip>/dev/null -rm -rf *.txt *.ico *.nsi *.zip *.tmpl PKG-INFO setup.py package.py Sample-*>/dev/null -rm -rd win>/dev/null -mv osx osx_tmp>/dev/null -mv osx_tmp/osx osx>/dev/null -mv osx_tmp/resources/* ./>/dev/null -rm -rf osx_tmp>/dev/null - -sed -e "s/trunk/0.5.0 (rev$SVN_REV)/g" -e "s/unknown/$SVN_REV/g" sabnzbd/version.py>sabnzbd/version_tmp.py -mv -f sabnzbd/version_tmp.py sabnzbd/version.py>/dev/null -defaults write $DIR_RESOURCES/../Info CFBundleShortVersionString -string "0.5.0 (rev$SVN_REV)" -defaults write $DIR_RESOURCES/../Info CFBundleVersion -string "0.5.0 (rev$SVN_REV)" - -echo " done." - -echo "4/5 > Installing update..." -cd .. -rm -rd sabnzbd interfaces/Concept interfaces/Classic interfaces/Mobile interfaces/Plush interfaces/smpl interfaces/wizard language osx MainMenu.nib cherrypy licenses>/dev/null -mv -f interfaces interfaces_tmp>/dev/null -mv -f tmp/* ./>/dev/null -cp -r interfaces_tmp/* interfaces/>/dev/null -rm -rf *tmp>/dev/null -echo " done." - -echo "5/5 > Update to rev $SVN_REV finished - Don't forget to restart SABnzbd !" -echo "if you have any problem http://forums.sabnzbd.org" \ No newline at end of file diff --git a/sabnzbd/api.py b/sabnzbd/api.py index 3761d9f..b4879af 100644 --- a/sabnzbd/api.py +++ b/sabnzbd/api.py @@ -1355,6 +1355,11 @@ def cache_skin_trans(): for txt in SKIN_TEXT: _SKIN_CACHE[txt] = Tx(SKIN_TEXT.get(txt, txt)) +def check_trans(): + """ Check whether language has been initialized + """ + global _SKIN_CACHE + return bool(_SKIN_CACHE) def build_header(prim): try: