Page MenuHomePhabricator

TypeaheadSearch component: Localization issue on quotation marks
Closed, ResolvedPublic3 Estimated Story Points

Description

Background

Could you please add support for different quotation marks in Vector modern when searching? For example, the Czech language use „ and “ and the Russian language use « and ». Right now it is " and " (see the file from Beta Cluster) and it cannot be changed at translatewiki.net.

image.png (153×533 px, 7 KB)

Acceptance criteria

  • Remove quotation marks as representation is acceptable without them and technical heavy-lifting of making them localizable is better circumvented. See T277534#7062844 onwards

QA Results - Beta

ACStatusDetails
1T277534#7147693

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Volker_E renamed this task from Support for translate of quotation marks in New Vector to Support for translate of quotation marks in Vector modern's Typeahead Search.Mar 17 2021, 7:48 PM
Volker_E updated the task description. (Show Details)
Volker_E added a project: I18n.
This comment was removed by Jdlrobson.

This requires a change to wvui wvui-typeahead-search component. We likely need to add a new parameter to replace footer-search-text which is a function that takes a search term as the parameter. The message would then need to take care of the bolding and quotes.

https://github.com/wikimedia/wvui/blob/master/src/components/typeahead-search/TypeaheadSearch.vue#L86

e.g.
the following in Vector

:footer-search-text="$i18n('searchsuggest-containing').escaped()"

becomes:

:footer-search-fn="getFooterText"

where getFooterText:

getFooterText(searchTerm) {

  return mw.msg('searchsuggest-containing', searchTerm).parse()
}

Since we'll be generating HTML, we should be careful of introducing security vulnerabilities.

Change 685456 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/skins/Vector@master] search: Define footer text gen function

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

Change 685457 had a related patch set uploaded (by Phuedx; author: Phuedx):

[wvui@master] [typeahead-search] Accept footer text gen function

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

@alexhollender: Could you confirm whether the quotation marks are necessary in the treatment? I ask because there's some heavy lifting involved in making them localisable.

WVUI tries to be as agnostic of MediaWiki as possible, including being agnostic of MediaWiki's i18n/l10n services. Currently, we have to parse and pass in the messages from MediaWiki to the WVUI component(s) that we're using. For this task, we have to go a step further and pass a function that parses a message; and we have to use the v-html Vue.js directive to use the result of the function, which is advised against.

@alexhollender: Could you confirm whether the quotation marks are necessary in the treatment? I ask because there's some heavy lifting involved in making them localisable.

WVUI tries to be as agnostic of MediaWiki as possible, including being agnostic of MediaWiki's i18n/l10n services. Currently, we have to parse and pass in the messages from MediaWiki to the WVUI component(s) that we're using. For this task, we have to go a step further and pass a function that parses a message; and we have to use the v-html Vue.js directive to use the result of the function, which is advised against.

quotation marks not necessary : ) happy to remove them altogether

Change 685457 abandoned by Phuedx:

[wvui@master] [typeahead-search] Accept footer text gen function

Reason:

No longer needed per https://phabricator.wikimedia.org/T277534#7069805

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

Change 685456 abandoned by Phuedx:

[mediawiki/skins/Vector@master] search: Define footer text gen function

Reason:

No longer needed per https://phabricator.wikimedia.org/T277534#7069805

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

Change 688335 had a related patch set uploaded (by Phuedx; author: Phuedx):

[wvui@master] [typeahead-search] Remove quotation marks from footer

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

Volker_E renamed this task from Support for translate of quotation marks in Vector modern's Typeahead Search to TypeaheadSearch componenent: Localization issue on quotation marks.May 10 2021, 3:16 PM
Volker_E updated the task description. (Show Details)

Happy for this simpler way. Thanks @phuedx and @alexhollender.


My message that wasn't sent from a few days ago drafted here:

Should we translate the quotes or remove them entirely?
Google doesn't use quotes anywhere (looked at English and German).
Advanced Search isn't using them.

