[OJS 3.1.2] Customization on search page

Hi, I’m using OJS 3.1.2 and would like to make some changes to the search page:

1- add a button to clear the previous search
2- in the advanced filters that did not come out on the current date but in white and right there how to make the month come out in Spanish (as I have defined Spanish and English as languages)

Where should I look to do this?

Well, I already found in pkp/pkp-lib#4713: Update default search date for Smarty 3. · pkp/ojs@642655d · GitHub how to leave the date From and Until blank, now I would need:
1- that the months come out in Spanish if the site is being viewed in Spanish or out in English if it is being viewed in English
2- create a button to clear the previous search.

This should be automatic, if the Journal is configured to use a Language for the UI and Forms (Settings → Website → Languages)

To create a new button would involve coding in PHP and Smarty. If you are comfortable with this, you would need to modify:

Although, if you made the button simply redirect to the /search/search/ URI, this would effectively give you a blank search.

what could I be doing that for everything else the translation between languages is ok, but in the case of the months they always come out in English. Look at my settings:

Looks right to me. This is what I see in 3.1.2-1.
image

What theme are you using?

I’m using ojs 3.1.2, won’t it work here?

My guess is that this is a discrepancy in the theme. I’ve tested the Default and Bootstrap themes on my install. What theme are you using?

I’m using the defaultManuscript theme. If the problem is the theme used, then there will be some file within the theme that can modify this?

Themes can override the templates, and this could have been the problem. The defaultManuscript theme does not override any templates however - it only modifies the CSS.

This should be running through the standard template:

Calling the standard html_select_date tool:
https://www.smarty.net/docs/en/language.function.html.select.date.tpl

This uses the native PHP set_locale() to select the language of the months:
https://grokbase.com/t/php/php-smarty-general/033fdje8tq/html-select-date-month-language

Is it possible your PHP install does not have the Spanish locale enabled?

Sorry, but I don’t know how to know if I have Spanish enabled. Running ResourceBundle :: getLocales returns es_ES as one of the supported ones, but I don’t know if that means it is enabled …

The ResourceBundle::getLocales(''); method returns information on the PHP Locale class, which is unfortunately and confusingly different than the locales which PHP’s set_locale() method uses. If you have a system administrator or hosting provider who can run the command locale -a, this will describe what system locales are available to PHP.

for now I have my site on a local server, so I can execute any command myself. On Windows, locale -a also runs?