Commits

Anonymous committed 9ab68e5

0.12.3dev: Avoid adding duplicate plugin translation entries.

Fix by wadatka. Closes #10294.

Comments (0)

Files changed (1)

trac/util/translation.py

         def add_domain(self, domain, env_path, locales_dir):
             self._plugin_domains_lock.acquire()
             try:
-                if env_path not in self._plugin_domains:
-                    self._plugin_domains[env_path] = []
-                self._plugin_domains[env_path].append((domain, locales_dir))
+                entry = (domain, locales_dir)
+                plugin_domains = self._plugin_domains.setdefault(env_path, [])
+                if entry not in plugin_domains:
+                    plugin_domains.append(entry)
             finally:
                 self._plugin_domains_lock.release()