Page MenuHomePhabricator

Don't set language-specific data attributes in IPInfo widget
Closed, ResolvedPublic1 Estimated Story Points

Description

Background

The IPInfo widget displays IP information using lists. Data attributes are added to list items to identify what type of IP information they are. One use-case is adding specific styling for different properties, e.g. removing list styling for "Real IP/Proxy" data: https://gerrit.wikimedia.org/g/mediawiki/extensions/IPInfo/+/4c51721c2703f189aac2d4a2d0d9ea34deb0865f/modules/ext.ipInfo/ipinfo.less#52

The data attribute should be language agnostic, however it is currently being set to an English translation. An example bug is that the list styling is not removed for the real/proxy data if the language is not English:

EnglishFrench
image.png (168×151 px, 9 KB)
image.png (166×202 px, 12 KB)
Acceptance criteria
  • Set the data attribute to some string instead of an English translation
  • Also check this string when logging which help icon was clicked on, instead of re-translating a message here.
Notes

This might require passing a type string into ipInfoWidget#generatePropertyMarkup, where the data attribute is set, rather than passing in a message translation. See: https://gerrit.wikimedia.org/g/mediawiki/extensions/IPInfo/+/4c51721c2703f189aac2d4a2d0d9ea34deb0865f/modules/ext.ipInfo/widget.js#122

Event Timeline

AGueyte set the point value for this task to 1.Apr 11 2022, 3:27 PM

Change 779135 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/IPInfo@master] Pass a hardcoded property key for use in the data attribute

https://gerrit.wikimedia.org/r/779135

Change 779135 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Pass a hardcoded property key for use in the data attribute

https://gerrit.wikimedia.org/r/779135

dom_walden subscribed.

I compared the HTML of the infobox and the popup in 2-3 different languages. The HTML markup (attributes, data-properties, etc.) was always the same.

I also checked that the infobox help popups still work.

I cannot reproduce the bug in the description when looking at the infobox in French:

french_proxytype.png (206×279 px, 12 KB)

Test environment: https://test.wikipedia.org IP Info 0.0.0 (090d340) 08:06, 18 April 2022.