Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#16188 closed Cleanup/optimization (fixed)

Added locale formats for swiss german language

Reported by: sspross Owned by: ojii
Component: Internationalization Version: master
Severity: Normal Keywords: locale, formats
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The swiss german number formats are slightly different than the german ones:

DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = "'"

http://lh.2xlibre.net/locale/de_CH/

Attachments (2)

de_CH_formats.diff (1.6 KB) - added by sspross 4 years ago.
adds de_CH/init.py and de_CH/formats.py
ticket-16188.diff (1.5 KB) - added by Merino 4 years ago.

Download all attachments as: .zip

Change History (16)

Changed 4 years ago by sspross

adds de_CH/init.py and de_CH/formats.py

comment:1 Changed 4 years ago by ojii

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

Changed 4 years ago by Merino

comment:2 Changed 4 years ago by Merino

Add a new patch to the root of the project.

comment:3 Changed 4 years ago by jezdez

  • Patch needs improvement set

So I'm not actually sure this is correct, since according to the government regulations the dot is only used for monetary values, not generally for numbers. http://www.bk.admin.ch/dokumentation/sprachen/04915/05016/index.html?lang=de

comment:4 Changed 4 years ago by jezdez

  • Triage Stage changed from Ready for checkin to Accepted

Bumping done to accepted since this need clarification.

comment:5 Changed 4 years ago by ojii

  • Patch needs improvement unset
  • Triage Stage changed from Accepted to Ready for checkin

My two cents on the DECIMAL_SEPARATOR issue here:

Unfortunately, there seems to be no real consensus on what the right way to write numbers in Switzerland is. While the link above shows the official way to do it, that rule seems to be applied very rarely.

I have checked with two major newspapers in Switzerland, hoping they would write proper (Swiss-) German, only to find that both use another System:

NZZ (nzz.ch) uses a dot for monetary values and either a dot or a comma (it's not consistent throughout the site) for percentage values and a dot for 'normal' values. Overall, they seem to be very inconsistent. Even more 'shocking' to me as a Swiss is that they use a comma as thousand separator, which is very unnatural for me.

Tagesanzeiger (tagi.ch) is inconsistent too. For values in graphs, they use dots. For values in article text they use commas.

I personally agree with the patch as it is. The "10'000.12" format appears most natural to me. So in my opinion, the patch is ready for checkin.

comment:6 Changed 4 years ago by mtredinnick

  • Triage Stage changed from Ready for checkin to Accepted

I'm going back to accepted on this. Comment 5 just pointed out a whole bunch of widely read sources that do NOT use the single quote for the separator. "Looks most natural to me" isn't really the winning argument here in the face of so much alternate public usage (in Swiss publications).

We can leave this open for a couple more months to see if somebody can come up with reasonable evidence (in, say, Wikipedia terms) that the quote is used everywhere "on average". If not, we should leave it as is and not commit this change.

In short: "Patch needs evidence"

comment:7 Changed 4 years ago by adamnelson

  • Patch needs improvement set

comment:8 Changed 4 years ago by ojii

So according to the specification in comment 3, DECIMAL_SEPARATOR should be a comma by default and THOUSAND_SEPARATOR a space, since single quotes are (according to Wikipedia [1]) only used in hand writing.

However this would be wrong for monetary values. Django cannot know if a value is a monetary or non-monetary value, so maybe the format should default to the more broad use case of non-monetary values.

[1] http://en.wikipedia.org/wiki/Decimal_mark#Examples_of_use

Version 0, edited 4 years ago by ojii (next)

comment:9 Changed 4 years ago by ojii

  • Patch needs improvement unset

comment:10 Changed 4 years ago by ojii

  • Owner changed from nobody to ojii

comment:11 Changed 4 years ago by jezdez

  • Triage Stage changed from Accepted to Ready for checkin

comment:12 Changed 3 years ago by jezdez

This was accidentally committed with a faulty commit message due to PEBKAC in r17472.

comment:13 Changed 3 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

comment:14 Changed 3 years ago by Claude Paroz <claude@…>

In 24c7d828b00c5cfb203addca06c82fc30d2e989a:

Moved de_CH/formats.py in its correct location

Refs #16188.

Note: See TracTickets for help on using tickets.
Back to Top