QmlPreview: Load QML translations from qrc context URLs
ProxyTranslator::setLanguage() built the translation directory with
QUrl::toLocalFile(), which returns an empty string for qrc: URLs. When
the context URL pointed into resources, the .qm files were searched in
"/i18n" and never loaded, so no QML translation was applied.
This broke tst_qqmldebugtranslationservice on HarmonyOS, where test
data is built into resources and the data directory URL is
"qrc:/data/": all strings were reported as missing translations and no
elide warnings were produced.
Use QQmlFile::urlToLocalFileOrQrc() so that both local file and qrc
context URLs resolve to a path QTranslator::load() can handle.
Fixes: QTBUG-151215
Fixes: QTBUG-151216
Fixes: QTBUG-151217
Pick-to: 6.12
Change-Id: If8a647d48172448bf8823690699e711178c0707f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>