comparison MoinMoin/i18n/__init__.py @ 4792:7a826f946da3

Groups2009: wikidicts were refactored. request.dict provides access only to WikiDicts. DictBase class was merged with Dict. Group class was removed. DictDict was merged with GroupDict removing methods related to the group functionality. The cache key for dicts changed from 'dicts_groups' to 'dicts'. wikidicts test was refined to capture new functionality. Changes in the other code to use DictDict.__contains__ instead of has_dict and DictDict.__getitem__ in place of dict.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Sun, 07 Jun 2009 16:04:05 +0200
parents f0c2ab8ef256
children c16381dd17fe
comparison
equal deleted inserted replaced
4791:1b84b35fbe91 4792:7a826f946da3
302 else: 302 else:
303 try: 303 try:
304 language = languages[lang]['x-language-in-english'] 304 language = languages[lang]['x-language-in-english']
305 dictpagename = "%sDict" % language.replace(' ', '') 305 dictpagename = "%sDict" % language.replace(' ', '')
306 dicts = request.dicts 306 dicts = request.dicts
307 if dicts.has_dict(dictpagename): 307 if dictpagename in dicts:
308 userdict = dicts.dict(dictpagename) 308 userdict = dicts[dictpagename]
309 translated = userdict[original] 309 translated = userdict[original]
310 else: 310 else:
311 raise KeyError 311 raise KeyError
312 except KeyError: 312 except KeyError:
313 # do not simply return trans with str, but recursively call 313 # do not simply return trans with str, but recursively call