Change 688335 merged by jenkins-bot:

[wvui@master] [typeahead-search] Remove quotation marks from footer

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

phuedx moved this task from Code Review to QA on the Readers-Web-Backlog (Kanbanana-FY-2020-21) board.
phuedx added a subscriber: phuedx.
Volker_E renamed this task from TypeaheadSearch componenent: Localization issue on quotation marks to TypeaheadSearch component: Localization issue on quotation marks.May 10 2021, 5:40 PM
Edtadros added a subscriber: Edtadros.

@phuedx I had moved this from Needs QA to Needs QA in Prod because I thought it was already in Prod but I don't see a version tag so I don't think it is. I am assuming that the fix is the elimination of the quotation marks. I still see them in Beta and Prod

Beta

Screen Shot 2021-05-14 at 7.36.07 AM.png (653×558 px, 135 KB)

Prod

Screen Shot 2021-05-14 at 7.36.07 AM.png (653×558 px, 135 KB)

@Edtadros The WVUI release including this change has not been cut, hence not yet in beta or production.

Change 697700 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/core@master] Update wvui to 0.2.0

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

Change 697700 merged by jenkins-bot:

[mediawiki/core@master] Update wvui to 0.2.0

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

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

✅ AC1: The "Search for pages containing" item in the search suggestions should not contain any quotation marks.

Screen Shot 2021-06-09 at 10.42.23 PM.png (168×801 px, 35 KB)

Assigning to you per standup.

This can be QAed in production today.

Nice, seems to work! Now I found a new problem though (might also be caused by the change due to T280982): the search term is not wrapped and long ones are visible outside of the dropdown now. I do believe that was different before, but I wouldn’t bet on it, since I used custom CSS on the whole dropdown; might be a new issue entirely.

Nice, seems to work! Now I found a new problem though (might also be caused by the change due to T280982): the search term is not wrapped and long ones are visible outside of the dropdown now. I do believe that was different before, but I wouldn’t bet on it, since I used custom CSS on the whole dropdown; might be a new issue entirely.

Not sure I completely understand this one. Could you give some replication steps for this? This is what I'm seeing for long search terms:

Screen Shot 2021-06-16 at 11.27.39 AM.png (296×1 px, 68 KB)

Pushing back to needs more work for now as I assume there is more left to do here.

Interesting. So this part is supposed to use hyphens instead of word-break? I would suggest to be consistent everywhere, but no idea if this is the root cause. For me it looks like in this screenshot; I use Chrome, there should be nothing else causing trouble.

Screenshot dewiki search 2021-06-16.jpg (753×1 px, 252 KB)

The browser notes invalid property value here for both hyphens: auto and -webkit-hyphens: auto.

Okay yeh I can replicate this now (screenshot was in Firefox, but can see this in Chrome).

Generally, I'm not seeing this in production, locally, or on the Beta Cluster.

EnvironmentScreenshot
Local (MediaWiki master, Vector master)
Screenshot 2021-06-21 at 11.35.47.png (127×395 px, 16 KB)
Beta Cluster (MediaWiki master, Vector master)
Screenshot 2021-06-21 at 11.36.16.png (116×614 px, 23 KB)
enwiki (MediaWiki wmf/1.37.0-wmf.9, Vector wmf/1.37.0-wmf.9)
Screenshot 2021-06-21 at 12.08.55.png (103×540 px, 19 KB)

However, I do see it in production when the interface language is different from the content language. I don't believe that this could be caused by the removal of the " characters (see https://gerrit.wikimedia.org/r/c/wvui/+/688335/). I'll reopen T280982: Suggestions in new Vector search form should wrap long words and write this up there.

@XanonymusX we'll be looking at the overflow issue as part of T280982

signing off on this ticket - lgtm on prod

Screen Shot 2021-06-25 at 12.47.53 PM.png (1×1 px, 466 KB)