I've been trying various ways to make Taxonomy Menu generate menu items for my localized or translated taxonomies. No joy.
Regardless of the settings, I'm getting the menu items in one bunch attached to one menu.
So for translated taxonomies, instead of:
Menu (EN + FR)
Parent Menu Item EN
Term 1 EN
Term 2 EN
Parent Menu Item FR
Term 1 FR
Term 2 FRI'm getting:
Menu (EN + FR)
Parent Menu Item EN
Term 1 EN
Term 2 EN
Term 1 FR
Term 2 FR
Parent Menu Item FRfor localized taxonomies I'm getting menu items for one language only, misplaced, such as:
Menu (EN + FR)
Parent Menu Item EN
Term 1 FR
Term 2 FR
Parent Menu Item FR
I looked into the code and specifically into this line of taxonomy_menu.module:
if(isset($taxonomy_entity->translations) && isset($taxonomy_entity->translations->original))
Regardless of the i18n model of a taxonomy vocabulary, I could not get to see the ->translations property in my dpm(). Maybe I was doing something wrong, but the docs are pretty modest if not outdated. Then I gave a thought to how I would expect the taxonomy menu to communicate and work. I came to the following conclusion:
Desired modification
I believe TM should act differently based on the i18n model of the selected parent menu item (Fixed Language or Localize and Translate). So:
- The Menu Item dropdown should be renamed to "Menu Item (source language)
- Upon selecting, the form would examine the menu model of the selected menu item, and if:
- fixed language - display additional rows for selecting menus for each enabled language. User would have to manually indicate the parent item for each language
- localize and translate - no additional visual feedback; TM would pick up the menu translation set of the source language and place the menu items into the appropriate translated menu item.
Let me know if I'm wrong. I just wish I was skilled enough to write a patch.
Comments
Comment #0.0
moniuch commentedtext formatting
Comment #1
dstolCan yo give it a shot with 7.x-2.x? Support for i18n is greatly improved there.
Comment #2
moniuch commentedIn fact, I did yesterday, but was slapped with a bunch of errors. Unfortunately all patches I found here (an issue with similar problem), did not apply. Maybe a fresh build would help, please?
Comment #3
hles commentedNone of the patches you mention have been rewritten against 7.x-2.x unfortunately. See the discussion over here http://drupal.org/node/1665308
Comment #4
moniuch commentedI just wanted to give another shot to current 2.0-alpha and this is the error:
Parse error: syntax error, unexpected T_FUNCTION in /demo/startint/sites/all/modules/taxonomy_menu/taxonomy_menu.admin.inc on line 326What is wrong about that line?
array_walk_recursive($options, function($a, $b) use (&$flatten) { $flatten[$b] = $a; });Comment #5
moniuch commentedOK, I commented this line out (as it is PHP 5.3), just to get the module to work and check out the changes. However, except for some reorganization at the Content Type vertical tab form, I could not see any improvement with regard to i18n. Moreover, the module failed to rebuild my menu items (possibly due to my uncommenting the line).
At any rate the alpha is unusable to me at this point, so I will stay back before I employ 2.x on a production site. Hopefully you will find time to review my original post and implement the suggestion.
Comment #6
hles commentedThere is a misunderstanding here, absolutely no i18n feature has been implemented in either 1.x or 2.x. It's just that 2.x should eventually allow to add i18n features more easily.
Comment #7
johnvWorking through the issue queue: harmonizing issue titles.
Comment #8
dmaciej commentedI've got some workaround for 1.4. You must change the base function with the following one:
Comment #8.0
dmaciej commentedprovided more detail
Comment #9
SandraVdv commentedAfter applying the patch in #88 everything works great, but when I submit a term that doesn't have a description I get this notice:
This is my patch to solve that issue:
Maybe this can be integrated in the patch for the i18n issue as well?
Sorry, this comment was meant for the issue https://drupal.org/node/1665308, but I can't delete it here?
Comment #10
vladimirausThank you for your contributions.
Drupal 7 is no longer supported.
Closing this issue as outdated.