forked from 0x2620/pandora
fix translation creation
This commit is contained in:
parent
48aba7bde8
commit
f2ad63143a
1 changed files with 4 additions and 1 deletions
|
@ -264,7 +264,10 @@ class Annotation(models.Model):
|
||||||
from translation.models import Translation
|
from translation.models import Translation
|
||||||
layer = self.get_layer()
|
layer = self.get_layer()
|
||||||
if layer.get('translate'):
|
if layer.get('translate'):
|
||||||
Translation.objects.get_or_create(lang=lang, key=self.value, defaults={'type': Translation.CONTENT})
|
for lang in settings.CONFIG['languages']:
|
||||||
|
if lang == settings.CONFIG['language']:
|
||||||
|
continue
|
||||||
|
Translation.objects.get_or_create(lang=lang, key=self.value, defaults={'type': Translation.CONTENT})
|
||||||
|
|
||||||
def delete(self, *args, **kwargs):
|
def delete(self, *args, **kwargs):
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
|
|
Loading…
Reference in a new issue