1. Create a View.
2. Add a menu link to a page from view.
3. Open edit page for that link from admin/structure/menu/manage/main-menu.
4. Click the "Translate" tab - you'll see a blank page.
5. To fix this just assign a language to the link instead of "Language neutral".

Comments

berdir’s picture

Priority: Minor » Normal

I would say a fatal error is not minor :)

jose reyero’s picture

Component: Strings » Menus
Priority: Normal » Major

Yeah, upgrading to major and moving to component "Menus"

As @Berdir points out:
- This seems to be caused by this patch #1693074: Change menu translation approach (i18n_menu_translated_menu_link_alter() skips item subtree processing)
- More information here https://drupal.org/node/1693074#comment-6954254

I'd say that there are some tests missing for this 'translate menu item' pages too.

jose reyero’s picture

Priority: Major » Normal
Status: Active » Needs review
Issue tags: +views, +compatibility
StatusFileSize
new2.53 KB

I've done some research and this is what's going on:
- Views menu items, as other items defined by modules should have their title translated by t().
- These items only have translatable strings if either the title or the description are customized.

This patch will replace the error with a 'No available strings for translation' message, which I think gives more clues to the user than just not showing the 'Translate' tab for such items (that is the other option).

Downgrading to 'normal' since this is not even a missing feature, just a page that shouldn't do anything. Please review and test.

berdir’s picture

+++ b/i18n_string/i18n_string.incundefined
@@ -1188,6 +1188,10 @@ class i18n_string_object_wrapper extends i18n_object_wrapper {
+    //   && $this->get_strins(array('empty' => TRUE))

Typo :)

+++ b/i18n_string/i18n_string.pages.incundefined
@@ -22,6 +29,11 @@ function i18n_string_translate_page_object($object_type, $object_value, $languag
+  // If not localizable strings, print message and fail gracefully.
+  // This is due to some other module messing with menu items.
+  if (!$strings) {
+    return t('This object has no strings available for translation.');

Comment is specific to menu items, but this is a generic method...

The error message is not *that* helpful but making something better is hard as, as I said, this is a generic method :)

Applied patch and the fatal error is gone, which is not that surprising.

jose reyero’s picture

Status: Needs review » Fixed

Thanks for the quick review.

Fixed typos, better comments.. Committed.

rutcreate’s picture

patch #3 works perfectly. but menu item still does not translated. I try with:
Menu title: Log out
Path: user/logout

When I visit translation page, message 'This object has no strings available for translation.' is show up. So I go to translate interface (admin/config/regional/translate/translate). Translate 'Log out' to my language but it does not display correctly.

Status: Fixed » Closed (fixed)

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

jaypan’s picture

Status: Closed (fixed) » Reviewed & tested by the community

Patch from #3 works for me.

jose reyero’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Well, if patch #3, which is committed, works, this is fixed then.

About these menu items, nope, they're not translatable using this module because they are produced by another module, and not (core) custom menu items, which what i18n_strings translates.

So this is to be fixed in views, or maybe i18nviews, not here.