D10446: Add KLanguageName

Harald Sitter noreply at phabricator.kde.org
Tue Jan 8 10:30:57 GMT 2019


sitter added inline comments.

INLINE COMMENTS

> aacid wrote in klanguagename.cpp:30
> should the second param be code too?
> 
> I mean if we read the docs we say both are code (ISO 639-1), so both should be the same and not only the first part?

Do you mean both being **a** code or both being **the** code?

a code
======

`parts.at(0)` is the code of the current locale. The only way I found to get the 639 code from qlocale is by splitting name http://doc.qt.io/qt-5/qlocale.html#name

Perhaps a comment is needed to explain this?

the code
========

Both params being the variable `code` wouldn't be right I think. The documentation for `nameForCode` says it will ideally give you the localized name of code in the system language.

  LANGUAGE=en nameForCode('en') => 'English'
  LANGUAGE=fr nameForCode('en') => 'anglaise'

which internally is

  nameForCodeInLocale('en', 'en')
  nameForCodeInLocale('en', 'fr')

REPOSITORY
  R265 KConfigWidgets

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

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/20190108/4544d808/attachment.html>


More information about the Kde-frameworks-devel mailing list