title: i18n for Python Scripts in Zope (restricted python)
body: <p>Here is what I'm trying to do: I want to enable i18n support for my zmi python scripts in a gettext compatible way, with the '_'-function.</p>
  
  <p>Here is what I did so far. In a module of my Zope Product, I run:</p>
  
  <pre><code>import gettext, __builtin__    
  t = gettext.translation('myDomain', LOCALESPATH, languages=['de'], fallback=True)
  __builtin__._ = t.gettext
  </code></pre>
  
  <p>Calling _ in an (unrestricted) External Method works fine, it returns the translation, as expected.</p>
  
  <pre><code>def testI18n():
    return _('text to be translated')
  </code></pre>
  
  <p>If I try this in a Zope "Script (Python)" which uses RestrictedPython to execute its code, I get a NameError: "global name '_' is not defined".</p>
  
  <p>This is my workaround:</p>
  
  <pre><code>from myModule import myTranslator as _
  print _('text to be translated')
  return printed
  </code></pre>
  
  <p>which works well (myModule has to be allowed for Python Scripts, of course). </p>
  
  <p>But I'm curious if there is a way to have _ as a builtin function in restricted python scripts, and if it is possible to extend the safe_builtins in RestrictedPython.Guards.</p>