Hi all,

I have the following situation:

  1. I'm using superfish to render ONLY SECOND LEVEL menu items for main menu
  2. It's a multilingual site, so I'm using i18n that's based on variable module to store multilingual variables

EXAMPLE:
my main menu:

Item1
--item1.1
----item1.1.1
----item1.1.2
--item1.2
Item2
--item2.1
---item2.1.1
---item2.1.2
--item2.2

So for the above, I have 2 superfish blocks:

  1. superfish block 1 with "menu parent" setted to item1 -> renders item1.1 with its children, and item 1.2
  2. superfish block 2 with "menu parent" setted to item2 -> renders item2.1 with its children, and item 2.2

All works very fine, but the issues start when I do the main menu translation in this way:
Translation mode for main menu: "Translate and Localize. Menu items with language will allow translations. Menu items without language will be localized."
I have some items that have to be localized, and some not. So for example main menu becomes:

Item1 -> Language neutral (I don't need localization for this item)
--item1.1 -> ENG translation
----item1.1.1 -> ENG translation
----item1.1.2 -> ENG translation
--item1.1 -> ITA translation
----item1.1.1 -> ITA translation
----item1.1.2 -> ITA translation
--item1.2 -> Language neutral
Item2 -> ENG translation
--item2.1 -> ENG translation
---item2.1.1 -> ENG translation
---item2.1.2 -> ENG translation
--item2.2 -> Language neutral
Item2 -> ITA translation
--item2.1 -> ITA translation
---item2.1.1 -> ITA translation
---item2.1.2 -> ITA translation

In the above, please notice that new translated items were added by i18n system (but I have to remake manually the hierarchy).

So the results:
For item1 tree all works fine, because item1 itself is not translated: superfish block 1 use item1 as "menu parent" and correctly shows:

if we are viewing ENG site version:
--item1.1 -> ENG translation
----item1.1.1 -> ENG translation
----item1.1.2 -> ENG translation
--item1.2 -> Language neutral

if we are viewing ITA site version:
--item1.1 -> ITA translation
----item1.1.1 -> ITA translation
----item1.1.2 -> ITA translation
--item1.2 -> Language neutral

The issue comes when I have first level item localized, as in item2 case:

if we are viewing ENG site version:
--item2.1 -> ENG translation
---item2.1.1 -> ENG translation
---item2.1.2 -> ENG translation
--item2.2 -> Language neutral

if we are viewing ITA site version:
inconsistent rendering: all menu items are shown

That's because superfish block 2 use item2 ENG as "menu parent" it doesn't automatically switch this setting to item2 (ITA).

If "parent menu" setting were a multilingual variable, I could assign item2 (ENG) for english and item2 (ITA) for italian

I'm not a programmer, but I think we need something similar to:

/**
* Implements hook_variable_info().
*/
function superfish_variable_info($options) {
  $variables['superfish_menu_[superfish_block_number]'] = array(
    'type' => 'multiple',
    'title' => t('Menu parent', array(), $options),
    'repeat' => array(
      'type' => 'select',
      ...
      ),
    'description' => t('Variable description', array(), $options),
    'required' => TRUE,
    'localize' => TRUE,
    'group' => 'Superfish',
  );
  return $variables;
}

/**
 * Implements hook_variable_group_info().
 */
function superfish_variable_group_info() {
 $groups['Superfish'] = array(
   'title' => t('Superfish'),
   'access' => 'administer site configuration',
 );
 return $groups;
}

/**
 * Implements hook_variable_type_info()
 */
function node_variable_type_info() {
 $type['superfish_block_number'] = array(
   ...
 );
 return $type;
}

And then retrieve the value with variable_get_value().

Please consider to add this feature, it will be useful to many.

Thank you very much

Comments

MXT’s picture

Category: feature » bug
Priority: Normal » Major

I don't know if I have to consider this as a feature request or a bug: at the end the result is that superfish can not be correctly configured in multilingual sites... So it becomes unusable.

MXT’s picture

No response on this yet? I think this is a issue that can't be underestimate...

mehrpadin’s picture

Hey there,

Sorry, added to my to-do list already :)

MXT’s picture

Hi mehrpadin!

Thank you very much for working on this!

Would ask you: what about your release plan? Days? Weeks? Months? I really need this issue resolved for my next project so if you've planned to release this within a month I'll can wait, otherwise I'll go for other solutions.

Thank you very much!

Jose Reyero’s picture

@MXT,
Have you tried using different blocks (with different superfish menus) and setting block visibility per language?

MXT’s picture

Thank you Jose, when I told "I'll go for other solutions" in #4 I was thinking exactly at your suggestion.

But this is only a workaround, the issue still remains.

In addition, using more superfish blocks for every language can became a nightmare to manage: think for example at the following situation:

  • a main menu with 14 items
  • so you have to create 14 superfish blocks to manage each sublevel
  • then you have to multiply each superfish block for every language, e.g EN, IT, DE, ES, FR
  • So: 14 x 5 = 70 superfish blocks!

Instead, If "parent menu" setting were a multilingual variable only 14 superfish blocks would be necessary.

What do you think about this?

Thank you

mehrpadin’s picture

Update: Someone please make things more clear for me. I've tested SF with i18n (with and without Entity translation which I'm not sure how\whether makes a difference from i18n point-of-view anyway) I had one single Main Menu and translated its items (edited the menu, selected the option that allows the individual items to be translatable) and all worked well with or without SF, so wondering what it's all about! I had another user some time ago he emailed me his problem with i18n, noticed he has created menu items for each translation of let's say each node manually! and not through menu item translation feature! which is not how it's supposed to be done? (correct me if I'm not right) so maybe it's sometimes, or even always, the users not using i18n correctly? or some other modules are interfering, no idea! but I'm having problems understanding these i18n problems o_O

Also, haven't tested the i18n_menu_node or its D7 port recently as it's stated that Entity translation is in D8 core so I guess they shouldn't be used any more.

mehrpadin’s picture

Status: Active » Postponed (maintainer needs more info)
rcodina’s picture

Status: Postponed (maintainer needs more info) » Active

@mehrpadin I also reproduce the problem. I try to explain the problem to clearify you. What I have:

1) I have a menu with translate option "Translate and Localize. Menu items with language will allow translations. Menu items without language will be localized." enabled
2) To simplify, let's say I have this menu in English, Spanish and Catalan:

    English 1
      English 1.1
         English 1.1.1
      English 1.2
    Spanish 1
      Spanish 1.1
         Spanish 1.1.1
      Spanish 1.2
    Catalan 1
      Catalan 1.1
         Catalan 1.1.1
      Catalan 1.2

3) I have a superfish block with English 1.1 as "Parent menu". Doesn't matter what language I have selected, it only displays when english is selected.
4) Given I don't want to create a new block for Spanish 1.1 and for Catalan 1.1, I would like to specify the "Parent menu" for each language. This is what we are asking for.
5) If I build a superfish menu block where "Parent menu" is the root of menu (which includes all menu items), there is no problem. The menu is shown in selected language.
5) I don't know why but not all menu items translation are linked. I'm sure the time I build the site for first time I linked them. The fact is that now I have so many menu items. And I'm sure that If I had a "Parent menu" per language this wouldn't be a problem.
6) Untils there is a solution for this, I'm forced to do a superfish block for each menu and language: 6 * 3 = 18 blocks!
7) Have you tried to reproduce this selecting a "Parent menu" which is not the root item?

Thanks!

LOBsTerr’s picture

Status: Active » Closed (outdated)