Hi

I'm trying to get the labels of the views translated via i18nstrings function but with little success until now.
As far as I've been able to track the problem I think that something is missing in views module or in this one.
There is this plugin declared in 18nviews:

/**
 * Implementation of hook_views_plugins().
 */
function i18nviews_views_plugins() {
  $path = drupal_get_path('module', 'i18nviews') . '/includes';
  return array(
    'module' => 'i18nviews',
    'localization' => array(
      'i18nstrings' => array(
        'title' => t('Views translation module'),
        'help' => t("Use the locale system as implemented by the Views translation module."),
        'handler' => 'views_plugin_localization_i18nstrings',
        'path' => $path,
      ),
    ),
  );
}

But in -dev version there is no views_plugin_localization_i18nstrings.inc file, I suppose that this one should be included: http://drupalcode.org/viewvc/drupal/contributions/modules/i18nviews/incl...

I've been searching for the parent of this plugin: views_plugin_localization or any reference in the plugins.inc for these group of plugins called "localization", they aren't declared in views module and neither in this one, but I've found a strange thing in what I think is an old atrium code, in plugins.inc file there was this:

    'localization' => array(
      'parent' => array(
        'no ui' => TRUE,
        'handler' => 'views_plugin_localization',
        'parent' => '',
      ),
      'none' => array(
        'title' => t('None'),
        'help' => t('Do not pass admin strings for translation.'),
        'handler' => 'views_plugin_localization_none',
        'help topic' => 'localization-none',
      ),
      'core' => array(
        'title' => t('Core'),
        'help' => t("Use Drupal core t() function. Not recommended, as it doesn't support updates to existing strings."),
        'handler' => 'views_plugin_localization_core',
        'help topic' => 'localization-core',
      ),

(file: http://library.acquia.com/api/function/views_views_plugins/atrium)

Any idea of what would be the steps to get the labels of the views passed through i18nstrings function?

Thanks

Comments

pcambra’s picture

Category: support » bug

So, it seems that this plugin for translate labes never made into views 2 and the patch for views 3 is still on the way: http://drupal.org/node/357529

If the plugin views_plugin_localization_i18nstrings shouldn't be there for i18nviews 2.x, hook_views_plugins should be removed as well from i18nviews.views.inc

Just for instance, I've made a quick solution for this by changing base.inc file of views module, in the unpack_options function, instead of $storage[$key] = t($value); I've used a custom function that calls i18nstrings

miro_dietiker’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev
Status: Active » Postponed (maintainer needs more info)

This is now in views 3.x (D6 and D7)

Please check again.
D6 2.x won't support this issue, sorry. I strongly recommend to upgrade to 6.x-3.x instead of deeply patching things... (even if it works!)

Is there any action needed for 6.x-3.x to support translation?

miro_dietiker’s picture

Status: Closed (duplicate) » Active
miro_dietiker’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Actually setting this HERE to duplicate since the other issue has been referenced and is subject of work.

Status: Active » Closed (duplicate)