Hi. I'm writing a theme and I need to print a string which doesn't exist in default po files.
Thomas Waldmann told me to look at MoinMoin/i18n/__init__.py to learn how to add new translations. I didn't understand it very well, but I wrote the following code, and it's not working. Instead of adding theme translations to the translation system (*.MoinMoin.po + *.mytheme.po), it is replacing it completely (only *.mytheme.po is being used). What's wrong with the following code? def __init__(self, request): ThemeBase.__init__(self, request) self.load_personal_translations() def load_personal_translations(self): """Load personal translations to be used by this theme""" request = self.request po_dir = os.path.join('i18n', 'themes', self.name) encoding = 'utf-8' for lang_file in glob.glob(po_filename(request, i18n_dir=po_dir, language='*', domain=self.name)): language, domain, ext = os.path.basename(lang_file).split('.') t = Translation(language, domain) f = file(lang_file) t.load_po(f) f.close() t.loadLanguage(request, trans_dir=po_dir) personal_translation = {} for key, text in t.raw.items(): personal_translation[key] = text if not translations.has_key(language): translations[language] = t else: append = translations[language].raw.update append(t.raw)
------------------------------------------------------------------------------ Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://www.creativitycat.com
_______________________________________________ Moin-user mailing list Moin-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/moin-user