From 935fbddf3d7fd495248d031436985d5eaeb4ee8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Telepovsk=C3=BD?= Date: Mon, 22 May 2017 13:20:32 +0200 Subject: [PATCH] Fixed i18n support --- djangoseo/backends.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/djangoseo/backends.py b/djangoseo/backends.py index 25a481b..2812c51 100644 --- a/djangoseo/backends.py +++ b/djangoseo/backends.py @@ -11,6 +11,7 @@ from django.contrib.contenttypes.fields import GenericForeignKey from django.template import Template, Context from django.utils.encoding import python_2_unicode_compatible +from django.utils import translation from six import string_types, with_metaclass from djangoseo.utils import resolve_to_name, NotSet, Literal @@ -386,6 +387,12 @@ def save(self, *args, **kwargs): except AttributeError: pass else: + try: + language = self._language + except AttributeError: + language = translation.get_language() + + translation.activate(language) self._path = path_func() try: super(ModelInstanceMetadataBase, self).save(*args,