Commit 17e1af9d authored by Michal Čihař's avatar Michal Čihař

Create directory for translations before trying to add one (fixes #67)

parent af643d90
......@@ -26,7 +26,7 @@ from django.contrib import messages
from django.core.urlresolvers import reverse
from django.utils import timezone
from glob import glob
import os.path
import os
import weblate
import git
from trans.formats import FILE_FORMAT_CHOICES, FILE_FORMATS
......@@ -1146,6 +1146,11 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
self.filemask.replace('*', language.code)
)
# Create directory for a translation
dirname = os.path.dirname(filename)
if not os.path.exists(dirname):
os.makedirs(dirname)
self.file_format_cls.add_language(
filename,
language.code,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment