Review Request 118564: Fix locale-aware reading in KDesktopFile

Matthew Dawson matthew at mjdsystems.ca
Sat Jun 7 04:33:40 UTC 2014



> On June 6, 2014, 7:21 a.m., John Layt wrote:
> > src/core/kconfig.cpp, line 98
> > <https://git.reviewboard.kde.org/r/118564/diff/1/?file=279088#file279088line98>
> >
> >     The bcp47Name() is a complicated beast that could add lots of other bits on like script to use, etc.  I would stick with name() as it is documented in Qt to always return language_COUNTRY, so "QLocale().name().split('_').at(0)". I'll remember to add the needed languageCode() api for QT 5.4.

Not that this would block, but I was trying to understand this when I saw the RR.  I was reading this page: http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s04.html , which would suggest that we should take the full version and search more specifically.  Is my reading of this correct?

I was actually wondering if bcp47Name() was correct, as it appears to be similar to Posix.  It's just that KConfig doesn't search the file correctly.  Am I correct there?  Is there a better QLocale function to get something more Posix correct?  I'm new to dealing with internationalization, so I apologize for stupid questions.

Regardless, this won't block the patch.  I rather have 90% functionality working then 20% that is more "correct".


- Matthew


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118564/#review59415
-----------------------------------------------------------


On June 6, 2014, 7:43 a.m., Martin Gräßlin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118564/
> -----------------------------------------------------------
> 
> (Updated June 6, 2014, 7:43 a.m.)
> 
> 
> Review request for KDE Frameworks and John Layt.
> 
> 
> Repository: kconfig
> 
> 
> Description
> -------
> 
> Fix locale-aware reading in KDesktopFile
> 
> The underlying KConfig used QLocale::name() for getting the locale
> aware part. But this returns "de_DE" while the desktop files store
> "de".
> 
> In addition it constructs a QLocale object instead of using the
> system locale. This has the advantage that the usage of
> QLocale::setDafault() gets honored by KConfig.
> 
> 
> Diffs
> -----
> 
>   autotests/kconfigtest.cpp 2b6de0d7d63df6aee69210aa09418628f0b8110a 
>   autotests/kdesktopfiletest.h d57351fd6edcefd6a0efd9126e454546cfc63b55 
>   autotests/kdesktopfiletest.cpp 494a43c0fb5808a261b9beb56cdc4afd8580ab21 
>   src/core/kconfig.cpp ea9746c001e235529a1cdd5865b9e1b5c129b56a 
> 
> Diff: https://git.reviewboard.kde.org/r/118564/diff/
> 
> 
> Testing
> -------
> 
> added unit test failed before. I'm not 100 % sure whether using bcp47Name is correct.
> 
> 
> Thanks,
> 
> Martin Gräßlin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140607/28d08178/attachment.html>


More information about the Kde-frameworks-devel mailing list