X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/4b4e3aa4d7f75f4bee66b3f3098cbeb756adb8d0..6b9c5843b31661562ee76ee75a360219de0397a6:/apps/picture/models.py?ds=inline diff --git a/apps/picture/models.py b/apps/picture/models.py index 120750d7c..7ef6ca7cd 100644 --- a/apps/picture/models.py +++ b/apps/picture/models.py @@ -170,6 +170,9 @@ class Picture(models.Model): area_data = {'themes':{}, 'things':{}} + # Treat all names in picture XML as in default language. + lang = settings.LANGUAGE_CODE + for part in picture_xml.partiter(): if picture_xml.frame: c = picture_xml.frame[0] @@ -180,7 +183,8 @@ class Picture(models.Model): objname = objname.strip() tag, created = catalogue.models.Tag.objects.get_or_create(slug=slughifi(objname), category='thing') if created: - tag.name = objname + tag.name = objname.capitalize() + setattr(tag, 'name_%s' % lang, tag.name) tag.sort_key = sortify(tag.name) tag.save() #thing_tags.add(tag) @@ -340,6 +344,7 @@ class Picture(models.Model): template % (self.pk, lang) for template in [ '/katalog/p/%d/short.%s.html', + '/katalog/p/%d/mini.%s.html', ] for lang in languages ])