Summary: | en_CA.UTF-8 locale shows A4 paper as "Standard format for Canadian English" | ||
---|---|---|---|
Product: | [Applications] systemsettings | Reporter: | tquidca <tquidca> |
Component: | kcm_regionandlang | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | hanyoung, nate |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-workspace/-/commit/fb7f8557cc14a190f0ef5f8dd0c166b224446cc3 | Version Fixed In: | 6.1.1 |
Sentry Crash Report: | |||
Attachments: | Screenshot of paper size setting |
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. Hm, so should this be a bug in Qt then? I don't think so, but if Qt exposes Paper size via QLocale API, this bug can be fixed with ease. 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. 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 A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4458 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 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 |
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