Menu problem in OJS 3.1 (bug?)

Thanks. I cannot guarantee that the locale translation is absolutely complete, but I translated the necessary keys with no result: any changes do not affect the localization of the main menu. E.g. message key ‘navigation.current’ is used both in menu and in breadcrumps, however only in breadcrumps the message is in the correct locale.

Are you sure that all translation keys are there. As far as I know a few translation keys are missing.
Please search forum and you will find something about that . I have had one issue with that but when I entered keys and translation everything worked well.

I am sure that the problem is not in translations. To test it, I did the following:

  1. Fresh install of OJS, setting Ukrainian (single) locale.
  2. Setting up new journal. On the frontend, the first item of the menu is ‘Поточний випуск’ (corresponding to navigation.current key)
  3. On the admin panel, added English and enabled it for frontend, forms and submissions, added info for the journal.
  4. Clean cache to be sure.
  5. On the frontend, toggle to English. All content switched to English, but the main menu is still in Ukrainian.
  6. On the admin panel, removed Ukrainian completely. Clean cache.

The result is still the same: Ukrainian menu messages on the frontend.

  1. Changed default locale to en_US in the config.inc.php. No effect.
  2. Investigating database. Found something strange. In the ‘site’ table, the primary locale is still uk_UA. Also, in the ‘navigation_menu_item_settings’, the explicit values of the strings are used, maybe this is the reason.

Still unclear.

I think that this must be cache issue or that some cache folder does not have proper permissions. Please contact asmecher, ctgraham or Israel Cerfin.
I did not have such issues in new installations of OJS 3.1

There is definitely some problem with the nav. menu in 3.1. For us it is still unresolved. So now we are waiting for 3.1.1.

Seems that I found the reason of the problem. When creating the journal, OJS copies strings from the locale files into the database, and then uses that data.
The problem is that OJS 3.1.0 does it for the primary locale only.
As a result, tables ‘navigation_menu_item_assignment_settings’ and ‘navigation_menu_item_settings’ have incomplete information, like this
| 15 | | titleLocaleKey | navigation.current | string |
| 15 | uk_UA | title | Поточний випуск | string |

SOLUTION:
I maually added the missing locale records,

insert into navigation_menu_item_settings set navigation_menu_item_id=15, locale=‘en_US’, setting_name=‘title’, setting_value=‘Current’, setting_type=‘string’;

and get
MariaDB [ojs]> select * from navigation_menu_item_settings where navigation_menu_item_id=15;
±------------------------±-------±---------------±--------------------±-------------+
| navigation_menu_item_id | locale | setting_name | setting_value | setting_type |
±------------------------±-------±---------------±--------------------±-------------+
| 15 | | titleLocaleKey | navigation.current | string |
| 15 | en_US | title | Current | string |
| 15 | uk_UA | title | Поточний випуск | string |
±------------------------±-------±---------------±--------------------±-------------+
3 rows in set (0.00 sec)

Repeated this for all missing keys, and now my navigation menu is fine.

I do not know if I stiil need to fix the table ‘navigation_menu_item_assignment_settings’, but for this time I am happy wit this.

1 Like

I experience the same problem. Had to edit DB records manually in navigation_menu_item_settings table. Btw. i created a new journal and enabled 2 different languages for UI. However in navigation_menu_item_settings table there are only records for english items. So, is this a bug? I use OJS 3.1.0.1.

Regards,

Nino

We’re hoping to raise some more awareness, the problem still persists and is extremely annoying, because the main menu will always show the primary language and not the desired one, e.g. English (!). (Some translations are incomplete, but that’s not the issue.) Here’s what we have learned so far:

In OJS 3.1.0-1, on creation of a new journal the navigation main menu items do not get populated with the translated strings from the files in the locale folder. It works for the primary language, but the fields for the main menu translation (e.g. “Contact”, “About”, etc.) simply are not added to the navigation_menu_item_settings table and therefore do not show up translated. It’s possible to do this manually in the backend (if forms are enabled for that particular language) or by adding rows to the database directly, but that’s not a scalable solution, especially since this problem also occurs with any newly added languages. It’s also very unsatisfying since the translated strings exist, they apparently just aren’t taken over from the locale files.

IIRC a fix for this was announced for OJS 3.1.1 (?), but what we found is that the correct population (tested in 3.1.1-2) only works for the languages selected during installation and not for additional languages added afterwards. Is there anything that can be done about this (apart from manual adding/editing work)? Will this problem be fixed and if so, when? (The blocks on the right hand side and the login and search menu items are unaffected since their translation is apparently fetched on the fly (?) and not written into the database.)

Thanks in advance for your consideration.

Hi all!

Thanks for bringing this up.

I have filed the following issue regarding that: NavigationMenu Feature - Locales for default NMIs retrieved from key and not database · Issue #3846 · pkp/pkp-lib · GitHub

