Custom Locale plugin doesn't react to primary locale change

Hello everyone!
using an OJS 3.2.1.2 installation with the Custom Locale plugin V1.1.0.2 I’ve found that, in contrast to what is described here:

if I change the primary locale of the journal, the list of locale files doesn’t change to reflect the new setting. I’m referring to the list inside the ‘Locale’ tab in:

  • https://<DNS-NAME>/index.php/journal-path/management/settings/website

Trying to figure out the problem, the only hint I’ve found is that inside the file:

  • /plugins/generic/customLocale/controllers/grid/CustomLocaleGridHandler.inc.php

at line 163, a wrong ‘$filter[‘locale’]’ is passed.
I’ve checked both the database (journals table) and the ‘$context’ variable used in the same function of the ‘$filter[‘locale’]’ string (function loadData) and the primary locale is correctly configured.

Can someone help me with that?
Thank you very much

2 Likes

@asmecher do you have an hint for me? Thanks!

Hi @sourcedump,

Try applying either of the patches linked at Improve ability to edit languages other than the primary locale · Issue #8 · pkp/customLocale · GitHub (they are equivalent, just applied to different branches). If you can confirm that this fixes the issue, I can get a new release of the plugin added to the Plugin Gallery. With this patch in place, you should be able to use the drop-down filter on the locale file list to choose a different language.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi,
I tried the plugin and applied the patch, but nothing changed for me as it was already working as described in your last post:

With this patch in place, you should be able to use the drop-down filter on the locale file list to choose a different language.

Yesterday I was testing the plugin without this last patch and I noticed that the dropdown menu was working, I re-tested with and without the patch and I couldn’t notice any sort of difference :confused:

I am testing in OJS 3.2.1-4, plugin version 1.1.0.2

Thanks,
Piero

Hi @asmecher, I tried to make the italian localisation of the Pragma theme using the plugin, but with no result.
I went to Settings>Website>Locales, clicked on Search and selected it_IT from the dropdown menu, then I wrote ‘pragma’ in the input field and clicked Search button: “No files found” is the result.
The same test works for en_ES language, letting me change the english default.
The journal of the test has italian as primary and english for UI, Forms and Submissions in Settings>Website>Setup>Languages.
I remember it could be possible to do this in OJS 3.1, and I think it is a problem related to the missing reaction to the primary locale change…
Any hint?
Best regards
Stefano
immagine
immagine
immagine

Hi @bolelligallevi,

Did you try the patch linked above?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher, I think our IT hasn’t applied it yet, but which change should make?
@piero_tasso wrote that never seems changed in his ojs, and i think we have almost the same version (3.2.1-2 and 3.2.1-4) and same plugin 1.1.0.2
Best regards
Stefano

Hi @bolelligallevi,

Try applying this change to plugins/generic/customLocale/ controllers/grid/CustomLocaleGridHandler.inc.php: pkp/customLocale#8 Fix ability to choose other languages for editing · pkp/customLocale@322d1bc · GitHub

It should definitely change the behaviour of the plugin, e.g. by changing the locale labels from en_US to English (U.S.)). If at least that didn’t change, then I suspect the patch wasn’t applied properly.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher, I tried again and I can confirm the change to the locale labels, I didn’t notice it before.
I have tested it in OJS 3.2.1-4 with a couple of journals (one with four languages) and it works.

Besides the labels on the filter, I still cannot see other differences: the drop-down filter to select a different locale seems to be working even without the patch.

I am quite confused by the version.xml,

<release>1.1.0.2</release>
<date>2021-02-02</date>

which is different from the one I can find here:

Thanks!
Piero

Hi @piero_tasso,

In my own testing, it was possible to choose the language from the filter dropdown prior to applying the patch, but it wasn’t possible to translate content in other languages. Anyway, thanks for the confirmation!

Regards,
Alec Smecher
Public Knowledge Project Team