Enable language debugging in Joomla 4 and create yourself a menu item pointing to Search.
Visit the menu item
NOTE the lack of translated placeholder text
Well here is where it gets complex.
The debug toolbar says that MOD_FINDER_SEARCH_VALUE
is untranslated
So you go down the rabbit hole looking for MOD_FINDER_SEARCH_VALUE and you find its used as
Text::script('MOD_FINDER_SEARCH_VALUE', true);
However once the value is added to JS its not actually then used as the place holder of the input field for the search
So the fix is
Factory::getLanguage()->load('mod_finder');
in the com_finder - tmpl/search/default.php before Text::script('MOD_FINDER_SEARCH_VALUE', true);
"joomla.jtext": {
"MOD_FINDER_SEARCH_VALUE": "??MOD_FINDER_SEARCH_VALUE??",
"JSHOWPASSWORD": "**Show Password**",
"JHIDEPASSWORD": "**Hide Password**"
},
Safari on Mac
Compare with the search MODULE which has a placeholder:
Labels |
Added:
?
|
Title |
|
Indeed. We have to modify the default.form.php to get
<input type="text" name="q" id="q" class="js-finder-search-query form-control" value="<?php echo $this->escape($this->query->input); ?>" placeholder="<?php echo Text::_('MOD_FINDER_SEARCH_VALUE'); ?>">
But I see no reason to load the module lang file and use MOD_FINDER_SEARCH_VALUE
.
We would be better creating a new string in com_finder.ini
COM_FINDER_SEARCH_VALUE="Search ..."
and use that as placeholder
What do you think?
well that depends if you want a placeholder or not... :-)
The reason for having a placeholder on the module is because you have the option to display the input without the button. As that is not an option in the component I would not have the placeholder and simply remove the line that was added in error
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-06-22 11:49:57 |
Closed_By | ⇒ | PhilETaylor |
Unless I am very much mistaken the line is a copy paste error and should not be there.
The module is populated because it has "placeholder="' . Text::_('MOD_FINDER_SEARCH_VALUE')"