Commits

Diego Búrigo Zacarão committed 224467b

Don't try to msgmerge if there is no related POT file

- It should not raise an exception if a POT is not found
for a PO file, in case of multiple translations files per
language.

  • Participants
  • Parent commits 781895e

Comments (0)

Files changed (1)

transifex/translations/lib/types/pot.py

 from django.conf import settings
 from translations.lib.types import (TransManagerMixin, TransManagerError)
 from txcommon.commands import (run_command, CommandError)
+from txcommon.log import logger
 
 class POTStatsError(Exception):
 
 
         """
         if try_to_merge:
+            # Only try to get the POT for a PO when it's really needed.
+            # It might be an expensive operation
             source_file = self.get_source_file_for_pofile(filename)
             if not source_file:
-                raise SourceFileError, ("No POT file found. It is requited to "
-                                        "msgmerge.")
-            is_msgmerged = self.msgmerge(filename, source_file)
+                is_msgmerged = False
+                logger.debug("No POT file found for the '%s' file." % filename)
+            else:
+                is_msgmerged = self.msgmerge(filename, source_file)
         else:
             is_msgmerged = False