SUMMARY Documentation says "If \p languages is empty, original message is returned." which is not actually what's happening. OBSERVED RESULT `label.toString(QStringList());` returns the localized string when I have LANGUAGE=de EXPECTED RESULT Returned value should be the original input string. ADDITIONAL INFORMATION The use case is in kinfocenter's about system module, which offers the ability to copy a textual dump to clipboard when the current system language is not english (i.e. an auto-untranslate feature if you will). Currently this is hardcoded but would be nice to just use KLS I suppose.
Reproduced with https://invent.kde.org/plasma/kinfocenter/-/blob/master/Modules/about-distro/src/Entry.cpp#L43 Using an empty list as argument returns the German Strings for me. Documentation: https://api.kde.org/frameworks/ki18n/html/classKLocalizedString.html Probably relevant part of the implementation: https://api.kde.org/frameworks/ki18n/html/klocalizedstring_8cpp_source.html#l00530
*** Bug 453313 has been marked as a duplicate of this bug. ***
Still relevant today. I browsed source code, and tracked this problem down to the definition of `KFormatPrivate::formatByteSize`: it uses a bunch of unqualified tr() calls. The function tr() is declared by Q_DECLARE_TR_FUNCTIONS(KFormat), and delegates actual work to QCoreApplication::translate() which uses globally installed QTranslator object.