Change search placeholder text and tooltip from "Search Wikimedia API Portal" to "Search"
Screenshot:
apaskulin | |
Aug 4 2020, 10:30 PM |
F32090331: Screenshot 2020-08-13 at 02.41.05.png | |
Aug 13 2020, 1:44 AM |
F31963519: Screen Shot 2020-08-03 at 2.04.36 PM.png | |
Aug 4 2020, 10:30 PM |
Change search placeholder text and tooltip from "Search Wikimedia API Portal" to "Search"
Screenshot:
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
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
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.
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
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.
Change 625853 merged by jenkins-bot:
[mediawiki/skins/WikimediaApiPortal@master] WikimediaApiPortal skin: Search placeholder and tooltip text update.