Skip to content

Commit

Permalink
RF: finishing touches (hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremygray committed Sep 12, 2014
1 parent dd7619c commit 9216a11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions psychopy/app/builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import experiment, components

try:
_ # is the app-global text translation function defined?
_translate # is the app-global text translation function defined?
except NameError:
from psychopy.app import localization

Expand Down Expand Up @@ -2321,7 +2321,7 @@ def addStartStopCtrls(self,remaining, parent, sizer, currRow):
labelEstim = wx.StaticText(parent,-1,_translate('Expected start (s)'), style=wx.ALIGN_CENTER)
labelEstim.SetForegroundColour('gray')
#the method to be used to interpret this start/stop
self.startTypeCtrl = wx.Choice(parent, choices=map(_,startTypeParam.allowedVals))
self.startTypeCtrl = wx.Choice(parent, choices=map(_translate,startTypeParam.allowedVals))
self.startTypeCtrl.SetStringSelection(_translate(startTypeParam.val))
self.startTypeCtrl.SetToolTipString(self.params['startType'].hint)
#the value to be used as the start/stop
Expand Down Expand Up @@ -2356,7 +2356,7 @@ def addStartStopCtrls(self,remaining, parent, sizer, currRow):
labelEstim = wx.StaticText(parent,-1,_translate('Expected duration (s)'), style=wx.ALIGN_CENTER)
labelEstim.SetForegroundColour('gray')
#the method to be used to interpret this start/stop
self.stopTypeCtrl = wx.Choice(parent, choices=map(_,stopTypeParam.allowedVals))
self.stopTypeCtrl = wx.Choice(parent, choices=map(_translate,stopTypeParam.allowedVals))
self.stopTypeCtrl.SetStringSelection(_translate(stopTypeParam.val))
self.stopTypeCtrl.SetToolTipString(self.params['stopType'].hint)
#the value to be used as the start/stop
Expand Down
6 changes: 5 additions & 1 deletion psychopy/app/localization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ def getID(lang=None):
trans = gettext.NullTranslations()
trans.install(unicode=True)

__builtins__['_translate'] = _ # stash a reference
# to avoid a crash, PsychoPy app uses a nonstandard name _translate instead of _
# seems like a var in a dependency is named _, clobbering _ as global translation:
__builtins__['_translate'] = _
del(__builtins__['_']) # idea: force psychopy code to use _translate


#__builtins__['_'] = wx.GetTranslation
# this seems to have no effect, needs more investigation:
Expand Down

0 comments on commit 9216a11

Please sign in to comment.