The tab 'admin/workbench/files' named 'File list' cannot translated. It seems missing in the translatable strings of the view.

Comments

Dave Reid’s picture

Project: Workbench Files » Workbench Media
Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Postponed (maintainer needs more info)

Not sure how to best fix this considering it's a menu link and simply a views export. You can't normally translate menu links without an additional solution like i18n_menu.module, so how is this any different?

hass’s picture

Normally all views strings can be made translatable? The translatable strings are on the end of a view file... I'm confused that this is not possible. I thought it's just t()'ifing that is required and someone missed it. Other tabs are translated properly...

I mean the $translatables()

Dave Reid’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

I don't think the menu link text that Views provides has ever been translatable because menu links themselves are not translatable. This is the equivalent of asking someone to change their hook_menu() from this:

$items['my-callback'] = array(
  'title' => 'File list',
  ...
);

To this:

$items['my-callback'] = array(
  'title' => t('File list'),
  ...
);

The latter being incorrect.

hass’s picture

Status: Closed (won't fix) » Active

Yes, this would be wrong. But what your you doing with My Drafts and other tabs? They are all translated... Maybe the code can optimized to to add this? Maybe we only need to add the string to the translatable's array and that's it... I haven't tried it yet manually...

We need to find any better solution than closing the case with won't fix. It's not ok to show English strings if the interface is German.

Dave Reid’s picture

Title: Cannot translate 'File list' » Views does not include strings in the menu definition in exported translatables
Project: Workbench Media » Views (for Drupal 7)
Version: 7.x-1.x-dev » 7.x-3.x-dev
Component: Code » Translations

The string 'My Drafts' is being used as the display title which is being picked up for translations:

$handler->display->display_options['title'] = 'My Drafts';

This however is not going to be translated because it is a menu link even though the same string is provided in the exported translatables array.

$handler->display->display_options['menu']['title'] = 'My Drafts';

So I'm looking at http://api.drupal.org/api/drupal/includes%21menu.inc/function/_menu_item... and it appears to automatically run t() on menu local tasks. So I'm wondering if Views actually needs to be patched to ensure that the strings in menus are added to the exported translatables array.

Dave Reid’s picture

Digging through older issues, the only thing I could find is #401822: views multilanguage menu items.

So a summary for the views issue queue: If you have a view with a page display that is added as a local task menu item, then the title of that menu item needs to be listed in the translatables array when the view is exported. This is because core does not provide any way to provide translations for local tasks, so we need to explicitly register them. This should probably be true of all menu titles in Views displays because if you think about it, we always extract every 'title' from hook_menu implementations for translation, so why shouldn't we do the same here?

tim.plunkett’s picture

Version: 7.x-3.x-dev » 8.x-3.x-dev
Issue tags: +Needs backport to D7
Dave Reid’s picture

Making this change seems to make the strings show up in the exportables array: http://palantir.privatepaste.com/fa437a1f36

However, I suspect that changing this 'translatable' flag has unintended side effects of running t() in places where we *don't* actually want to for the menu links since it's handled by core later when menu links/tasks are rendered. So, I could use guidance on where to go for "add this string to the exportables array, but don't really do anything with it."

Dave Reid’s picture

Or we need some kind of flag for 'please include this item in the list of translatable strings, but don't do anything with it.' Something like

        'title' => array('default' => '', 'translatable' => TRUE, 'translate' => FALSE),
        'description' => array('default' => '', 'translatable' => TRUE, 'translate' => FALSE),

Where the default for 'translate' is TRUE if 'translatable' is TRUE.

dawehner’s picture

Just showing some piece of code in views

        // Do not translate menu and title as menu system will.
        'title' => array('default' => '', 'translatable' => FALSE),
        'description' => array('default' => '', 'translatable' => FALSE),

So basically views assumes that the menu system does the translation,
so views shouldn't expose the value as translatable via views itself.

So basically to support this usecase we would need both a way to tag something as translatable and tag something as, this should be marked as translatable on the export but not translated on the actual loading.

Dave Reid’s picture

http://palantir.privatepaste.com/21b8ad72d1 might be a solution based on #9.

dawehner’s picture

Issue tags: +Needs tests

For d7 i would like not to change the behavior but introduce something like export_translatable
as every tiny little change can cause other issues :(

Dave Reid’s picture

Yeah I understand the concern about regressions, but considering this is supported from the base views_object which all views must extend from, I cannot see how this would actually change any functionality. Doing some research to show if this would affect anything.

tim.plunkett’s picture

Issue tags: +VDC
xjm’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.x-dev
Component: Translations » views.module
JeremyFrench’s picture

I have just stumbled upon this issue today. Wondering why advanced forums has some tabs which are not translated. I think because it is not included in the translatables array, and is added by a hook menu (I believe views are added by menu_alter) the translation system skips the strings. So a module may report that it is 100% translated but not have these strings in it.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Lendude’s picture

Project: Drupal core » Views (for Drupal 7)
Version: 8.9.x-dev » 7.x-3.x-dev
Component: views.module » Translations
Issue summary: View changes
Issue tags: +Bug Smash Initiative

Cleaning up old bugs.

Menu settings are now fully translatable, so this shouldn't be an issue anymore in Drupal core. No idea about D7, so since this is still marked as 'needs backport', I'll move it to the Views queue.