Skip to content

Commit

Permalink
Add localize function to scriptcontext
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaer committed May 2, 2015
1 parent 7d01537 commit 4389f4a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Scripts/scriptcontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,12 @@ def errorhandler():
replace the scriptcontext.errorhandler value
'''
return None


__executing_command = None
def localize(s, context_id=None):
if context_id is None or __executing_command is None:
return s
import Rhino
assembly = __executing_command.PlugIn.Assembly
return Rhino.UI.Localization.LocalizeString(s, assembly, context_id)

0 comments on commit 4389f4a

Please sign in to comment.