Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv10423 Modified Files: Tag: release22-maint gettext.py Log Message: Add fallback argument to translation(). Set fallback to 1 for install(). Fixes #500595. Index: gettext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/gettext.py,v retrieving revision 1.11 retrieving revision 1.11.24.1 diff -C2 -d -r1.11 -r1.11.24.1 *** gettext.py 2001/01/23 15:35:04 1.11 --- gettext.py 2002/01/11 06:37:07 1.11.24.1 *************** *** 231,239 **** _translations = {} ! def translation(domain, localedir=None, languages=None, class_=None): if class_ is None: class_ = GNUTranslations mofile = find(domain, localedir, languages) if mofile is None: raise IOError(ENOENT, 'No translation file found for domain', domain) key = os.path.abspath(mofile) --- 231,242 ---- _translations = {} ! def translation(domain, localedir=None, languages=None, ! class_=None, fallback=0): if class_ is None: class_ = GNUTranslations mofile = find(domain, localedir, languages) if mofile is None: + if fallback: + return NullTranslations() raise IOError(ENOENT, 'No translation file found for domain', domain) key = os.path.abspath(mofile) *************** *** 249,253 **** def install(domain, localedir=None, unicode=0): ! translation(domain, localedir).install(unicode) --- 252,256 ---- def install(domain, localedir=None, unicode=0): ! translation(domain, localedir, fallback=1).install(unicode)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4