[Interest] QTranslator.load and builtin translations
Giuseppe D'Angelo
giuseppe.dangelo at kdab.com
Tue Aug 18 17:06:23 CEST 2020
Il 18/08/20 16:28, Jérôme Laheurte ha scritto:
> The « split(‘-‘)[0] » part looks like a big code smell to me, but what should I do ?
There's no need, load() should already do the split internally and
search for the right thing. Maybe you just need to load "qtbase_" (or
specify "_" as the prefix string). See
> https://doc.qt.io/qt-5/qtranslator.html#load-1
> https://doc.qt.io/qt-5/internationalization.html#example-basic-qt-modules
> https://www.kdab.com/fixing-a-common-antipattern-when-loading-translations-in-qt/
HTH,
--
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200818/33af103f/attachment.bin>
More information about the Interest
mailing list