Hi,
would do you think, when is the translation working again?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mehrpadin’s picture

Hey there,

As far as I know it does, I'm not quite confident though, but on the test sites I had everything worked fine even without that function.

Apfel007’s picture

mhm .. ok .. did you try taxonomy menu , too? My primary menu is working wit translations well - without superfish. Using the superfish block, the translations not working...
Will check it again..

Prancz_Adam’s picture

Issue tags: +i18n, +superfish

This translation issue means that I cant use the menu item os a same view in a different languages?
Why you turned off the translation function?

Prancz_Adam’s picture

This translation issue means that I cant use the menu item os a same view in a different languages?
Why you turned off the translation function?

richardchui’s picture

Version: 6.x-1.8 » 7.x-1.9-beta2

Why was this function removed? It is hugely important for multinational sites. Thanks!

mehrpadin’s picture

Hey all,

As a matter of fact, it was supposed to be a temporary removal, and only for the beta release, but then we ran into problems with the releases and I was forced to create a stable release; anyhow, on all test sites I had - like 3 or 4 - the i18n module was working like a charm, perhaps they changed the way i18n translates the menus, no gen, still busy and no chance to have a close look.

P.S.: You can add the function right after $cache['menu'] = menu_tree_all_data($menu_name); (D7: line #777, D6: #750)

  if (module_exists('i18nmenu')) {
    $cache['menu'] = i18nmenu_localize_tree($cache['menu']);
  }
tivie’s picture

Anyone else tried this?

When I injected the code as instructed, superfish menu just disapeared. It's possible I did something wrong.

This is what i did:

 else {
    $cache = array();
    $cache['menu'] = menu_tree_all_data($menu_name);
	
	//Translation (added)
	if (module_exists('i18nmenu')) {
    $cache['menu'] = i18nmenu_localize_tree($cache['menu']);
	}
	
    // For custom $menus and menus built all the way from the top-level we
    // don't need to "create" the specific sub-menu and we need to get the title
Apfel007’s picture

I would say that the "i18nmenu_localize_tree" is fired without that, BUT there is no lang information transmitted, if you localize a menu item. In order to that, "i18nmenu_localize_tree" can't work right in this case..

$cache_key = "links:$menu_name:$mlid:$user->uid:$language->language:". md5($menu_name);

It seems that thsi position makes trouble. In my case a got a default cache_key like that "links:primary-links:0:1:de:b0fe473da02e5ec04f7bc0331f761c56"

If I change the lang., I got this: "links:primary-links:0:1:en:b0fe473da02e5ec04f7bc0331f761c56"

This key is not existing in the db, the function step to "$cache['menu'] = menu_tree_all_data($menu_name);" - not lang data at this position, too

daniorama’s picture

I'm using i18n and I have no problems with superfish. The way I did it was to include a menu link with each translation and adding it to the same menu as the nontranslated ones. You'll see in the menu just the links related to only a language. There is also a new handbook for i18n and maybe there is a better way, but this one is easy and works perfectly with no code changes.

Example:
-Menu
--News
---Sports
---Tech
--Noticias
---Deportes
---Tecnología
--Stories
--Historias

kevinwal’s picture

The correct code is:

    if (module_exists('i18nmenu')) {
      i18nmenu_localize_tree($cache['menu']);
    }
tivie’s picture

thank you kevinwal

It is working now! kudos!

turboflash’s picture

I'm currently using Drupal 7.4 and Internationalization 7.x-1.0-rc1. Took me sometime to find out why the code in #6 and #10 are not working. The following code now works for me and hope it helped someone else with the same problem.

    if (module_exists('i18n_menu')) {
      $cache['menu'] = i18n_menu_localize_tree($cache['menu']);
    }
vb’s picture

@turboflash thanks, works

manos_ws’s picture

I dont know if this is the correct thread but I will post here because it is concerning the i18n and superfish module.

I use superfish 7.x-1.8 and Internationalization 7.x-1.0-rc1 and I have a menu with "Translate and Localize"

The problem was that I was getting all language items for any language I choose at the language switcher.

Enabling the "Multilingual select" solved the problem without any code modification in the superfish module
(although I had another problem with Multilingual select see #1222244: Multilingual select Illegal choice )

The above code (#12 , etc ) when should be used?

mangelp’s picture

Without that function custom menu items are not filtered for the current language, so all of them are shown regardless of the configured language, but menu items added from content nodes do. So I ended with some menu items showing in all supported languages and others showing only in the currently selected one.

Adding the removed language function back (#12) solved the issue for me.

If it cannot be added again, could we have a configuration option to enable it and avoid patching?

Bright Web Design’s picture

#12
Worked for me too...

Looking forward to see this in the next version of the module!

Thank you so much turboflash

Reagrds,
Ciril Tomy Tharayil
Tokyo, Japan

healycn’s picture

subscribe

massud’s picture

subscribe

mrsinguyen’s picture

Thanks

The comment #12 worked for me.

Zarevac’s picture

The solution in #12 works for me with Drupal 7.8 and the latest i8n version. Can this be added to the next release?

GiorgosK’s picture

Version: 7.x-1.9-beta2 » 7.x-1.8
Status: Active » Reviewed & tested by the community
FileSize
601 bytes

As per #12 and reports above this patch has been tested by the community
please commit or create a dev for everyone to test

zambrey’s picture

Version: 7.x-1.8 » 7.x-1.x-dev
Status: Reviewed & tested by the community » Needs review
FileSize
602 bytes

Hello, patch at #21 didn't apply. Here's proper patch.
Please test it and then mark as rtbc. Thanks.

GiorgosK’s picture

Status: Needs review » Reviewed & tested by the community

Works and as per a few other reports above (22,21,20,19, 16,15,12) we all used #12 and report it to be working

lets move it to RTBC

mehrpadin’s picture

Hey everybody,

Codes added back to the module (v1.9-beta3) thank you all :)

mehrpadin’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

Yémokô mbK’s picture

Hi ,

I experiment the same issue.... but where is this v1.9-beta3 version?

Thank you.

Mediator

zambrey’s picture

You can find it at the following page
http://drupal.org/node/711944/release

int_ua’s picture

Version: 7.x-1.x-dev » 7.x-1.9-beta4
Status: Closed (fixed) » Active

It's still displaying all items in beta4. Will check the patch.

int_ua’s picture

Status: Active » Closed (fixed)

Patch from #22 worked.

Vacilando’s picture

I also confirm that version 1.9-beta3 works OK. Time to make it downloadable on the project page?

smartango’s picture

Status: Closed (fixed) » Needs work

if menu item has "show as expanded" checked it is shown even with this patch

GiorgosK’s picture

smartango
don't use patch use this version
http://drupal.org/node/711944/release

smartango’s picture

GiorgosK
I was using beta3, now beta4, same problem, only if "show as expanded" is checked.
Also, the weird part is that this check broke only menu links generated by taxonomy menu.
Currently I am using taxonomy menu to generate menu links, then I set language, and translate (i18n_menu) all links.

Also I am using entity translation for taxonomy, I would to add support for it in taxonony menu (or maybe make another module), but for the next project, I think end of July .. there should be something like translation support for menu then ..

richsky’s picture

Hi folks,

I still cannot make it work (7.x-1.9-beta4). Is superfish suppose to use translated menu items or you mean it can just provide a superfish menu block in a fixed language that visibility switch with?

It seems I cannot set the variable Title for translatable block. It remain greyed and if you submit without any variable set here you go with:

Notice: Undefined index: strings in i18n_string_translate_page_form_submit() (line 213 of E:\Web\Drupal_7\sites\all\modules\i18n\i18n_string\i18n_string.pages.inc).
Warning: Invalid argument supplied for foreach() in i18n_string_translate_page_form_submit() (line 213 of E:\Web\Drupal_7\sites\all\modules\i18n\i18n_string\i18n_string.pages.inc).

But I just found that the 7.x-1.8 with patch #22 does.

Cheers.

marktheshark’s picture

Confirming that #22 works for 7.x-1.8.

Since more people have confirmed this, perhaps it would be time to commit the fix.

Thank you

Chimos’s picture

I was using Superfish 7x-1.8 before and had all, original and translated, menu items always visible in any language. I'm using i18n version 7x-1.7 too.

Installing version 7x-1.9-beta4 of Superfish, as said above, solved the problem for me.

Thanks!

phreadom’s picture

@#25 richsky, I found that making sure to add a default language version first before you translate it gets around this error (at least in the block I was translating, for a Language chooser.)

_redfog’s picture

Hello,

I've installed the version "7.x-1.x-dev" from 2013-Feb-08, it resolved me the issue !

rooby’s picture

Issue summary: View changes
Status: Needs work » Fixed

Looks like this is fixed in the latest release.

Status: Fixed » Closed (fixed)

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