We need to support different language menus. We will provide a separate menu for each enabled language (using the 'fixed language' menu translation mode). The same menu in different languages will be related using translation sets.

  • When a new menu is created we will need to clone this menu (including title and description) for each language.
  • When a new language is added each existing menu needs to be cloned in this new language.

Deleting languages and menus is not necessary at this point, this will be added in the future when the need arises.

Comments

pfrenssen’s picture

What do we do with existing menus when the module is initially enabled? There could be pre-existing menus that exist in one or more languages. These would need to get mapped to translation sets, and if menus are missing for particular languages it should be possible to generate these.

This is probably not important for the initial alpha version, but ideas on how to handle this are welcome. For the moment we can best ignore any pre-existing menus, and just hook in when new menus are created.

pfrenssen’s picture

When a new menu is created this defaults to I18N_MODE_NONE. This means that when using the default menu creation UI we can't create different language versions of the menu, since this requires I18N_MODE_LANGUAGE.

Things went a lot better when I enabled i18_menu.

pfrenssen’s picture

Added initial support for translation sets to the branch 1933840. This still needs tests and something to click on.

pfrenssen’s picture

Assigned: Unassigned » pfrenssen

Continuing work on this.

pfrenssen’s picture

Status: Active » Needs review

Alright it finally is done. I went on a long hunting spree to fix some elusive bugs that popped up during testing, boiling down to a missing object declaration in i18n, and an entity cache that needed to be reset after manipulating its contents.

This can most easily be tested by enabling a number of languages, creating a menu, and then running the function paddle_menu_manager_clone_menus(), passing in the created menu. The menu should be set to the "Fixed language" translation mode.

Or run the test suite, which does this for you with 4 menus in 4 languages :)

There is no front end made in this issue, that will be done in other issues.

Cyberwolf’s picture

Assigned: pfrenssen » Cyberwolf
Cyberwolf’s picture

Status: Needs review » Needs work

Can we call menu_cache_clear_all() inside paddle_menu_manager_menu_update() so other code calling menu_save() doesn't need to clear the cache itself if they somehow rely on menu translation sets?

Maybe we can also use UUID to generate machine names for clones?

The part specifically developed for this issue looks good otherwise.

Cyberwolf’s picture

Assigned: Cyberwolf » pfrenssen
pfrenssen’s picture

pfrenssen’s picture

Assigned: pfrenssen » Unassigned
Status: Needs work » Needs review

Fixed issues from #7.

9be9342 Issue #1933840: Use UUIDs for menu machine names.
e827011 Issue #1933840: Clear the caches during menu save rather than during cloning.
pfrenssen’s picture

Sorry I was not tracking the branch on origin, have rebased against the latest version, here are the correct refs:

afa7b8c Issue #1933840: Use UUIDs for menu machine names.
03fb2d4 Issue #1933840: Clear the caches during menu save rather than during cloning.
Cyberwolf’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, so RTBC.

We'll probably need to wait 'till #1933114: Show the menus of the current language in the management menu is ready so they can go in together.

Cyberwolf’s picture

Assigned: Unassigned » iSoLate
iSoLate’s picture

Assigned: iSoLate » Unassigned
Status: Reviewed & tested by the community » Fixed

Merged in 7.x-1.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.