3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
257 stars 143 forks source link

[Bug]: Group separator not working in Lizmap form popup #2709

Open u-cav opened 2 years ago

u-cav commented 2 years ago

What is the bug?

The thousands/group separator is not showing up in Lizmap, both using the "form" and the "qgis" popup.

The same project in QGIS desktop correctly shows the thousands separator.

We running py-qgis-server 3.16 with the QGIS_SERVER_SHOW_GROUP_SEPARATOR: 'true' environmental variable (see here)

The Lizmap plugin is installed on the server.

Do you know how we can enable this in Lizmap? I'm probably missing something obvious.

I also tried setting the following options in the QGIS.ini (server side):

[locale]
globalLocale=it_IT
overrideFlag=true
showGroupSeparator=true
userLocale=it_IT

Thank you!

Steps to reproduce the issue

  1. Create/open a project with some numeric data in the thousands
  2. Create a QGIS drag&drop form for the numeric field, type "Text edit"
  3. Open the form in QGIS desktop, the number shows up with the thousands separator (for example: 5.114.730,97)
  4. Generate the Lizmap cfg, activate the popup (qgis or form), upload the project
  5. Configure QGIS Server with the QGIS_SERVER_SHOW_GROUP_SEPARATOR: 'true' environmental variable
  6. Open the project in Lizmap, activate the popup
  7. The number is displayed without the thousands separator (for example 5114730.97)

Lizmap version

3.5.0

QGIS desktop version

3.16.15

QGIS server version

3.16.14

Operating system

Arch Linux

Browsers

Chrome

Browsers version

Chromium 97.0.4692.71

Relevant log output

No response

mdouchin commented 2 years ago

Hi, Have you tried to also assign these variables for your QGIS Server instance (in you FCGI configuration for example) ?

LC_ALL="it_IT.UTF-8"
LANG="it_IT.UTF-8"
u-cav commented 2 years ago

Hi Michaël, thanks for your reply.

I have tried setting the locale override in the QGIS Server options (QGIS_SERVER_OVERRIDE_SYSTEM_LOCALE: 'it_IT.utf8'), and also setting the locale at a system level (within the container) with

LC_ALL="it_IT.UTF-8"
LANG="it_IT.UTF-8"

In the py-qgis-server logs I can see the following:

2022-01-21 10:26:24,611 DEBUG   [39]    Qgis: Server:   - QGIS_SERVER_SHOW_GROUP_SEPARATOR / '/locale/showGroupSeparator' (Show group (thousands) separator): 'true' (read from ENVIRONMENT_VARIABLE)
2022-01-21 10:26:24,612 DEBUG   [39]    Qgis: Server:   - QGIS_SERVER_OVERRIDE_SYSTEM_LOCALE / '/locale/userLocale' (Override system locale): 'it_IT.utf8' (read from ENVIRONMENT_VARIABLE)

Do you have a working demo/example that I could look at to see what could be different?