Bug 466894

Summary: AutoCorrectionLanguage widget shows entries in lowercase
Product: [Frameworks and Libraries] ktextaddons Reporter: Raphael Kubo da Costa <rakuco>
Component: generalAssignee: Laurent Montel <montel>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Flatpak   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: KMail screenshot

Description Raphael Kubo da Costa 2023-03-05 15:11:23 UTC
Created attachment 157015 [details]
KMail screenshot

This does not match the KDE HIG (https://develop.kde.org/hig/components/editing/combobox/ and https://develop.kde.org/hig/style/writing/capitalization/) and makes users like KMail's "Autocorrection language" option look weird.

See the attached screenshot and how the options for "Dictionary" and "Autocorrection language" differ.
Comment 1 Laurent Montel 2023-03-05 17:48:48 UTC
Hi,
this list comes from QLocale.
QString languageName = nativeName.isEmpty() ? QLocale::languageToString(lang.language()) : nativeName;

I don't see how to fix it.
Comment 2 Raphael Kubo da Costa 2023-03-05 18:33:11 UTC
The next line does

            languageName = languageName.toLower();

although QLocale::nativeLanguageName() returns a string that might or might not be capitalized (e.g. it returns "American English" but "français").

I'm not sure if it makes sense to do what the Sonnet combobox for the Dictionary option does, which is not call toLower(). That would lead to a combobox with inconsistent capitalization in the entries (just like Sonnet's), otherwise I guess you could just capitalize each word, or at least the first one?
Comment 3 Laurent Montel 2023-03-05 18:55:59 UTC
(In reply to Raphael Kubo da Costa from comment #2)
> The next line does
> 
>             languageName = languageName.toLower();
> 
> although QLocale::nativeLanguageName() returns a string that might or might
> not be capitalized (e.g. it returns "American English" but "français").
> 
> I'm not sure if it makes sense to do what the Sonnet combobox for the
> Dictionary option does, which is not call toLower(). That would lead to a
> combobox with inconsistent capitalization in the entries (just like
> Sonnet's), otherwise I guess you could just capitalize each word, or at
> least the first one?

but In language as arabic/corean etc. I don't know if it's possible to do it etc.
Comment 4 Raphael Kubo da Costa 2023-03-05 20:00:20 UTC
Doesn't that also apply to lowercasing everything like it's currently done, in which case it might be better to just provide a mix of capitalized and non-capitalized entries as returned by QLocale?