Page MenuHomePhabricator

Adds details to Calendar event feed titles
ClosedPublic

Authored by SalmonKiller on Jun 19 2015, 12:43 AM.
Tags
None
Referenced Files
F14044115: D13352.id32303.diff
Tue, Nov 12, 3:02 PM
F14042850: D13352.id32303.diff
Tue, Nov 12, 6:36 AM
F14037987: D13352.diff
Sun, Nov 10, 8:43 PM
F14023615: D13352.diff
Thu, Nov 7, 3:11 AM
F14008190: D13352.diff
Tue, Oct 29, 5:13 PM
F14006628: D13352.id32304.diff
Mon, Oct 28, 2:28 PM
F14006626: D13352.id32310.diff
Mon, Oct 28, 2:28 PM
F14006625: D13352.id32303.diff
Mon, Oct 28, 2:28 PM
Subscribers

Details

Summary

Closes T8340

Test Plan

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

Diff Detail

Repository
rP Phabricator
Branch
prettyfeedtitles
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 6861
Build 6883: [Placeholder Plan] Wait for 30 Seconds

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?

266–269

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".

452–455

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

457–461

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

463

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
266

"of *this* event"

463

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.

266

Drop "has" here, too.

457

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.