Describe the bug
Downloaded v2.8.4 for Windows. The system never ran MediaElch before. The system's language is German but MediaElch starts in English.
Expected behavior
MediaElch should start in German.
MediaElch Version:
Operating System:
My test when I install 2.8.4 (in Windows 10 Pro)
I will install the 2.8.5 dev
ITEM 2.8.4 (Edit) and 2.8.5_2021-01-15
Movies
TMDb Movies English
TMDb Concerts English
Universal Music Chinese
Fanart.tv Bulgarian
Series
TMDb TV English
The TvDB English
New Image
After setting the correct language in Settings.
Before and After restarting ME.
Movies
Poster Fanart.tv Portuguese
Poster TMDb English
Fanart Fanart.tv Portuguese
Fanart TMDb English
Series
Poster Fanart.tv Portuguese
Poster TheTvDB English
Fanart Fanart.tv Portuguese
Fanart TheTvDB English
Scraper Serie All Unchecked
Scraper Episode All Unchecked
2.8.5 dev exactly the same as 2.8.4
Windows 10 Pro
To exchange images, Fanart.tv respects what is selected in Settings.
But TMDb and TheTvDB do not respect it.
The good news is that all the translations came. :-)
I can now verify all the mistakes I made.
When I want a different poster than the one I have, I click on the poster and open the window.
Nothing happens when I change the language. They are always the same images.
Perhaps this problem is related.
I found the issue.
A fresh Windows 10 Education installtion for Germany has the following properties:
QLocale::system().uiLanguage() == ("de-DE", "en-US")
After reading https://doc.qt.io/qt-5/qtranslator.html#load-1 I would assume, that Qt looks at following files in the specified order:
MediaElch_de_DE.qmMediaElch_de.qmMediaElch_en_US.qmMediaElch_en.qmMediaElch.qmFor reference, this is from their documentation (2021-03-02):
For example, an application running in the locale with the following ui languages - "es", "fr-CA", "de" might call load(QLocale(), "foo", ".", "/opt/foolib", ".qm"). load() would replace '-' (dash) with '_' (underscore) in the ui language and then try to open the first existing readable file from this list:
/opt/foolib/foo.es.qm
/opt/foolib/foo.es
/opt/foolib/foo.fr_CA.qm
/opt/foolib/foo.fr_CA
/opt/foolib/foo.fr.qm
/opt/foolib/foo.fr
/opt/foolib/foo.de.qm
/opt/foolib/foo.de
/opt/foolib/foo.qm
/opt/foolib/foo.
/opt/foolib/foo
However, if I look at the documentation on Woboq: https://code.woboq.org/qt5/qtbase/src/corelib/kernel/qtranslator.cpp.html#746 we can see the Qt actually looks for:
MediaElch_de_DE.qmMediaElch_en_US.qmMediaElch_de.qmMediaElch_en.qmMediaElch.qmMediaElch_en_US.qm exists but MediaElch_de_DE.qm does not.
If I delete the en_US version (that I use for plurals), everything is back to normal...
For reference, the code:
For example, an application running in the \a locale with the following
\l{QLocale::uiLanguages()}{ui languages} - "es", "fr-CA", "de" might call
load(QLocale(), "foo", ".", "/opt/foolib", ".qm"). load() would
replace '-' (dash) with '_' (underscore) in the ui language and then try to
open the first existing readable file from this list:
\li \c /opt/foolib/foo.es.qm
\li \c /opt/foolib/foo.es
\li \c /opt/foolib/foo.fr_CA.qm
\li \c /opt/foolib/foo.fr_CA
\li \c /opt/foolib/foo.de.qm
\li \c /opt/foolib/foo.de
\li \c /opt/foolib/foo.fr.qm
\li \c /opt/foolib/foo.fr
\li \c /opt/foolib/foo.qm
\li \c /opt/foolib/foo.
\li \c /opt/foolib/foo
This is the relevant code: https://github.com/qt/qtbase/blame/40143c189b7c1bf3c2058b77d00ea5c4e3be8b28/src/corelib/kernel/qtranslator.cpp#L757
This was fixed in Qt6 (and Qt5.15 for commercial users), see