What is the bug or the crash?
Running layer_property (layer, 'type') in a QGIS expression returns a different string result depending on the language selected in QGIS.
This make expression very prone to breakage, eg: I am developing an expression on a machine in American English, and my users experience bugs because their machine are in another language.
Example:
- In English
layer_property (layer, 'type') returns 'Vector'
- In French
layer_property (layer, 'type') returns 'Vecteur'
Steps to reproduce the issue
- Go to Settings > Options
- In the General tab: check "Override System Locale"
- Set the field "User Interface Translation" to "American English"
- Restart QGIS for the option to take effect
- Create a new project
- Create a layer, eg: Layer > Create Layer > Create Shapefile layer
- Open the expression builder, eg: Edit > Select > Select Features by expression
- Set the text to
layer_property (@layer, 'type'), this should output 'Vector'
- Repeat these steps but select "français" instead of "American English" in the Settings
layer_property (@layer, 'type') should output 'Vecteur'
Versions
| QGIS version | 3.40.11-Bratislava |
| QGIS code revision | df059ed19c8 |
| |
| Libraries |
| Qt version | 5.15.8 |
| Python version | 3.11.2 |
| GDAL version | 3.6.2 |
| PROJ version | 9.1.1 |
| EPSG Registry database version | v10.076 (2022-08-31) |
| GEOS version | 3.11.1-CAPI-1.17.1 |
| SQLite version | 3.40.1 |
| PostgreSQL client version | 15.14 (Debian 15.14-0+deb12u1) |
| SpatiaLite version | 5.0.1 |
| QWT version | 6.1.4 |
| QScintilla2 version | 2.13.3 |
| OS version | Debian GNU/Linux 12 (bookworm) |
| |
| Active Python plugins |
| grassprovider | 2.12.99 |
| MetaSearch | 0.3.6 |
| db_manager | 0.1.20 |
| processing | 2.12.99 |
Supported QGIS version
New profile
Additional context
No response
What is the bug or the crash?
Running
layer_property (layer, 'type')in a QGIS expression returns a different string result depending on the language selected in QGIS.This make expression very prone to breakage, eg: I am developing an expression on a machine in American English, and my users experience bugs because their machine are in another language.
Example:
layer_property (layer, 'type')returns'Vector'layer_property (layer, 'type')returns'Vecteur'Steps to reproduce the issue
layer_property (@layer, 'type'), this should output'Vector'layer_property (@layer, 'type')should output'Vecteur'Versions
Supported QGIS version
New profile
Additional context
No response