Browse Source

Part of the OSX top menu was not translated.

Fixed by changing method of waiting for transated texts in SABnzbdDelegate.py.
Remove obsolete SVN update script.
tags/0.6.0
ShyPike 14 years ago
parent
commit
df9c48bd4a
  1. 7
      SABnzbdDelegate.py
  2. 51
      osx/resources/update
  3. 5
      sabnzbd/api.py

7
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

51
osx/resources/update

@ -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"

5
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:

Loading…
Cancel
Save