pretix icon indicating copy to clipboard operation
pretix copied to clipboard

Configured region not honored with de-informal language

Open stapelberg opened this issue 1 year ago • 3 comments

Problem and impact

When setting my user account’s language to de-informal, the configured region (CH) is no longer honored for formatting money values, e.g. in the orders page.

Expected behaviour

No response

Steps to reproduce

  1. Configure region to CH
  2. Configure language to de; orders page lists “CHF 97.56” (with dots)
  3. Configure language to de-informal; orders page lists “97,56 CHF” (with commas)

Looking at the code, I think the problem is that the language function treats “informal” as a region: https://github.com/pretix/pretix/blob/6bf23b0fddbac3aa8df6f81db35c91fdcc058aba/src/pretix/base/i18n.py#L146-L154

Screenshots

No response

Link

No response

Browser (software, desktop or mobile?) and version

No response

Operating system, dependency versions

No response

Version

2024.2

stapelberg avatar Feb 29 '24 21:02 stapelberg

I'll look into it but it might be not fixable the way the informal variant is implemented, it's basically a fake region in itself :/

raphaelm avatar Feb 29 '24 21:02 raphaelm

Wouldn’t just removing “-informal” before trying to determine the region fix the problem?

stapelberg avatar Feb 29 '24 21:02 stapelberg

No, the region will not be added to the language in the first place if de-informal is used since "informal" is implemented like a region (think de-de, de-at, de-ch and de-informal)

raphaelm avatar Mar 10 '24 15:03 raphaelm