Bug 428026 - Font chooser tooltip incorrectly uses title case (also for non-English locales)
Summary: Font chooser tooltip incorrectly uses title case (also for non-English locales)
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_fonts (show other bugs)
Version: 5.20.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Nate Graham
URL:
Keywords:
: 431130 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-10-20 16:34 UTC by Karl Ove Hufthammer
Modified: 2021-01-04 21:00 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21


Attachments
Screenshot showing tooltip (in Norwegian Nynorsk locale) (124.15 KB, image/png)
2020-10-20 16:36 UTC, Karl Ove Hufthammer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Ove Hufthammer 2020-10-20 16:34:25 UTC
SUMMARY
When hovering over the ‘select font’ buttons, the tooltip is shown using automatically generated title case. This is incorrect for most non-English languages.


STEPS TO REPRODUCE
1. Open the font dialog.
2. Hover the mouse pointer over one of the ‘select font’ buttons (e.g. the ‘Fixed with’ one).
3. Observe the tooltip (see attached screenshot).

OBSERVED RESULT
The tooltip is shown in title case. For example, using the Norwegian Nynorsk locale, the tooltip is shown as ‘Vel «Fast Breidd»-Skrift’.

EXPECTED RESULT
The tooltip should use normal case. For example, using the Norwegian Nynorsk locale, the ‘Breidd’ should be shown as ’breidd’ and ‘Skrift’ as ‘skrift’.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20201014
KDE Plasma Version: 5.20.0
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1
Kernel Version: 5.8.14-1-default
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-2500 CPU @ 3.30GHz
Memory: 15.6 GiB of RAM
Graphics Processor: GeForce GTX 1060 3GB/PCIe/SSE2


ADDITIONAL INFORMATION
This is *not* an error in the translation. In the translation for Norwegian Nynorsk, the string ‘Select %1 Font...’ is translated as ‘Vel «%1»-skrift …’ (i.e., with a lowercase ‘skrift’). (The quotation marks are needed since otherwise the resulting string, ‘Vel Fast breidd-skrift’, would be ungrammatical. It really should have been ‘Vel fastbreiddeskrift’, which is not possible to write with current implementation.)
Comment 1 Karl Ove Hufthammer 2020-10-20 16:36:00 UTC
Created attachment 132589 [details]
Screenshot showing tooltip (in Norwegian Nynorsk locale)
Comment 2 Nate Graham 2020-10-21 02:34:52 UTC
Yeah this is a bit of a string puzzle:

text: i18n("Select %1 Font...", label.replace(':', ''))
Comment 3 Nate Graham 2020-10-21 02:38:13 UTC
I'll fix it.
Comment 4 Bug Janitor Service 2020-10-21 02:50:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/376
Comment 5 Nate Graham 2020-10-21 19:23:42 UTC
Git commit 9d252c407125dc1d05e5cc7cd69ba39bf93d2354 by Nate Graham.
Committed on 21/10/2020 at 19:23.
Pushed by ngraham into branch 'master'.

[kcms/fonts] Fix string puzzle in font chooser tooltips

These tooltips' text was built up by embedding one string inside
another, which is a recipe for string puzzles. Instead let's assign
the whole text individually, which will allow translators to
translate the entire string properly.
FIXED-IN: 5.21

M  +2    -3    kcms/fonts/package/contents/ui/FontWidget.qml
M  +6    -0    kcms/fonts/package/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-workspace/commit/9d252c407125dc1d05e5cc7cd69ba39bf93d2354
Comment 6 Nate Graham 2021-01-04 21:00:57 UTC
*** Bug 431130 has been marked as a duplicate of this bug. ***