Page MenuHomePhabricator

Adds details to Calendar event feed titles
ClosedPublic

Authored by SalmonKiller on Jun 19 2015, 12:43 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 15, 9:50 AM
Unknown Object (File)
Mon, Apr 15, 6:47 AM
Unknown Object (File)
Mon, Apr 15, 6:47 AM
Unknown Object (File)
Mon, Apr 15, 5:54 AM
Unknown Object (File)
Mon, Apr 15, 5:54 AM
Unknown Object (File)
Mon, Apr 15, 2:48 AM
Unknown Object (File)
Wed, Apr 10, 9:24 PM
Unknown Object (File)
Wed, Apr 10, 4:39 PM
Subscribers

Details

Summary

Closes T8340

Test Plan

Verify that calendar event feed titles have more detail that before.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

SalmonKiller retitled this revision from to Adds details to Calendar event feed titles.
SalmonKiller updated this object.
SalmonKiller edited the test plan for this revision. (Show Details)
lpriestley edited edge metadata.

All the other transaction feed stories end with a period. We should be consistent.

src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php
261

On second thought, maybe this would sound better as, %s set this event to repeat %s?

282–285

The other date-related transaction feed stories don't actually specify the new value, so let's drop it here for consistency. There also might be some peskiness related to formatting and rendering the date, and because we don't actually ever hit this case, we probably want to avoid any uncertainties.

Also, this isn't the "end date" of the event (that's something separate). This is the "recurrence end date".

467–470

This should match what is in getTitle as best as it can. So, %s made %s a recurring event.

472–476

For now, this only shows up on event creation, and there is no "change" in that case. Would be more versatile to make this, %s set %s to repeat %s

497

We already have a separate transaction for TYPE_END_DATE and this could be confusing, so we should definitely mention the "recurrence" part. And, as in a previous comment, we don't actually include the new date in other date-related transactions, so let's drop it.

This revision now requires changes to proceed.Jun 19 2015, 1:48 AM
SalmonKiller edited edge metadata.

Added dots to the ends of the messages

SalmonKiller edited edge metadata.

Implemented lpriestley's suggestions.

lpriestley edited edge metadata.
lpriestley added inline comments.
src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php
282

"of *this* event"

497

Actually, getTitleForFeed does add the new value to the story, so it would make sense to add it here. But, again, "changed" seems inaccurate, as this is on event creation.

This revision now requires changes to proceed.Jun 19 2015, 2:12 AM
SalmonKiller edited edge metadata.

Implemented lpriestley's suggestions

lpriestley edited edge metadata.
epriestley edited edge metadata.
epriestley added inline comments.
src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php
257

For consistency, just say "%s made this event recurring." instead of "%s has made this event recurring." (that is, no "has"). We don't use the word "has" in other strings (for example: "%s created this revision.", not "%s has created this revision.").

261

This isn't translatable because the second parameter will be an English word like "daily", "weekly", or "monthly".

It's also not sufficient to just translate the word fragments separately. In some languages, the rest of the sentence may depend on the word. For example, it's possible that this phrase translates into Spanish most naturally like "repeats on the x", as either "..repetere un la dia." or "...repetere un el mes.", where the use of the article "la" or "el" varies depending on whether the noun "day" or "month" is feminine or masculine (I don't know Spanish and this specific case is probably not correct, but this is a general issue with translating into other languages).

To allow translators to translate this string properly, each variant of it needs to be separated out, something like this:

switch ($new) {
  case SomeCalendarClass::SOME_DAILY_CONSTANT:
    return pht('%s set this event to repeat daily.', ...);
  case SomeCalendarClass::SOME_MONTHLY_CONSTANT:
    return pht('%s set this event to repeat monthly.', ...);
  ...
}

Then foreign language translators can translate the word and adjust articles appropriately.

282

Drop "has" here, too.

472

Same "daily" issue here.

This revision now requires changes to proceed.Jun 19 2015, 12:37 PM
SalmonKiller edited edge metadata.
SalmonKiller marked 5 inline comments as done.

Implemented changes suggested by epriestley.

epriestley edited edge metadata.

Looks great, thanks!

I updated the documentation too, since it was basically impossible to guess the right rules or understand the reasoning before:

https://secure.phabricator.com/book/phabcontrib/article/internationalization/

This revision is now accepted and ready to land.Jun 20 2015, 4:45 PM
This revision was automatically updated to reflect the committed changes.