def get_patterns(self): self.discover_plugins() # We want untranslated name of the plugin for its slug so we deactivate translation lang = get_language() deactivate_all() try: url_patterns = [] for plugin in self.get_all_plugins(): p = plugin() slug = slugify(force_unicode(normalize_name(p.__class__.__name__))) url_patterns += patterns("", url(r"^plugin/%s/" % (slug,), include(p.plugin_urls))) finally: # Reactivate translation activate(lang) return url_patterns
def get_patterns(self): self.discover_plugins() # We want untranslated name of the plugin for its slug so we deactivate translation lang = get_language() deactivate_all() try: url_patterns = [] for plugin in self.get_all_plugins(): p = plugin() slug = slugify(force_text(normalize_name(p.__class__.__name__))) url_patterns += [ url(r'^plugin/%s/' % (slug,), include(p.plugin_urls)), ] finally: # Reactivate translation activate(lang) return url_patterns