Page MenuHomePhabricator

Change search placeholder and tooltip text to "Search"
Closed, ResolvedPublic

Description

Change search placeholder text and tooltip from "Search Wikimedia API Portal" to "Search"

Screenshot:

Screen Shot 2020-08-03 at 2.04.36 PM.png (118×530 px, 13 KB)

Event Timeline

apaskulin triaged this task as Medium priority.Aug 10 2020, 4:18 PM

This should be easy

			'searchPlaceholder' => $this->getMsg( 'searchsuggest-search' )->text(),
	"searchsuggest-search": "Search {{SITENAME}}",

Define a new message in the skin's i18n files with the wanted text, and then replace the string passed to the getMsg() call in WikimediaApiPortalTemplate.php

Seems better than having a local override (which technically need doing in all languages) or doing somehting in WikimediaMessages for this use case

Noting the tooltip shows the same too... I think fixing one should fix both

Screenshot 2020-08-13 at 02.41.05.png (186×772 px, 30 KB)

Define a new message in the skin's i18n files with the wanted text, and then replace the string passed to the getMsg() call in WikimediaApiPortalTemplate.php

This is not necessary since core already provides the simpler message

'searchPlaceholder' => $this->getMsg( 'search' )->text()

Noting the tooltip shows the same too... I think fixing one should fix both

They used different message (keys). But probably the longer message is needed in the tooltip since there's space and tooltips are meant to be more descriptive

Define a new message in the skin's i18n files with the wanted text, and then replace the string passed to the getMsg() call in WikimediaApiPortalTemplate.php

This is not necessary since core already provides the simpler message

'searchPlaceholder' => $this->getMsg( 'search' )->text()

No, that is not true. If you ask the i18n/l10n people here, they advise against reusing messages (even if the words are correct in English) for other purposes than they were originally defined.

In this case, the 'search' message is used in BaseTemplate::getSidebar

				case 'SEARCH':
					// Search is a special case, skins should custom implement this
					$boxes[$boxName] = [
						'id' => 'p-search',
						'header' => $this->getMsg( 'search' )->text(),
						'generated' => false,
						'content' => true,
					];

If the skin was replimenting the sidebar stuff (for whatever reason), reusing the message would be appropriate for the same purpose.

So as below, the message is what we want in terms of words (in English), the qqq message shows the context:

	"search": "Search",
	"search": "{{doc-special|Search}}\nNoun. Text of menu section shown on every page of the wiki above the search form.\n\nSee also:\n* {{msg-mw|Search}}\n* {{msg-mw|Accesskey-search}}\n* {{msg-mw|Tooltip-search}}\n{{Identical|Search}}",

Therefore "text of menu section" (ala in the sidebar) doesn't match the use case of the using it as a placeholder of the search box.

In most cases it may be the same, and if it is, it's trivial and easy to translate.

! In T259669#6381819, @Reedy wrote:
Noting the tooltip shows the same too... I think fixing one should fix both

They used different message (keys). But probably the longer message is needed in the tooltip since there's space and tooltips are meant to be more descriptive

It's a question for Alex still. I don't know if they really want "Search {{SITENAME}}" in the message; while the SITENAME might want changing to fix this (to something better than "Wikimedia API Portal"), it's entirely possible some message like "Search this site" or "Search here" might be preferred than the default tooltip

I think just "Search", both for the placeholder text and the tooltip, will be best. Thanks for the input, @Reedy and @Ammarpad!

Helga_sf renamed this task from Change search placeholder text to "Search" to Change search placeholder and tooltip text to "Search".Aug 27 2020, 12:13 PM
Helga_sf updated the task description. (Show Details)

Change 625853 had a related patch set uploaded (by Art.tsymbar; owner: arttsymbar):
[mediawiki/skins/WikimediaApiPortal@master] WikimediaApiPortal skin: Search placeholder and tooltip text update.

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

Change 625853 merged by jenkins-bot:
[mediawiki/skins/WikimediaApiPortal@master] WikimediaApiPortal skin: Search placeholder and tooltip text update.

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

Verified on beta. Thanks, Art!