This (i think) is related to http://drupal.org/node/818136#comment-3528916

Extractor can't extract these strings (comment module ):

 // Adjust the Field UI tabs on admin/structure/types/manage/[node-type].
  // See comment_entity_info().
  $items['admin/structure/types/manage/%comment_node_type/comment/fields']['title'] = 'Comment fields';
  $items['admin/structure/types/manage/%comment_node_type/comment/fields']['weight'] = 3;
  $items['admin/structure/types/manage/%comment_node_type/comment/display']['title'] = 'Comment display';
  $items['admin/structure/types/manage/%comment_node_type/comment/display']['weight'] = 4;
}

Hey, maybe this was my chance to write my first patch, but sorry i can't .... :-(

Comments

yched’s picture

Project: Drupal core » Translation template extractor
Version: 7.0-beta2 » 7.x-1.x-dev
Component: comment.module » Code

Strings in hook_menu() must not be t()'ed. The pot extractor explicitly extracts 'title' and 'description' entries it finds in hook_menu().
If it doesn't find similar strings in hook_menu_alter(), then that seems like a bug in the extractor ?

Bumping over there.

sun’s picture

wow, nice catch.

gábor hojtsy’s picture

Title: "Comment fields" and "Comment Display", tabs are not translatable on Content's type edit page » Hook_menu_alter() not supported in potx

Ok, well, the general issue is that hook_menu_alter() is not at all supported in potx. We should come up with a standard set of token sequences which can be reliably used to identify titles and descriptions, so hook_menu_alter()s can be parsed as well. Hook_menu() is standardized to use 'title' => 'Title text', while hook_menu_alter() might or might not use that.

Can we assume that whatever is in ...['title'] = 'Title text' and 'title' => 'Title text' in hook_menu_alter() should be saved as translatable title? Similarly for descriptions?

yched’s picture

@Gabor : that sounds reasonable.
The ['title'] = 'Title text' pattern is probably more something to be found in hook_menu_alter(), but I guess semi-complex hook_menu() implementations might use it too.

This variety of patterns and places to look for them raises once again the question of a no-op equivalent of t() - mentioned in #503550-7: Translated strings are cached in _info() hooks, and put aside in #15.
We can stick to the solution of hardcoding special cases in the extractor, possibly because its' too late for a new function, but this is incredibly fragile and short-sighted. The number of 'info'-style hooks caching translatable strings has just exploded in D7 - core and contrib...

inductor’s picture

Any progress on that? I`ve recently discovered that I just can`t translate admin_menu`s 'Edit !content-type' string because of this issue.

gábor hojtsy’s picture

Status: Active » Closed (duplicate)

Ok, well, this is actually a duplicate of #813370: Hook_menu_alter() not supported by potx which was reported much earlier. Ideas, good implementations welcome.