Page MenuHomePhorge

Clean up the Community Panel timestamp logic + related i18n
Open, Needs TriagePublic

Description

The Community Panel is a port of the original Community Widget and retains custom i18n and an "ago" implementation, something somewhat better doable with MW core's getHumanTimestamp, provided that the "ago" mechanism is still something we want (it may or may not be, there are valid i18n concerns around it, for example).

If we want to retain the "ago" logic:

  • CommunityPanel function should use $lang->getHumanTimestamp( new MWTimestamp( $val['timestamp'] ) ) instead of calling the custom function
  • The monaco-community-hoursago, monaco-community-minutesago, monaco-community-secondsago and monaco-community-yesterday i18n messages should be removed (from i18n/en.json as well as all relevant translations which have one or more of these messages)
  • ...but this alone isn't sufficient and the monaco-latest-item i18n message and its logic should also be cleaned up (which is precisely the reason I'm filing this ticket instead of just doing it)
    • and it's such a mess. Currently the value of monaco-latest-item is $1 by $2 which, of course, is a nightmare to translate, but it should likely be something like [[$1]]<br />by [[$2]] on $3; however if and when rel=nofollow on the links is desired, that'd have to be "post-processed" into the HTML via some str_replace voodoo

If we do not want to retain the "ago" logic:

  • Just scrap Community Panel's custom time formatting method and pass in the date as-is

Event Timeline