Page MenuHomePhabricator

securepoll-votereligibility-list-* messages should be documented in comments
Open, LowPublic

Description

It's hard to grep for the usage of securepoll-votereligibility-list-* messages, because their message keys are built in run time. The usual practice is to mention the full key names in comments nearby. See
https://www.mediawiki.org/wiki/L10n#Using_messages


Version: unspecified
Severity: normal

Details

Reference
bz68174

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:41 AM
bzimport set Reference to bz68174.
bzimport added a subscriber: Unknown Object (MLST).

Hi, I’d like to work on this task.
From the description, I understand that the message keys are dynamically constructed, so I plan to locate their usage in the code and add comments listing all possible securepoll-votereligibility-list-* message keys for better discoverability.
Please let me know if this approach looks good.
Thanks!

Sure go ahead. The idea behind this task is to take a line such as...

"securepoll-$action-redirect"

And add a comment above it spelling out the message keys, to make searching easier.

// Messages: securepoll-edit-redirect, securepoll-translate-redirect,
// securepoll-list-redirect, securepoll-votereligibility-redirect

Keep in mind this task is ancient and things may have been refactored since then. For example, I did a search for securepoll-votereligibility-list- and didn't find anything that needs commenting. However maybe we need to search for a smaller piece of that string:

image.png (514×1 px, 67 KB)

Maybe $name = $this->msg( "securepoll-votereligibility-$which" )->text();?

Or maybe this got refactored 10 years ago and these message keys no longer exist and we should close this task as invalid. Maybe poke around a bit and let us know what you find :)

The bottom 3 from this search can use comment labeling (the top 2 are already labelled):

image.png (758×967 px, 118 KB)

Thanks for the clarification!
I’ll start working on this and update if I run into anything unclear.

Messages for securepoll-votereligibility:
securepoll-votereligibility-list
securepoll-votereligibility-edit
securepoll-votereligibility-redirect
// securepoll-votereligibility-translate
$name = $this->msg( "securepoll-votereligibility-$which" )->text();