Jump to content

Topic on Project:Support desk/Flow

MobileFrontend less compiler issue lazy load images

4
Captain007 (talkcontribs)

MediaWiki 1.35

MobileFrontend 2.3.0

MinervaNeue - fc8ac05


On mobile view I currently experience an issue with lazy loading images (especially in sections of articles). These are not loading due to an Less compile error:

Less_Exception_Compiler from line 49 of /var/www/wiki/vendor/wikimedia/less.php/lib/Less/Tree/Variable.php: variable @msg-mobile-frontend-tap-to-display-image is undefined in file /var/www/wiki/extensions/MobileFrontend/resources/mobile.init/mobile.less in mobile.less on line 27, column 11

25| // Tap to click pattern

26| .lazy-image-placeholder--tap:before {

27| content: '@{msg-mobile-frontend-tap-to-display-image}';

28| color: @colorGray7;

29| text-align: center;

30| font-size: 0.75em;


I have no clue what can cause this behavior. Which component is responsible for setting the variable msg-mobile-frontend-tap-to-display-image? I have a hunch it might be a composer component or so which is not installed on the server somehow. As a workaround I just disabled lazy loading on MobileFrontend, but at the end I want to get rid of this and a working lazy loading behavior for mobile devices. Any idea how to solve this issue?

Bawolff (talkcontribs)

check your version of mobilefrontend corresponds to your version of mediawiki.

Captain007 (talkcontribs)

I installed the version which should be for 1.35 (1421405)

Captain007 (talkcontribs)

Found the root cause. For some reason the message from the json files containing translations is not properly falling back to English. I use Dutch as main language and there is not translation in nl.json for the string mobile-frontend-tap-to-display-image present. I added it now manually and now the LESS compiler picks it up correctly. I think at least some proper translations for this string should be added for all languages that are offered!