Bug 467269 - LC_PAGE should be LC_PAPER?
Summary: LC_PAGE should be LC_PAPER?
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_regionandlang (show other bugs)
Version: 5.27.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-13 09:47 UTC by Stefan Becker
Modified: 2023-03-24 18:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.4
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Becker 2023-03-13 09:47:28 UTC
SUMMARY
The changes for Bug 420928 introduced LC_PAGE into the System Settings:

https://invent.kde.org/plasma/plasma-workspace/commit/73bfdcff3d7d16e648aaf9ea7630a3967376412e
https://invent.kde.org/plasma/plasma-workspace/commit/c7c2a3a85e5b7f74dcb2eadc35defe9e4b55c737

* they talk about paper size, not page size
* seem to read from LC_PAPER environment variable? (maybe I didn't understand the code correctly)
* write LC_PAGE to ./config/plasma-localerc instead of LC_PAPER

When I login to the desktop, open a console and execute "locale" I get LC_PAPER set to the default specified by LANG, instead of the KDE setting.

System Settings should either write LC_PAPER or write LC_PAPER & LC_PAGE into the configuration file. But as far as I can tell LC_PAGE is *not* an official locale category and should be dropped.

STEPS TO REPRODUCE
1. open System Settings
2. select a paper size different from the locale default (I selected "Suomi", i.e. paper size from finnish locale)
3. log out and in again
4. open konsole
5. run "locale" command

OBSERVED RESULT
# before change:
$ cat .config/plasma-localerc 
[Formats]
LANG=en_US.UTF-8
LC_ADDRESS=fi_FI.UTF-8
LC_MEASUREMENT=fi_FI.UTF-8
LC_MONETARY=fi_FI.UTF-8
LC_NAME=fi_FI.UTF-8
LC_TELEPHONE=fi_FI.UTF-8
LC_TIME=en_GB.UTF-8

# after change
$ cat .config/plasma-localerc 
[Formats]
LANG=en_US.UTF-8
LC_ADDRESS=fi_FI.UTF-8
LC_MEASUREMENT=fi_FI.UTF-8
LC_MONETARY=fi_FI.UTF-8
LC_NAME=fi_FI.UTF-8
LC_PAGE=fi_FI.UTF-8
LC_TELEPHONE=fi_FI.UTF-8
LC_TIME=en_GB.UTF-8

$ locale
LANG="en_US.UTF-8"
....
LC_PAPER="en-US.UTF-8"

EXPECTED RESULT
$ locale
LANG="en_US.UTF-8"
...
LC_PAPER="fi_FI.UTF-8"

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Linux 37
KDE Plasma Version: 5.27.2
KDE Frameworks Version: 5.103.0
Qt Version:  5.15.8
Comment 1 Stefan Becker 2023-03-13 09:57:26 UTC
Maybe further evidence that LC_PAGE is not the correct variable:

$ LC_PAGE= LC_PAPER= libreoffice                     -> print dialog shows "letter" as paper size (CORRECT for LANG=es_US.UTF-8)
$ LC_PAGE=fi_FI.UTF-8 LC_PAPER= libreoffice  -> print dialog shows "letter" as paper size (WRONG)
$ LC_PAGE= LC_PAPER=fi_FI.UTF-8 libreoffice  -> print dialog shows "A4" as paper size (CORRECT)
Comment 2 Nate Graham 2023-03-13 22:29:38 UTC
Whoops! It should indeed. Good catch.
Comment 3 Bug Janitor Service 2023-03-13 22:32:47 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2740
Comment 4 Nate Graham 2023-03-13 23:20:58 UTC
Git commit 7b7e70b2262285dbfc294cc6617f4c0787a61d5c by Nate Graham.
Committed on 13/03/2023 at 22:28.
Pushed by hanyoung into branch 'master'.

kcms/region_language: set LC_PAPER, not LC_PAGE

The correct name of this environment variable/format is "LC_PAPER."
We look for it by the correct name in kcmregionandlang.cpp, but not in
regionandlangsettingsbase.kcfg, causing a mismatch.
Related: bug 466861
FIXED-IN: 5.27.3

M  +1    -1    kcms/region_language/regionandlangsettingsbase.kcfg

https://invent.kde.org/plasma/plasma-workspace/commit/7b7e70b2262285dbfc294cc6617f4c0787a61d5c
Comment 5 hanyoung 2023-03-24 18:16:20 UTC
Git commit 27de75798ee19fc1629c99cc13ee08754e0c47bd by Han Young, on behalf of Nate Graham.
Committed on 13/03/2023 at 23:24.
Pushed by hanyoung into branch 'Plasma/5.27'.

kcms/region_language: set LC_PAPER, not LC_PAGE

The correct name of this environment variable/format is "LC_PAPER."
We look for it by the correct name in kcmregionandlang.cpp, but not in
regionandlangsettingsbase.kcfg, causing a mismatch.
Related: bug 466861
FIXED-IN: 5.27.3


(cherry picked from commit 7b7e70b2262285dbfc294cc6617f4c0787a61d5c)

M  +1    -1    kcms/region_language/regionandlangsettingsbase.kcfg

https://invent.kde.org/plasma/plasma-workspace/commit/27de75798ee19fc1629c99cc13ee08754e0c47bd