Bug 488083 - en_CA.UTF-8 locale shows A4 paper as "Standard format for Canadian English"
Summary: en_CA.UTF-8 locale shows A4 paper as "Standard format for Canadian English"
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_regionandlang (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-05 16:54 UTC by tquidca@gmail.com
Modified: 2024-06-22 05:42 UTC (History)
2 users (show)

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


Attachments
Screenshot of paper size setting (12.45 KB, image/png)
2024-06-05 16:54 UTC, tquidca@gmail.com
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tquidca@gmail.com 2024-06-05 16:54:07 UTC
Created attachment 170176 [details]
Screenshot of paper size setting

SUMMARY


STEPS TO REPRODUCE
1. Open System Settings
2. Select "Region & Language"
3. See "Paper Size"

OBSERVED RESULT

A4 paper is shown.

EXPECTED RESULT

Canada uses US Letter-size paper so it should show that.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 6.9.3-arch1-1 (64-bit)
(available in About System)
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION
Comment 1 hanyoung 2024-06-09 15:03:11 UTC
Confirmed, we currently decide paper size with measurement system, QLocale::ImperialUSSystem and QLocale::ImperialSystem are treated as "Letter", the rest "A4". Qt doesn't provide a direct method to determine paper size from locale.
Comment 2 tquidca@gmail.com 2024-06-09 17:04:14 UTC
Hm, so should this be a bug in Qt then?
Comment 3 hanyoung 2024-06-10 03:32:55 UTC
I don't think so, but if Qt exposes Paper size via QLocale API, this bug can be fixed with ease.
Comment 4 Nate Graham 2024-06-10 17:22:28 UTC
So it's not so much that this is a bug in Qt, but an omission in Qt causes us to do something ourselves and therefore introduce the bug.

Since the code is under our control, we could add an exception to this code that says "Use Letter if the locate is Canada". It would be ugly, but feasible. And then we can remove it once Qt grows the functionality we need.
Comment 5 hanyoung 2024-06-12 13:26:24 UTC
I ran a script across locales available on Arch Linux, it seems the locales below all suffers from the same problem:
en_CA
en_PH
es_BO
es_CL
es_CO
es_CR
es_GT
es_MX
es_NI
es_PA
es_PR
es_SV
es_VE
fil_PH
fr_CA
ik_CA
iu_CA
miq_NI
nhn_MX
shs_CA
tl_PH
Comment 6 Bug Janitor Service 2024-06-16 06:10:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4458
Comment 7 hanyoung 2024-06-18 05:10:52 UTC
Git commit c7421fcd8823c595f047fab64c14d075db008b2b by Han Young.
Committed on 18/06/2024 at 05:10.
Pushed by hanyoung into branch 'master'.

kcm_regionandlang: fix incorrect paper size example for some locales

kcm_regionandlang: fix incorrect paper size example for some locales

We decide paper size with measurement system, QLocale::ImperialUSSystem and QLocale::ImperialSystem are treated as "Letter", the rest "A4". Qt doesn't provide a direct method to determine paper size from locale. However, some locales use metric measurement system but Letter for paper size. Put these locales in a QSet and return 'Letter' for paper size example.

M  +28   -1    kcms/region_language/exampleutility.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/c7421fcd8823c595f047fab64c14d075db008b2b
Comment 8 hanyoung 2024-06-18 05:33:29 UTC
Git commit fb7f8557cc14a190f0ef5f8dd0c166b224446cc3 by Han Young.
Committed on 18/06/2024 at 05:33.
Pushed by hanyoung into branch 'Plasma/6.1'.

kcm_regionandlang: fix incorrect paper size example for some locales

<!-- Thank you for submitting a merge request to make KDE Software better! Use the information from the commit message(s) to fill in the template below.

### Original commit message(s)

* kcm_regionandlang: fix incorrect paper size example for some locales

kcm_regionandlang: fix incorrect paper size example for some locales

We decide paper size with measurement system, QLocale::ImperialUSSystem and QLocale::ImperialSystem are treated as "Letter", the rest "A4". Qt doesn't provide a direct method to determine paper size from locale. However, some locales use metric measurement system but Letter for paper size. Put these locales in a QSet and return 'Letter' for paper size example.


(cherry picked from commit c7421fcd8823c595f047fab64c14d075db008b2b)

eaf58e75 kcm_regionandlang: fix incorrect paper size example for some locales
75ff8016 Apply 1 suggestion(s) to 1 file(s)
979cd1d8 improve readability

Co-authored-by: Han Young <hanyoung@protonmail.com>

(For future reference, follow the guidelines at https://cbea.ms/git-commit/#seven-rules)
-->


### Reason for the change

<!--
If this merge request change is resolving a problem, describe the problem and explain why the approach taken here is the correct way to resolve it.

If the merge request adds a new feature or UI change, explain the benefits of the change.
-->

### Test plan

<!--
Extend any related autotests with new test cases to validate your changes. If none exist, consider adding one if you have the technical skills to do so.

Otherwise, at least describe how you tested the change, and how someone reviewing this merge request can test it themselves. No need to mention obvious things like "Apply the changes".
-->

### Screenshots or screen recordings

<!--
If this merge request introduces a visual change, please add before-and-after screenshots in the following format:

| Before | After |
| ------ | ----- |
| [drag "before" screenshot here] | [drag "after" screenshot here] |
-->

### Bugs fixed

<!--
If the changes in this merge request fix any Bugzilla tickets, add the following keyword for each one:
-->

M  +28   -1    kcms/region_language/exampleutility.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/fb7f8557cc14a190f0ef5f8dd0c166b224446cc3