As soon as there will be a fix, I will leave a comment here for anyone who may want to check it, and see if it works for their scenario.

Thanks,
@Dimitris_Efstathiou

Hi all,

There is a fix at the PR of the above issue. It’s not yet reviewed, so there may be code changes, but someone may want to check it on his installation as is.

Thanks,
@Dimitris_Efstathiou

Greetings,

@Dimitris_Efstathiou can you tell how to apply this patch?

I updated all the files according to the NavigationMenu Feature - Locales for default NMIs retrieved from key and not database · Issue #3846 · pkp/pkp-lib · GitHub thread but I’m still seeing the missing navigation menu items. Do I need to do something else?

OJS Version: 3.1.0.0

Greetings,

Sorry to bother you @asmecher but I see you are one of the contributors to the solution of this issue in the github thread NavigationMenu Feature - Locales for default NMIs retrieved from key and not database · Issue #3846 · pkp/pkp-lib · GitHub

As I stated before, I updated all the files related in the topic but I’m still seeing the problem with the menu links for the secondary journals language. Do I need to do additional steps to the database to be upgraded?

My site has over 12 journals and handles three different languages, so I’m trying to avoid a manual update. But if is unavoidable, how do I identify the the missing locale records to manually update in the database?

Thanks and sorry to bother you :wink:

Hi @hekutoru2kx

Could you please tell me if you have changed something at your database regarding the default Navigation Menu Items?

Are there any titleLocaleKey rows in the navigation_menu_item_settings table in your database?
Does your interface display any NavigationMenuItems, even with “wrong” translation, or it displays nothing?

Thanks,
@Dimitris_Efstathiou

Hi @Dimitris_Efstathiou,

I haven’t done any changes in the DB regarding the default Navigation Menu Items.

In the table navigation_menu_item_settings I can find several titleLocaleKey items but are not related to any locale (locale column is empty) and is only appointing the data type of the items.

The interface shows every navigation menu item in the default locale, but not in the other locales. My primary locale is correctly showing the menu items like about, login, register, archive, etc, but in the secondary locales is showing navigation.about, navigation.login, navigation.register, navigation.archive, etc.

After checking the website settings > navigation menus (haven’t done this before) I can see the missing menú items in this section and I can update one by one and it seems to work if I change the title here.

Did I miss a step to fully update the navigation items or the step is to manually update one by one, for each locale, for each journal?

Thank,
@hekutoru2kx

Hi @hekutoru2kx.

Thanks for your reply.

Could you check if there are any entries in the database table navigation_menu_item_settings that have setting_name=“title” and setting_value=“navigation.login” for example.

If so you must remove them, because the NMIs override their title by taking firstly the value of that field. If you have not done much work on changing the titles of the NMIs already in the database, you could remove the titles from the database all together (only the setting_name=“title”), allowing the NMIs to retrieve their title from the setting_name=“titleLocaleKey”. If you follow that route, you will “reset” the NMIs titles to their default. Any changed title by you will be lost.

I advice to take a copy of your database before you do that, in case there is something wrong with the copied code, or make that change on a dev environment.

Regards,
@Dimitris_Efstathiou

Hi @Dimitris_Efstathiou!

Sorry for the late reply, I was just testing all possible outcomes tinkering the database. As you say, I just deleted all the records with setting_name = ‘title’ for every locale, and only updated the custom links afterwards.

In case somebody else need this information, if you delete only one of the locales, all the links on the differentes locales will appear with the remaining locales. And after deleting you will only have to visit the custom links added. You can check this custom in the website settings > navigation menus; and you will see the empty links ready to be updated.

Thank you for the support!

Regards,
@hekutoru2kx

Hi @hekutoru2kx,

Great, I am glad the solution worked, and thank you for the feedback.

Regards,
@Dimitris_Efstathiou

The same problem with OJS 3.1.1.4. When I added Ukrainian language into existing website of the journal I did not get anything. I checked the table ‘navigation_menu_item_settings’ in my database and found that there are only en_US locales for menu items. So manually added Ukrainian variant for one of them and it helped. Please note, I did not patched any files.
But later I simply went to Website settings - Navigation menus and swithced the languge of interface into Ukrainian. The blocks (except one changed from sql) were in English. So I manually edited each of blocks from there and entered Ukrainian titles for them - it also worked and ukrainian items appeared in my database too. So, I think that there no need to patch the files or modify the database - it is just enough to rename the blocks from the Navigation menus. As for me, it is simplier.

we just installed a new locale and this is still happening

is there a way to insert the new seetings on navigation_menu_item_settings without loosing existin menu itens?

Hi @ronniebrito,

This is an older thread. Can you create a new post and describe your issue there (and please link back to this post if it is relevant too)? Please note, however, that PKP no longer supports version 3.1, and recommend that you upgrade. It is possible that this issue may be addressed by upgrading. But if you are experiencing this issue in a later version of OJS, please let us know in a new post.

-Roger
PKP Team