openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.11k stars 718 forks source link

[Draft] Currency Settings do not take the expected changes; switching locales does #7719

Open filipefurtad0 opened 3 years ago

filipefurtad0 commented 3 years ago

Description

Closely related to #7710 and #7616.

This is draft issue / enhancement / bug report. Needs input and perhaps more investigation.

Logging in as superadmin, one can access the "Currency Settings" section under admin/general_settings/edit; changes in this section seem not to have effect on the server. Where in the app are we accounting for these fields? (below):

image

Irrespective of these settings, changing locales does seem to play a role, in how commas / dots are displayed and parsed.

Expected Behavior

Parsing from commas dots should depend only from server/instance settings (and not from browser and/Internationalization settings)

Actual Behaviour

Superadmin has UI access to these settings, but they seem to play no role at all.

Steps to Reproduce

Try to configure the instance through the UI. See that it does not work as expected, by trying different combinations of the following steps:

As superadmin

  1. Set commas as decimal separator; and dots as thousands separator
  2. Thick the "Number localization settings"

As a customer

  1. Visit a shopfront and look at a price tag - settings played no role;
  2. Change locale, from say en_FR to say fr_FR
  3. Notice how the role between dots and commas interchange, with changes in the locale

As an admin

  1. See no difference in the BO

Animated Gif/Screenshot

Some variations on the above steps.

Browser language is English. Selected locale changes between FR and EN; changes on the superadmin level are made as well.

Peek 2021-06-01 11-25

Peek 2021-06-01 11-27

Peek 2021-06-01 11-28

Workaround

?

Severity

Your Environment

Possible Fix

Removing the Currency Settings section from the UI?

filipefurtad0 commented 3 years ago

It is worth noticing in the videos on the issue that there are discrepancies between shopfront and backoffice, in what concerns the use of commas and dots, as decimal separators. This can best be seen here (FR-prod):

image

drummer83 commented 2 years ago

So if the currency settings in super admin configuration have no effect (which I can confirm), where is this configured then? Is it during installation? And can this be changed later without any risk? I am asking, because the typical format in Germany is the comma as decimal separator and dot as thousands separator (if at all). Currently we have it the other way round: image