Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Feb 2016 at 13:38 UTC
Updated:
17 Jul 2016 at 23:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jhodgdonIt's an arbitrary string, which is why it isn't really explained...
There is some explanation here for 8:
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Language!language...
and there are a bunch of 8.x functions with the same args, like TranslationInterface::translate() and for that matter t() and StringTranslationTrait::t(), that would need this documentation updated if we're going to update it for the D7 t() function.
So for D8 functions, we should do something like:
In D7, we don't have this topic, so we'd need to write something (preferably short) and then maybe link to that localize.drupal.org page.
Comment #3
micaelamenara commentedHere Its the Patch!
Comment #4
jhodgdonThanks for trying! The patch needs some work though:
This line has an extra space at the end. And it needs a space at the beginning between the * and the text.
Also rather than being its own paragraph, it should be added above at the end of the text that mentions 'context'.
This comment applies to the other two places this was put into the patch as well.
Comment #6
micaelamenara commentedThis is how I understood what you wrote. Please let me know if there is anything to be changed.
Regards.
Comment #7
jhodgdonCloser!
Yes, that is what I meant.
However:
- Why did you move the word "string" down to the next line? It was better up where it was. We want documentation lines to wrap as close to 80 characters as possible, without going over.
- @link ... @endlink has to stay on the same line. I think if you move "string" back up a line, you'll be able to fit the @endlink there... if not, then you would need to move the whole @link ... @endlink down to the next line.
Here, move @link ... @endlink down to the next line.
Here too.
Comment #9
heykarthikwithu.
Comment #10
heykarthikwithuComment #11
micaelamenara commentedComment #13
dagmarUnrelated test failure.
Comment #14
jhodgdonThanks! patch looks good now.
Comment #16
dagmarUnrelated test failure.
Comment #17
jhodgdonComment #22
catchCommitted/pushed to all three 8.x branches. Moving to 7.x for backport.
Comment #23
dagmarThis is the patch for Drupal 7.
Comment #24
jhodgdonThanks! It's pretty good... a few small suggestions:
It would be better, in this line, to just put in the URL directly rather than making an @link ... @endlink.
know -> learn
Comment #25
dagmarSure, thanks!
Comment #26
jhodgdonBetter!
So ... sorry I didn't look at this before... but let's compare this patch to the 8.x patch.
8.x, after patching:
And the internationalization topic says (in part):
And here is what is in the current patch for 7.x:
So... Since we don't have a topic that explains context in more detail in 7.x, I like that you put in more information in the 7.x doc block for t() than we had in the 8.x block. But I'm not sure that this text really explains the problem very well...
What about something like this?
Note: I didn't bother with an interdiff file since it's the same exact lines as the patch itself (all patched lines changed).
Comment #27
dagmarLooks great. Thanks!
Comment #28
fabianx commentedMarked for commit, thanks!
Comment #29
stefan.r commentedThis looks great, thanks!
Comment #30
David_Rothstein commentedCommitted to 7.x - thanks!
Comment #32
David_Rothstein commentedJust a note that the "@ref sec_context" doesn't seem to be working (it's just displayed as is at https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/t/7.x - no automatic link to the section). Not sure if that's something that should be fixed on api.drupal.org or if we should just remove it from the code here instead.
Comment #33
stefan.r commentedHow about
See the "String context" section above for more information(no link) for now?Interestingly the @ref tag does seem to work on in D8 core documentation
Comment #34
David_Rothstein commentedThat sounds good to me.