Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
API page: https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/lang...
> $property: Optional property of the language object to return
The parameter is not properly documented:
- should say '(optional)'
- wording could do to be clearer, eg, 'The name of a property on the language object to return.'
The @return value is missing.
Comment | File | Size | Author |
---|---|---|---|
#22 | interdiff-2622012-17-22.txt | 501 bytes | walangitan |
#22 | doc-error-2622012-22.patch | 977 bytes | walangitan |
#17 | doc-error-2622012-17.patch | 984 bytes | walangitan |
#15 | doc-error-2622012-14.patch | 968 bytes | Shreya Shetty |
#10 | doc-error-2622012-9.patch | 854 bytes | snehi |
Comments
Comment #2
rashid_786 CreditAttribution: rashid_786 at SDG Corporation commentedchanges made as per suggestions.
Comment #3
rashid_786 CreditAttribution: rashid_786 at SDG Corporation commentedComment #5
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedComment #6
jhodgdonThanks for the issue and patch! It needs some work though:
This is a function. The first line summary should still start with a verb.
(optional) should be lower-case by standard. Then Property should be upper-case, and the line should end in .
Default should be capitalized. And we should be specific here: is it returning a language code or a language object? Or really, if you see the $property parameter, I guess it can return all sorts of things, so this line is not really correct or complete.
Comment #7
priya.chat CreditAttribution: priya.chat at Publicis Sapient for Publicis Sapient commentedComment #8
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedAssigning to myself due to no activity.
Comment #9
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedAttaching patch as per #6.
@johngdon i think
I think this is correct except default keyword.
Please see this https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/lang...
I may be wrong.
Comment #10
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedForgot to attach patch and interdiff.
Comment #12
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedComment #13
joachim CreditAttribution: joachim commentedWe've lost the fact it's the default we're returning here.
It's pretty tricky to do a first-line for this function, as it has two fairly different return values and we really want to mention both in the first line.
I would put this as:
Returns the default language, as an object, or one of its properties.
That fits in 80 characters.
This needs expanding. Here there's no one-line limit so we can say something like:
Returns either the language object for the default language used on the site, or the property of that object named in the $property parameter.
Comment #14
Shreya Shetty CreditAttribution: Shreya Shetty at Trigyn Technologies Ltd commentedComment #15
Shreya Shetty CreditAttribution: Shreya Shetty at Trigyn Technologies Ltd commentedComment #16
walangitan CreditAttribution: walangitan at Chromatic commentedThere were a couple of extra spaces in #15 that I removed and also used the description in #13 to re-include the default that's being returned.
Comment #17
walangitan CreditAttribution: walangitan at Chromatic commentedFixed some more issues with spacing from #16.
Comment #19
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commented@Shreya Shetty and @walangitan
Whenever you upload a new patch please upload interdiff.
It is easy for reviewer to see what has been changed since last patch.
Comment #20
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedplease wrap it to 80 columns please.
Comment #21
joachim CreditAttribution: joachim commented> + * Returns either the language object for the default language used on the site,
If this is getting rerolled anyway, then remove the 'Returns' from the start of that sentence.
'Returns foo' describes the whole function. The @return line doesn't need to say it.
Comment #22
walangitan CreditAttribution: walangitan at Chromatic commentedRerolled the patch based on comments from 20 & 21.
Comment #23
walangitan CreditAttribution: walangitan at Chromatic commentedComment #24
joachim CreditAttribution: joachim commentedLooks good to me.
Comment #25
jhodgdonAgreed, thanks!
Comment #26
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedCommitted to 7.x - thanks!