diff --git a/src/pretix/base/exporters/orderlist.py b/src/pretix/base/exporters/orderlist.py index 945737d35..4d785e269 100644 --- a/src/pretix/base/exporters/orderlist.py +++ b/src/pretix/base/exporters/orderlist.py @@ -364,7 +364,7 @@ class OrderListExporter(MultiSheetListExporter): order.invoice_address.city, order.invoice_address.country if order.invoice_address.country else order.invoice_address.country_old, - order.invoice_address.state, + order.invoice_address.state_for_address, order.invoice_address.custom_field, order.invoice_address.vat_id, ] @@ -515,7 +515,7 @@ class OrderListExporter(MultiSheetListExporter): order.invoice_address.city, order.invoice_address.country if order.invoice_address.country else order.invoice_address.country_old, - order.invoice_address.state, + order.invoice_address.state_for_address, order.invoice_address.vat_id, ] except InvoiceAddress.DoesNotExist: @@ -732,7 +732,7 @@ class OrderListExporter(MultiSheetListExporter): op.zipcode or '', op.city or '', op.country if op.country else '', - op.state or '', + op.state_for_address or '', op.voucher.code if op.voucher else '', op.pseudonymization_id, op.secret, @@ -797,7 +797,7 @@ class OrderListExporter(MultiSheetListExporter): order.invoice_address.city, order.invoice_address.country if order.invoice_address.country else order.invoice_address.country_old, - order.invoice_address.state, + order.invoice_address.state_for_address, order.invoice_address.vat_id, ] except InvoiceAddress.DoesNotExist: diff --git a/src/pretix/base/models/customers.py b/src/pretix/base/models/customers.py index 942ae5918..d7d34db98 100644 --- a/src/pretix/base/models/customers.py +++ b/src/pretix/base/models/customers.py @@ -349,7 +349,7 @@ class AttendeeProfile(models.Model): def state_name(self): sd = pycountry.subdivisions.get(code='{}-{}'.format(self.country, self.state)) if sd: - return sd.name + return _(sd.name) return self.state @property diff --git a/src/pretix/base/models/orders.py b/src/pretix/base/models/orders.py index f8201f071..c9c4da871 100644 --- a/src/pretix/base/models/orders.py +++ b/src/pretix/base/models/orders.py @@ -1675,7 +1675,7 @@ class AbstractPosition(RoundingCorrectionMixin, models.Model): def state_name(self): sd = pycountry.subdivisions.get(code='{}-{}'.format(self.country, self.state)) if sd: - return sd.name + return _(sd.name) return self.state @property @@ -3480,7 +3480,7 @@ class InvoiceAddress(models.Model): def state_name(self): sd = pycountry.subdivisions.get(code='{}-{}'.format(self.country, self.state)) if sd: - return sd.name + return _(sd.name) return self.state @property diff --git a/src/pretix/base/views/js_helpers.py b/src/pretix/base/views/js_helpers.py index df291cfeb..e13777816 100644 --- a/src/pretix/base/views/js_helpers.py +++ b/src/pretix/base/views/js_helpers.py @@ -82,7 +82,7 @@ def _info(cc): statelist = [s for s in pycountry.subdivisions.get(country_code=cc) if s.type in types] return { 'data': [ - {'name': s.name, 'code': s.code[3:]} + {'name': gettext(s.name), 'code': s.code[3:]} for s in sorted(statelist, key=lambda s: s.name) ], **info,