X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/e9f9c3887d9c9e45401257a78d3182f17a5a8146..b8e94e0e7cc7576cbaacd3c737d6ffca6b12db53:/apps/picture/models.py diff --git a/apps/picture/models.py b/apps/picture/models.py index 97dbd0ec2..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)