I'm currently translating Drupal Commons 3.2 (D7) to Norwegian Bokmål on localize.drupal.org Commons uses Views (and Panels) a lot.

I notice that all strings/titles set as
$handler->display->display_options['title'] = 'Some title';
can be translated on admin/config/regional/translate/translate on the server running Drupal Commons, but the same strings are missing from http://localize.drupal.org (Drupal Commons 3.2 is available on localize.drupal.org.)

  1. Is there a bug/missing feature in the parser when it comes to titles set as a display option for Views handler?
  2. Are the titles in Views always translatable or is this possible since Drupal Commons is using the Title module?
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

Status: Active » Postponed (maintainer needs more info)

Views exports include those strings wrapped in t() at the bottom of the export usually for this purpose. Views titles and the title module have nothing in relation, the Title module is for content entity titles and Views themselves are not at all entities in Drupal 6 or 7. Are these t() calls not in the exported views (at the bottom of the export?)

hansfn’s picture

Status: Postponed (maintainer needs more info) » Active

Thx for the quick reply. I didn't expect that the Title module had anything to do with this, but I didn't want to leave out any details.

No, the t() calls are missing from several of the views_default.inc files in Drupal Commons - example: "Recent site activity" in http://drupalcode.org/project/commons_activity_streams.git/blob/refs/hea...

So this is a bug (incomplete export of the views) in Drupal Commons? (I'm able to translate the strings on admin/config/regional/translate/translate on the server running Drupal Commons.)

Gábor Hojtsy’s picture

Title: Handling of strings/title used in Views (in Drupal Commons 3.2) » Views exports missing t()-ed strings in Drupal Commons 3.2
Project: Localization server » Drupal Commons
Version: 6.x-3.0-beta1 » 7.x-3.2

I believe the strings should be in the views exports, yes. I don't know how those export files where produced, but I'd recategorize this as a commons bug.

hansfn’s picture

I just verified that the views export contains the strings.

I tested with the view "commons_activity_streams_activity". At the end of export, you get:

$translatables['commons_activity_streams_activity'] = array(
  t('Master'),
  t('Recent site activity'),
  [...]
);

This information is missing from commons_activity_streams/commons_activity_streams.views_default.inc

I haven't started creating patches since I don't know how these views_default.inc files have been created. It seems that if I recreate the related features, the "translatables" are included.

Gábor Hojtsy’s picture

Yeah, theoretically if you re-export the view, it should differ in those t()s being there. You can diff and see if you don't have any other changes.

hansfn’s picture

Yes, I have done that successfully for one view as a test. The question I'm asking is if it is worth while for me to do it (and post patches here) or if the Commons developers have some setup that automates this work?

japerry’s picture

We just do regular feature exports of our views, so I'm not quite sure why these wouldn't be showing up. Is it just some specific views or is it all of them that aren't translating? If I can get a list I can compare differences between the ones working and not.

ezra-g’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Commons 7.x-3.3 radar

Marking as "needs more info" per #7 (specific list of the strings that appear to not be run through t()).

hansfn’s picture

Status: Postponed (maintainer needs more info) » Active

Remember that this issue is about exposing translatable strings to (gettext) parsers like the one used on l.d.o, not about whether a string in a View is translatable in a Drupal installation. (Not sure what your really meant with "strings that appear to not be run through t()".)

The following files don't include $translatables:

commons_events/commons_events.views_default.inc
commons_follow/commons_follow_user/commons_follow_user.views_default.inc
commons_follow/commons_follow_term/commons_follow_term.views_default.inc
commons_follow/commons_follow_node/commons_follow_node.views_default.inc
commons_q_a/commons_q_a.views_default.inc
commons_posts/commons_posts.views_default.inc
commons_content_moderation/commons_content_moderation.views_default.inc
commons_radioactivity/commons_radioactivity_groups/commons_radioactivity_groups.views_default.inc
commons_radioactivity/commons_radioactivity.views_default.inc
commons_polls/commons_polls.views_default.inc
commons_documents/commons_documents.views_default.inc
commons_activity_streams/commons_activity_streams.views_default.inc
commons_activity_streams/commons_activity_streams_groups/commons_activity_streams_groups.views_default.inc
commons_search/commons_search.views_default.inc
commons_site_homepage/commons_site_homepage.views_default.inc
commons_featured/commons_featured.views_default.inc
commons_notices/commons_notices.views_default.inc
commons_wikis/commons_wikis.views_default.inc
commons_groups/commons_groups.views_default.inc

Some random examples of strings that aren't available on l.d.o:
- "Recent site activity"
- "Recent activity in this group"
- "Upcoming events" (listed on l.d.o as part of other non-commons modules)
- "You're attending"
- "Search within group"

ezra-g’s picture

+ t('more'),
+ t('Apply'),
+ t('Reset'),
+ t('Sort by'),
+ t('Asc'),
+ t('Desc'),

Is Commons Groups really the right place to translate these strings? Surely these are not specific to Commons Groups. Perhaps Views module is the appropriate place for these, rather than duplicating in Commons Groups?

hansfn’s picture

@japerry: Thx for your effort so far.

@ezra-g: If translatables were created manually I would agree with your thinking, but luckily they are created automatically when the view is exported. Anyway, a translatables list doesn't mean that the strings should be translated in this or that module, but that they are used there. The strings you listed are of course already translated and available on localize.drupal.org for all modules that use them.

PS! I'm not objecting to modify the export code in Views so such generic/common strings are excluded ;-)

Devin Carlson’s picture

Version: 7.x-3.2 »
Status: Active » Needs review
FileSize
933 bytes

A patch for the remaining commons_featured module and then onto an audit.

Devin Carlson’s picture

Committed #13 to Commons Featured Content 7.x-3.x.

http://drupalcode.org/project/commons_featured.git/commit/6cc4924

Devin Carlson’s picture

After performing a search through all of the views provided by the Commons modules, it looks like there are only three left.

  • activity_group
  • commons_bw_posts
  • commons_radioactivity_groups_active_in_group
Devin Carlson’s picture

Status: Needs review » Fixed

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary -typo.