D10446: Add KLanguageName

Harald Sitter noreply at phabricator.kde.org
Sat Dec 15 15:53:19 GMT 2018


sitter updated this revision to Diff 47623.
sitter added a subscriber: hein.
sitter added a comment.


  iterating the diff a bit as mentioned in a comment.
  
  - new unit test which covers all likely scenarios (I think). this uses fixtures and doesn't require anything to be installed etc.
  - the specific func now calls the generic to resolve into current-language. this requires some string mangling as qlocale apparently has no way to get the ISO639-1 string directly
  - some refinement on the english-check resolution: now returns the kconfig resolved name iff it is different from english and it is not english (previously this was a bit bugged for english itself)
  - some refinement on the qlocale fallback: now returns immediately when a final result is found (simplifies code a bit)
  - a failed kconfig resolution (for whatever reason) now always continues onwards into the qlocale fallback. this effectively separates the kconfig portion entirely from the qlocale portion for ease of reading
  
  as mentioned in an earlier comment I am not too sure about giving out languageToString names and would rather have it always give out nativeLanguageNames. I am somewhat indifferent on the issue though, it's just a gut feeling is all.
  
  I should also note that I had a quick look at systemsettings and it also does exhaustive poking of QLocale to come up with reasonable prettynames for locales (and then fails in part). Perhaps @hein could take a look at this diff and see if it could be useful for the language KCM and/or give some thoughts on what may be needed to make that happen. For the record though: since KLanguageName exclusively deals with languages and the KCM AFAIK deals with locales there is no 100% overlap; perhaps there should be though.

REPOSITORY
  R265 KConfigWidgets

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D10446?vs=26943&id=47623

BRANCH
  arcpatch-D10446

REVISION DETAIL
  https://phabricator.kde.org/D10446

AFFECTED FILES
  autotests/CMakeLists.txt
  autotests/kf5_entry_data/locale/ca/kf5_entry.desktop
  autotests/kf5_entry_data/locale/de/kf5_entry.desktop
  autotests/kf5_entry_data/locale/en_US/kf5_entry.desktop
  autotests/kf5_entry_data/locale/fr/kf5_entry.desktop
  autotests/kf5_entry_data/locale/pt/kf5_entry.desktop
  autotests/klanguagenametest.cpp
  src/CMakeLists.txt
  src/klanguagename.cpp
  src/klanguagename.h

To: aacid
Cc: hein, kde-frameworks-devel, sitter, markg, apol, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20181215/c2d0adda/attachment.html>


More information about the Kde-frameworks-devel mailing list