[backport 0.14] common: Fix translation loading, use all paths #607
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In short
QTranslator
loading Qt translations on Linuxdirectory
inload()
, not asprefix
:/i18n/
)Details
As of 0.14.0, the Windows installer for Quassel places the Qt translations into
C:\Program Files\Quassel IRC\translations
folder, while Quassel's own translations are bundled internally in:/i18n/
.Before this change, Quassel would only try to load translations from one possible data path, missing the bundled translations in
:/i18n/
.After this change, Quassel tries to load translations from all available data paths, including the bundled translations when present.
Testing
Steps
Windows.zip
artifact from GitHub ActionsSettings
→Configure Quassel…
Language:
drop-down, check that expected languages are presentBefore
Linux
Qt translations fail to load according to the
false
return status ofqtTranslator->load(…)
withQLibraryInfo::location(QLibraryInfo::TranslationsPath)
.Windows
All translations fail to load.
The
Language:
setting in the configuration window displays<Untranslated>
,<System Default>
, andC
as the only options.After
Linux
Qt translations successfully load according to the
true
return status ofqtTranslator->load(…)
withQLibraryInfo::location(QLibraryInfo::TranslationsPath)
.NOTE: For unknown reasons, even when Qt claims the translation loaded successfully, system strings (e.g. the
Cancel
button) does not get translated. Quassel's strings change successfully. This is not a regression as the same issue happens on themaster
branch.Windows
Translations load and apply to both Quassel's strings and Qt's system strings (e.g. the
Cancel
button).The
Language:
setting in the configuration window displays all the expected language options.The
Debug Log
window now prints the following debug message:Testing has been repeated with the
0.14
branch Windows artifact. Linux and before tests have not been repeated.