Changeset 4275
- Timestamp:
- 07/13/08 11:46:58 (3 months ago)
- Files:
-
- trunk/dabo/dLocalize.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/dLocalize.py
r3411 r4275 89 89 90 90 def getDaboLocaleDir(): 91 localeDir = os.path.join(os.path.split(dabo.__file__)[0], "locale") 91 localeDirName = "locale" 92 localeDir = os.path.join(os.path.split(dabo.__file__)[0], localeDirName) 92 93 if not os.path.isdir(localeDir): 93 94 # Frozen app? 94 # First need to find the directory that contains the .exe: 95 # First need to find the directory that contains the executable. On the Mac, 96 # it might be a directory at a lower level than dabo itself. 95 97 startupDir = localeDir 96 98 while startupDir: 97 startupDir = os.path.split(startupDir)[0] 98 if os.path.isdir(startupDir): 99 newDir = os.path.split(startupDir)[0] 100 if newDir == startupDir: 101 # At the root dir 99 102 break 100 localeDir = os.path.join(startupDir, "dabo.locale") 103 startupDir = newDir 104 candidate = os.path.join(startupDir, localeDirName) 105 if os.path.isdir(candidate): 106 break 107 localeDir = candidate 101 108 return localeDir 102 109
