= Add translation domain to cache key = Applies to:: 1.9.0, possibly other versions. Purpose:: Fix the need of dummy languages when instantiating a custom `Translation`. Description:: This patch adds the translation domain to the cache key of `Translation`. Currently you have to use dummy languages as workaround, otherwise your custom `Translation` object will overwrite Moin translation for that language completely. See also FeatureRequests/CheckTranslationBasedOnWikiPos and MoinMoinPatch/LoadAllTtranslationDomains. = Patch = {{{#!highlight diff --- MoinMoin/i18n/__init__.py 2009-12-03 22:26:52 +0000 +++ MoinMoin/i18n/__init__.py 2009-12-03 22:21:50 +0000 @@ -222,7 +222,7 @@ def loadLanguage(self, request, trans_dir="i18n"): request.clock.start('loadLanguage') # see comment about per-wiki scope above - cache = caching.CacheEntry(request, arena='i18n', key=self.language, scope='wiki', use_pickle=True) + cache = caching.CacheEntry(request, arena='i18n', key=('%s_%s' % (self.language, self.domain)), scope='wiki', use_pickle=True) langfilename = po_filename(request, self.language, self.domain, i18n_dir=trans_dir) needsupdate = cache.needsUpdate(langfilename) if not needsupdate: }}} = Discussion = = Plan = ## This part is for Moin``Moin developers: * Priority: * Assigned to: * Status: /* Contributed by RenatoSilva */ ---- CategoryMoinMoinPatch