We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
IDE Mirrored for Right-to-Left Locales
Reproduction:
Search in windows for "locale" and click "date, time, and number format" (May be different if not on Windows 7).
Change the format to any RTL language (ex. Hebrew).
Open Psychopy IDE
Text and buttons are on the wrong side of the window. Input is backward as well.
![capture](https://user-images.githubusercontent.com/1297252/39575845-b2f3756c-4ee4-11e8-98d2-91621b721104.PNG)


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `psychopy/localization/__init__.py`
Content:
```
1 #!/usr/bin/env python2
2 # -*- coding: utf-8 -*-
3 
4 """Language localization for PsychoPy.
5 
6 Sets the locale value as a wx languageID (int) and initializes gettext
7 translation _translate():
8     from psychopy.app import localization
9 """
10 
11 # Part of the PsychoPy library
12 # Copyright (C) 2018 Jonathan Peirce
13 # Distributed under the terms of the GNU General Public License (GPL).
14 
15 # Author: Jeremy Gray, July 2014
16 
17 
18 import gettext
19 import os
20 import glob
21 import codecs
22 from psychopy import logging, prefs, constants
23 import wx
24 import locale as locale_pkg
25 
26 def setLocaleWX():
27     """Sets up the locale for the wx application. Only call this after the app
28     has been created and initialised (it is called by PsychoPyApp.OnInit())
29 
30     :return: wx.Locale object
31     """
32     # set locale for wx app (before splash screen):
33     encod = locale_pkg.getpreferredencoding(do_setlocale=False)
34     if locale.IsAvailable(languageID):
35         wxlocale = wx.Locale(languageID)
36     else:
37         wxlocale = wx.Locale(wx.LANGUAGE_DEFAULT)
38     # wx.Locale on Py2.7/wx3.0 seems to delete the preferred encoding (utf-8)
39     # Check if that happened and reinstate if needed.
40     if locale_pkg.getpreferredencoding(do_setlocale=False) == '':
41         locale_pkg.setlocale(locale_pkg.LC_ALL,
42                              "{}.{}".format(codeFromWxId[languageID], encod))
43     return wxlocale
44 
45 # Get a dict of locale aliases from wx.Locale() -- same cross-platform
46 # (Win 7, Mac 10.9)
47 # this DOESN'T need the app to be instantiated
48 locale = wx.Locale()
49 aliases = {u'English (U.S.)': 'en_US'}
50 # set defaults because locale.GetLanguageInfo(0) can return None on some
51 # systems:
52 wxIdFromCode = {'en_US': wx.LANGUAGE_DEFAULT}  # int: 0 default, 2-229
53 # used in directory names e.g. ja_JP; never JPN ala Windows
54 codeFromWxId = {wx.LANGUAGE_DEFAULT: 'en_US'}
55 for i in range(230):
56     info = locale.GetLanguageInfo(i)
57     if info:
58         # mix of forms: ja or ja_JP
59         aliases[info.Description] = info.CanonicalName
60         wxIdFromCode[info.CanonicalName] = i
61         codeFromWxId[i] = info.CanonicalName
62 
63 # read all known mappings cross-platform from a file:
64 # get windows 3-letter code (=val) from canonical form (=key); use only
65 # for setting locale (non-wx)
66 winmap = {'en_US': 'ENU'}
67 # descriptive name, if available; 5-letter code if not
68 locname = {'en_US': u'English (U.S.)'}
69 reverseMap = {u'English (U.S.)': 'en_US'}
70 mappings = os.path.join(os.path.dirname(__file__), 'mappings.txt')
71 for line in codecs.open(mappings, 'rU', 'utf8').readlines():
72     try:
73         # canonical, windows, name-with-spaces
74         can, win, name = line.strip().split(' ', 2)
75     except ValueError:
76         can, win = line.strip().split(' ', 1)
77         name = can
78     winmap[can] = win
79     locname[can] = name
80     reverseMap[name] = can
81 
82 # what are the available translations? available languages on the OS?
83 expr = os.path.join(os.path.dirname(__file__), '..', 'app', 'locale', '*')
84 available = sorted(map(os.path.basename, glob.glob(expr)))
85 sysAvail = [str(l) for l in codeFromWxId.values()  # installed language packs
86             if l and locale.IsAvailable(wxIdFromCode[l])]
87 
88 
89 def getID(lang=None):
90     """Get wx ID of language to use for translations:
91         `lang`, pref, or system default.
92 
93     `lang` is a 5 char `language_REGION`, eg ja_JP
94     """
95     if lang:
96         val = lang
97     else:
98         try:
99             val = prefs.app['locale']
100         except KeyError:
101             val = locale.GetLocale()  # wx.Locale, no encoding
102         if not val:
103             val = codeFromWxId[wx.LANGUAGE_DEFAULT]
104     try:
105         # todo: try to set wx.Locale here to language
106         language = wxIdFromCode[val]
107     except KeyError:
108         logging.error('locale %s not known to wx.Locale, using default' % val)
109         language = wx.LANGUAGE_DEFAULT
110 
111     return language, val
112 
113 languageID, lang = getID()
114 # use lang like this:
115 # import locale  -- the non-wx version of locale
116 #
117 # if sys.platform.startswith('win'):
118 #        v = winmap[val]
119 # else: v=val
120 # locale.setlocale(locale.LC_ALL, (v, 'UTF-8'))
121 
122 # ideally rewrite the following using wxlocale only:
123 path = os.path.join(os.path.dirname(__file__), '..', 'app',
124                     'locale', lang, 'LC_MESSAGE') + os.sep
125 mofile = os.path.join(path, 'messages.mo')
126 try:
127     logging.debug("Opening message catalog %s for locale %s" % (mofile, lang))
128     trans = gettext.GNUTranslations(open(mofile, "rb"))
129 except IOError:
130     logging.debug("Locale for '%s' not found. Using default." % lang)
131     trans = gettext.NullTranslations()
132 
133 if constants.PY3:
134     trans.install()
135 else:
136     trans.install(unicode=True)
137 
138 # PsychoPy app uses a nonstandard name _translate (instead of _)
139 # A dependency overwrites _ somewhere, clobbering use of _ as global:
140 # __builtins__['_translate'] = _
141 # del(__builtins__['_'])  # idea: force psychopy code to use _translate
142 
143 # Feb 2016: require modules to explicitly import _translate from localization:
144 _translate = _  # _ is created by gettext, in builtins namespace
145 del(__builtins__['_'])
146 
147 
148 # some common ones that will be used by many components etc
149 _localized = {
150     # for BaseComponent:
151     'name': _translate('Name'),  # fieldName: display label
152     'startType': _translate('start type'),
153     'stopType': _translate('stop type'),
154     'startVal': _translate('Start'),
155     'stopVal': _translate('Stop'),
156     'startEstim': _translate('Expected start (s)'),
157     'durationEstim': _translate('Expected duration (s)'),
158 
159     # for BaseVisualComponent:
160     'units': _translate('Units'),
161     'color': _translate('Color'),
162     'colorSpace': _translate('Color space'),
163     'opacity': _translate('Opacity'),
164     'pos': _translate('Position [x,y]'),
165     'ori': _translate('Orientation'),
166     'size': _translate('Size [w,h]'),
167 
168     # for loops
169     'Name': _translate('Name'),
170     'nReps': _translate('nReps'),
171     'conditions': _translate('Conditions'),  # not the same
172     'endPoints': _translate('endPoints'),
173     'Selected rows': _translate('Selected rows'),
174     'loopType': _translate('loopType'),
175     'random seed': _translate('random seed'),
176     'Is trials': _translate('Is trials'),
177     'min value': _translate('min value'),
178     'N reversals': _translate('N reversals'),
179     'start value': _translate('start value'),
180     'N up': _translate('N up'),
181     'max value': _translate('max value'),
182     'N down': _translate('N down'),
183     'step type': _translate('step type'),
184     'step sizes': _translate('step sizes'),
185     'stairType': _translate('stairType'),
186     'switchMethod': _translate('switchMethod')
187 }
188 
189 
190 # __builtins__['_'] = wx.GetTranslation
191 # this seems to have no effect, needs more investigation:
192 # path = os.path.join(os.path.dirname(__file__), '..', 'locale',
193 #                     lang, 'LC_MESSAGE') + os.sep
194 # wxlocale.AddCatalogLookupPathPrefix(path)
195
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/psychopy/localization/__init__.py b/psychopy/localization/__init__.py
--- a/psychopy/localization/__init__.py
+++ b/psychopy/localization/__init__.py
@@ -35,6 +35,9 @@
         wxlocale = wx.Locale(languageID)
     else:
         wxlocale = wx.Locale(wx.LANGUAGE_DEFAULT)
+    # Check language layout, and reset to default if RTL
+    if wxlocale.GetCanonicalName()[:2] in ['ar', 'dv', 'fa', 'ha', 'he', 'ps', 'ur', 'yi']:
+        wxlocale = wx.Locale(wx.LANGUAGE_DEFAULT)
     # wx.Locale on Py2.7/wx3.0 seems to delete the preferred encoding (utf-8)
     # Check if that happened and reinstate if needed.
     if locale_pkg.getpreferredencoding(do_setlocale=False) == '':

{"golden_diff": "diff --git a/psychopy/localization/__init__.py b/psychopy/localization/__init__.py\n--- a/psychopy/localization/__init__.py\n+++ b/psychopy/localization/__init__.py\n@@ -35,6 +35,9 @@\n         wxlocale = wx.Locale(languageID)\n     else:\n         wxlocale = wx.Locale(wx.LANGUAGE_DEFAULT)\n+    # Check language layout, and reset to default if RTL\n+    if wxlocale.GetCanonicalName()[:2] in ['ar', 'dv', 'fa', 'ha', 'he', 'ps', 'ur', 'yi']:\n+        wxlocale = wx.Locale(wx.LANGUAGE_DEFAULT)\n     # wx.Locale on Py2.7/wx3.0 seems to delete the preferred encoding (utf-8)\n     # Check if that happened and reinstate if needed.\n     if locale_pkg.getpreferredencoding(do_setlocale=False) == '':\n", "issue": "IDE Mirrored for Right-to-Left Locales\nReproduction:\r\nSearch in windows for \"locale\" and click \"date, time, and number format\" (May be different if not on Windows 7).\r\nChange the format to any RTL language (ex. Hebrew).\r\nOpen Psychopy IDE\r\nText and buttons are on the wrong side of the window. Input is backward as well.\r\n![capture](https://user-images.githubusercontent.com/1297252/39575845-b2f3756c-4ee4-11e8-98d2-91621b721104.PNG)\r\n\n", "before_files": [{"content": "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\n\"\"\"Language localization for PsychoPy.\n\nSets the locale value as a wx languageID (int) and initializes gettext\ntranslation _translate():\n    from psychopy.app import localization\n\"\"\"\n\n# Part of the PsychoPy library\n# Copyright (C) 2018 Jonathan Peirce\n# Distributed under the terms of the GNU General Public License (GPL).\n\n# Author: Jeremy Gray, July 2014\n\n\nimport gettext\nimport os\nimport glob\nimport codecs\nfrom psychopy import logging, prefs, constants\nimport wx\nimport locale as locale_pkg\n\ndef setLocaleWX():\n    \"\"\"Sets up the locale for the wx application. Only call this after the app\n    has been created and initialised (it is called by PsychoPyApp.OnInit())\n\n    :return: wx.Locale object\n    \"\"\"\n    # set locale for wx app (before splash screen):\n    encod = locale_pkg.getpreferredencoding(do_setlocale=False)\n    if locale.IsAvailable(languageID):\n        wxlocale = wx.Locale(languageID)\n    else:\n        wxlocale = wx.Locale(wx.LANGUAGE_DEFAULT)\n    # wx.Locale on Py2.7/wx3.0 seems to delete the preferred encoding (utf-8)\n    # Check if that happened and reinstate if needed.\n    if locale_pkg.getpreferredencoding(do_setlocale=False) == '':\n        locale_pkg.setlocale(locale_pkg.LC_ALL,\n                             \"{}.{}\".format(codeFromWxId[languageID], encod))\n    return wxlocale\n\n# Get a dict of locale aliases from wx.Locale() -- same cross-platform\n# (Win 7, Mac 10.9)\n# this DOESN'T need the app to be instantiated\nlocale = wx.Locale()\naliases = {u'English (U.S.)': 'en_US'}\n# set defaults because locale.GetLanguageInfo(0) can return None on some\n# systems:\nwxIdFromCode = {'en_US': wx.LANGUAGE_DEFAULT}  # int: 0 default, 2-229\n# used in directory names e.g. ja_JP; never JPN ala Windows\ncodeFromWxId = {wx.LANGUAGE_DEFAULT: 'en_US'}\nfor i in range(230):\n    info = locale.GetLanguageInfo(i)\n    if info:\n        # mix of forms: ja or ja_JP\n        aliases[info.Description] = info.CanonicalName\n        wxIdFromCode[info.CanonicalName] = i\n        codeFromWxId[i] = info.CanonicalName\n\n# read all known mappings cross-platform from a file:\n# get windows 3-letter code (=val) from canonical form (=key); use only\n# for setting locale (non-wx)\nwinmap = {'en_US': 'ENU'}\n# descriptive name, if available; 5-letter code if not\nlocname = {'en_US': u'English (U.S.)'}\nreverseMap = {u'English (U.S.)': 'en_US'}\nmappings = os.path.join(os.path.dirname(__file__), 'mappings.txt')\nfor line in codecs.open(mappings, 'rU', 'utf8').readlines():\n    try:\n        # canonical, windows, name-with-spaces\n        can, win, name = line.strip().split(' ', 2)\n    except ValueError:\n        can, win = line.strip().split(' ', 1)\n        name = can\n    winmap[can] = win\n    locname[can] = name\n    reverseMap[name] = can\n\n# what are the available translations? available languages on the OS?\nexpr = os.path.join(os.path.dirname(__file__), '..', 'app', 'locale', '*')\navailable = sorted(map(os.path.basename, glob.glob(expr)))\nsysAvail = [str(l) for l in codeFromWxId.values()  # installed language packs\n            if l and locale.IsAvailable(wxIdFromCode[l])]\n\n\ndef getID(lang=None):\n    \"\"\"Get wx ID of language to use for translations:\n        `lang`, pref, or system default.\n\n    `lang` is a 5 char `language_REGION`, eg ja_JP\n    \"\"\"\n    if lang:\n        val = lang\n    else:\n        try:\n            val = prefs.app['locale']\n        except KeyError:\n            val = locale.GetLocale()  # wx.Locale, no encoding\n        if not val:\n            val = codeFromWxId[wx.LANGUAGE_DEFAULT]\n    try:\n        # todo: try to set wx.Locale here to language\n        language = wxIdFromCode[val]\n    except KeyError:\n        logging.error('locale %s not known to wx.Locale, using default' % val)\n        language = wx.LANGUAGE_DEFAULT\n\n    return language, val\n\nlanguageID, lang = getID()\n# use lang like this:\n# import locale  -- the non-wx version of locale\n#\n# if sys.platform.startswith('win'):\n#        v = winmap[val]\n# else: v=val\n# locale.setlocale(locale.LC_ALL, (v, 'UTF-8'))\n\n# ideally rewrite the following using wxlocale only:\npath = os.path.join(os.path.dirname(__file__), '..', 'app',\n                    'locale', lang, 'LC_MESSAGE') + os.sep\nmofile = os.path.join(path, 'messages.mo')\ntry:\n    logging.debug(\"Opening message catalog %s for locale %s\" % (mofile, lang))\n    trans = gettext.GNUTranslations(open(mofile, \"rb\"))\nexcept IOError:\n    logging.debug(\"Locale for '%s' not found. Using default.\" % lang)\n    trans = gettext.NullTranslations()\n\nif constants.PY3:\n    trans.install()\nelse:\n    trans.install(unicode=True)\n\n# PsychoPy app uses a nonstandard name _translate (instead of _)\n# A dependency overwrites _ somewhere, clobbering use of _ as global:\n# __builtins__['_translate'] = _\n# del(__builtins__['_'])  # idea: force psychopy code to use _translate\n\n# Feb 2016: require modules to explicitly import _translate from localization:\n_translate = _  # _ is created by gettext, in builtins namespace\ndel(__builtins__['_'])\n\n\n# some common ones that will be used by many components etc\n_localized = {\n    # for BaseComponent:\n    'name': _translate('Name'),  # fieldName: display label\n    'startType': _translate('start type'),\n    'stopType': _translate('stop type'),\n    'startVal': _translate('Start'),\n    'stopVal': _translate('Stop'),\n    'startEstim': _translate('Expected start (s)'),\n    'durationEstim': _translate('Expected duration (s)'),\n\n    # for BaseVisualComponent:\n    'units': _translate('Units'),\n    'color': _translate('Color'),\n    'colorSpace': _translate('Color space'),\n    'opacity': _translate('Opacity'),\n    'pos': _translate('Position [x,y]'),\n    'ori': _translate('Orientation'),\n    'size': _translate('Size [w,h]'),\n\n    # for loops\n    'Name': _translate('Name'),\n    'nReps': _translate('nReps'),\n    'conditions': _translate('Conditions'),  # not the same\n    'endPoints': _translate('endPoints'),\n    'Selected rows': _translate('Selected rows'),\n    'loopType': _translate('loopType'),\n    'random seed': _translate('random seed'),\n    'Is trials': _translate('Is trials'),\n    'min value': _translate('min value'),\n    'N reversals': _translate('N reversals'),\n    'start value': _translate('start value'),\n    'N up': _translate('N up'),\n    'max value': _translate('max value'),\n    'N down': _translate('N down'),\n    'step type': _translate('step type'),\n    'step sizes': _translate('step sizes'),\n    'stairType': _translate('stairType'),\n    'switchMethod': _translate('switchMethod')\n}\n\n\n# __builtins__['_'] = wx.GetTranslation\n# this seems to have no effect, needs more investigation:\n# path = os.path.join(os.path.dirname(__file__), '..', 'locale',\n#                     lang, 'LC_MESSAGE') + os.sep\n# wxlocale.AddCatalogLookupPathPrefix(path)\n", "path": "psychopy/localization/__init__.py"}], "after_files": [{"content": "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\n\"\"\"Language localization for PsychoPy.\n\nSets the locale value as a wx languageID (int) and initializes gettext\ntranslation _translate():\n    from psychopy.app import localization\n\"\"\"\n\n# Part of the PsychoPy library\n# Copyright (C) 2018 Jonathan Peirce\n# Distributed under the terms of the GNU General Public License (GPL).\n\n# Author: Jeremy Gray, July 2014\n\n\nimport gettext\nimport os\nimport glob\nimport codecs\nfrom psychopy import logging, prefs, constants\nimport wx\nimport locale as locale_pkg\n\ndef setLocaleWX():\n    \"\"\"Sets up the locale for the wx application. Only call this after the app\n    has been created and initialised (it is called by PsychoPyApp.OnInit())\n\n    :return: wx.Locale object\n    \"\"\"\n    # set locale for wx app (before splash screen):\n    encod = locale_pkg.getpreferredencoding(do_setlocale=False)\n    if locale.IsAvailable(languageID):\n        wxlocale = wx.Locale(languageID)\n    else:\n        wxlocale = wx.Locale(wx.LANGUAGE_DEFAULT)\n    # Check language layout, and reset to default if RTL\n    if wxlocale.GetCanonicalName()[:2] in ['ar', 'dv', 'fa', 'ha', 'he', 'ps', 'ur', 'yi']:\n        wxlocale = wx.Locale(wx.LANGUAGE_DEFAULT)\n    # wx.Locale on Py2.7/wx3.0 seems to delete the preferred encoding (utf-8)\n    # Check if that happened and reinstate if needed.\n    if locale_pkg.getpreferredencoding(do_setlocale=False) == '':\n        locale_pkg.setlocale(locale_pkg.LC_ALL,\n                             \"{}.{}\".format(codeFromWxId[languageID], encod))\n    return wxlocale\n\n# Get a dict of locale aliases from wx.Locale() -- same cross-platform\n# (Win 7, Mac 10.9)\n# this DOESN'T need the app to be instantiated\nlocale = wx.Locale()\naliases = {u'English (U.S.)': 'en_US'}\n# set defaults because locale.GetLanguageInfo(0) can return None on some\n# systems:\nwxIdFromCode = {'en_US': wx.LANGUAGE_DEFAULT}  # int: 0 default, 2-229\n# used in directory names e.g. ja_JP; never JPN ala Windows\ncodeFromWxId = {wx.LANGUAGE_DEFAULT: 'en_US'}\nfor i in range(230):\n    info = locale.GetLanguageInfo(i)\n    if info:\n        # mix of forms: ja or ja_JP\n        aliases[info.Description] = info.CanonicalName\n        wxIdFromCode[info.CanonicalName] = i\n        codeFromWxId[i] = info.CanonicalName\n\n# read all known mappings cross-platform from a file:\n# get windows 3-letter code (=val) from canonical form (=key); use only\n# for setting locale (non-wx)\nwinmap = {'en_US': 'ENU'}\n# descriptive name, if available; 5-letter code if not\nlocname = {'en_US': u'English (U.S.)'}\nreverseMap = {u'English (U.S.)': 'en_US'}\nmappings = os.path.join(os.path.dirname(__file__), 'mappings.txt')\nfor line in codecs.open(mappings, 'rU', 'utf8').readlines():\n    try:\n        # canonical, windows, name-with-spaces\n        can, win, name = line.strip().split(' ', 2)\n    except ValueError:\n        can, win = line.strip().split(' ', 1)\n        name = can\n    winmap[can] = win\n    locname[can] = name\n    reverseMap[name] = can\n\n# what are the available translations? available languages on the OS?\nexpr = os.path.join(os.path.dirname(__file__), '..', 'app', 'locale', '*')\navailable = sorted(map(os.path.basename, glob.glob(expr)))\nsysAvail = [str(l) for l in codeFromWxId.values()  # installed language packs\n            if l and locale.IsAvailable(wxIdFromCode[l])]\n\n\ndef getID(lang=None):\n    \"\"\"Get wx ID of language to use for translations:\n        `lang`, pref, or system default.\n\n    `lang` is a 5 char `language_REGION`, eg ja_JP\n    \"\"\"\n    if lang:\n        val = lang\n    else:\n        try:\n            val = prefs.app['locale']\n        except KeyError:\n            val = locale.GetLocale()  # wx.Locale, no encoding\n        if not val:\n            val = codeFromWxId[wx.LANGUAGE_DEFAULT]\n    try:\n        # todo: try to set wx.Locale here to language\n        language = wxIdFromCode[val]\n    except KeyError:\n        logging.error('locale %s not known to wx.Locale, using default' % val)\n        language = wx.LANGUAGE_DEFAULT\n\n    return language, val\n\nlanguageID, lang = getID()\n# use lang like this:\n# import locale  -- the non-wx version of locale\n#\n# if sys.platform.startswith('win'):\n#        v = winmap[val]\n# else: v=val\n# locale.setlocale(locale.LC_ALL, (v, 'UTF-8'))\n\n# ideally rewrite the following using wxlocale only:\npath = os.path.join(os.path.dirname(__file__), '..', 'app',\n                    'locale', lang, 'LC_MESSAGE') + os.sep\nmofile = os.path.join(path, 'messages.mo')\ntry:\n    logging.debug(\"Opening message catalog %s for locale %s\" % (mofile, lang))\n    trans = gettext.GNUTranslations(open(mofile, \"rb\"))\nexcept IOError:\n    logging.debug(\"Locale for '%s' not found. Using default.\" % lang)\n    trans = gettext.NullTranslations()\n\nif constants.PY3:\n    trans.install()\nelse:\n    trans.install(unicode=True)\n\n# PsychoPy app uses a nonstandard name _translate (instead of _)\n# A dependency overwrites _ somewhere, clobbering use of _ as global:\n# __builtins__['_translate'] = _\n# del(__builtins__['_'])  # idea: force psychopy code to use _translate\n\n# Feb 2016: require modules to explicitly import _translate from localization:\n_translate = _  # _ is created by gettext, in builtins namespace\ndel(__builtins__['_'])\n\n\n# some common ones that will be used by many components etc\n_localized = {\n    # for BaseComponent:\n    'name': _translate('Name'),  # fieldName: display label\n    'startType': _translate('start type'),\n    'stopType': _translate('stop type'),\n    'startVal': _translate('Start'),\n    'stopVal': _translate('Stop'),\n    'startEstim': _translate('Expected start (s)'),\n    'durationEstim': _translate('Expected duration (s)'),\n\n    # for BaseVisualComponent:\n    'units': _translate('Units'),\n    'color': _translate('Color'),\n    'colorSpace': _translate('Color space'),\n    'opacity': _translate('Opacity'),\n    'pos': _translate('Position [x,y]'),\n    'ori': _translate('Orientation'),\n    'size': _translate('Size [w,h]'),\n\n    # for loops\n    'Name': _translate('Name'),\n    'nReps': _translate('nReps'),\n    'conditions': _translate('Conditions'),  # not the same\n    'endPoints': _translate('endPoints'),\n    'Selected rows': _translate('Selected rows'),\n    'loopType': _translate('loopType'),\n    'random seed': _translate('random seed'),\n    'Is trials': _translate('Is trials'),\n    'min value': _translate('min value'),\n    'N reversals': _translate('N reversals'),\n    'start value': _translate('start value'),\n    'N up': _translate('N up'),\n    'max value': _translate('max value'),\n    'N down': _translate('N down'),\n    'step type': _translate('step type'),\n    'step sizes': _translate('step sizes'),\n    'stairType': _translate('stairType'),\n    'switchMethod': _translate('switchMethod')\n}\n\n\n# __builtins__['_'] = wx.GetTranslation\n# this seems to have no effect, needs more investigation:\n# path = os.path.join(os.path.dirname(__file__), '..', 'locale',\n#                     lang, 'LC_MESSAGE') + os.sep\n# wxlocale.AddCatalogLookupPathPrefix(path)\n", "path": "psychopy/localization/__init__.py"}]}