Active
Project:
Translation template extractor
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Jan 2011 at 16:00 UTC
Updated:
18 Jul 2017 at 11:53 UTC
Jump to comment: Most recent
Comments
Comment #1
gábor hojtsyWe could maybe find a 'context' => 'Something' key in title_arguments, but (a) we cannot ensure that is the syntax people will use. Also, we'd need to somehow pair up the titles with their arguments, although they can come in any order. To demonstrate what I mean:
For these to be identified properly, we'd need a much more sophisticated state machine, where we can tell if we are in an item array or not, so we could save the context appropriately. Then for more complex things like the context for a title being modified later like in (4) or maybe even those two things separated to hook_menu() and hook_menu_alter(), it becomes pretty impossible to track.
So for this to be reliably identified, I'd suggesting using title_callback for now instead of letting people rely on title_arguments. Then the custom title_callback can use t(), format_plural() and friends and specify the context as needed, such as:
Comment #2
gábor hojtsyRetitling to point out the status quo.
Comment #3
dmsmidtWow, after years of Drupaling I only run in to this now. Yes please!
Comment #4
dmsmidtBut, it seems that the examples you give don't actually work in Drupal anyhow..