Maps icon indicating copy to clipboard operation
Maps copied to clipboard

Make content-language-bounded messages display in user interface language

Open winstonsung opened this issue 2 years ago • 9 comments

Make content-language-bounded messages display in user interface language

This fix the issue that the system message "maps-geo-json-create-page-button", "maps-loading-map" cannot display in language variants ("page view language" aka "user language variant", see Manual:Language on MediaWiki.org )

Bug: #694

winstonsung avatar May 13 '22 10:05 winstonsung

CC @JeroenDeDauw

winstonsung avatar May 13 '22 10:05 winstonsung

Codecov Report

Merging #695 (1ea2ee4) into master (2d18ff1) will not change coverage. The diff coverage is n/a.

:exclamation: Current head 1ea2ee4 differs from pull request most recent head 053c0bc. Consider uploading reports for the commit 053c0bc to get more accurate results

@@            Coverage Diff            @@
##             master     #695   +/-   ##
=========================================
  Coverage     50.23%   50.23%           
  Complexity      840      840           
=========================================
  Files            77       77           
  Lines          2817     2817           
=========================================
  Hits           1415     1415           
  Misses         1402     1402           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2d18ff1...053c0bc. Read the comment docs.

codecov-commenter avatar May 14 '22 08:05 codecov-commenter

I'm not sure this is correct. Especially maps-loading-map, which definitely ends up in the parser cache.

@Nikerabbit

JeroenDeDauw avatar May 14 '22 08:05 JeroenDeDauw

I was considering using "page view language" rather than just using "user interface language" in namespaces with wikitext content modal, but there's no "page language"-related variables passed in, causing the complexity to implement it.

winstonsung avatar May 14 '22 10:05 winstonsung

It seems the CI already failed for "PHPUnit: MW master, PHP 8.1" before this commit?

3b585b3 Localisation updates from https://translatewiki.net. https://github.com/ProfessionalWiki/Maps/runs/6404720045

winstonsung avatar May 14 '22 11:05 winstonsung

wfMessage is implicit global state. Ideal solution would be to pass the correct language somehow.

Nikerabbit avatar May 15 '22 15:05 Nikerabbit

wfMessage is implicit global state. Ideal solution would be to pass the correct language somehow.

Yes sure. But is the change in this PR correct or not?

It seems the CI already failed for "PHPUnit: MW master, PHP 8.1" before this commit?

Indeed, don't worry about that failure

JeroenDeDauw avatar May 15 '22 23:05 JeroenDeDauw

I can't tell because I am not familiar with the code. Most likely not though, if this is ending up in the parser cache without fragmenting it by language.

Nikerabbit avatar May 20 '22 08:05 Nikerabbit

I would prefer only by language variants, but I have no idea how to pass the current language variant based on page language.

winstonsung avatar Jul 25 '22 13:07 winstonsung