How can I modify the feedback message returned by joomla?
What method do I need to override in order to extend the functionality that renders this message?
It's a simple language string which can be overriden in the language manager. For that go to the Language Manager and there the "Overrides" submenu. Click the "New" button. You can use the search to find the language key you need to override. However I usually just search the ini files in the language directory directly.
In your specific case, the only one I found which is matching is from Smart Search. So you're looking to override COM_FINDER_N_ITEMS_PUBLISHED_1
.
JControllerAdmin->publish()
github.com/joomla/joomla-cms/blob/staging/libraries/legacy/… As you see it uses JText::plural()
and it passes in the count as a second argument. JText::plural
automatically creates a suffix to the language key, depending on the available plural forms in a given language. So in case there is only one item, it appends _1
to the key.
JControllerAdmin
and calls the parent publish
method (or doesn't override it), it will be handled automatically. The $this->text_prefix
equals to the name of your component (eg COM_FOO
) if not specified otherwise. Otherwise you need to do this call yourself similar to what JControllerAdmin
does.