[Interest] QTranslator.load and builtin translations

Jérôme Laheurte jerome at jeromelaheurte.net
Tue Aug 18 17:21:20 CEST 2020



> Le 18 août 2020 à 17:06, Giuseppe D'Angelo via Interest <interest at qt-project.org> a écrit :
> 
> 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/internationalization.html#example-basic-qt-modules

This. How the hell did I miss this after two hours of googling. Still had to explicitely specify the path to QLibraryInfo.TranslationsPath; the example could be a little better, but everything’s fine now.

Thanks!

Best regards
Jérôme Laheurte



More information about the Interest mailing list