Use more compact timestamps for notifications
Closed, ResolvedPublic

Description

During our recent research sessions we used prototypes (first, second) that included the use of more compact timestamps.

Instead of "2 hours ago", just using "2 hours" or even "2h" seems to be enough for users to understand when the notification was received. It would be good to use a more compact representation of timestamps (at least in the notification panel where space is more limited).

Pginer-WMF updated the task description. (Show Details)
Pginer-WMF raised the priority of this task from to Needs Triage.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptFeb 5 2016, 1:03 PM
jmatazzoni set Security to None.Feb 11 2016, 12:29 AM
jmatazzoni added subscribers: Amire80, MSchottlender-WMF.

I agree the notifications can get crowded when usernames, pagenames etc. are long. Shortening the timestamp could help with that. @Pginer-WMF suggests:

Instead of "2 hours ago", just using "2 hours" or even "2h" seems to be enough for users to understand

I agree "ago" should go. That's easy.

2h is what Twitter does. But I seem to remember Moriel observing that translation could be an issue in certain languages, where hours and minutes start with the same letter. So, some thoughts and questions:

  • I've added Moriel and Amir to this task for their comment.
  • We could, as Gmail does, use the actual clock time. But "2:06 PM" is actually longer than "2 hours," so I'm not sure what that buys us.
  • I imagine most languages have standard abbreviations, as English does. (hrs, mins). Assuming these are generally pretty short, this might be the best compromise.
  • Twitter runs its notation together-- 2h instead of 2 h -- presumably to save space? If we go with abbreviations, I personally would keep the space but lose the period that indicates an abbreviation. So, " 2 hrs"

Thoughts?

We could, as Gmail does, use the actual clock time. But "2:06 PM" is actually longer than "2 hours," so I'm not sure what that buys us.

There have been several discussions about whether to use relative or absolute timestamps. I think that relative timestamps make sense for the "recent" timeframe since they provide a more intuitive reference. So at least for notifications in the same day, I'd keep using them.

I imagine most languages have standard abbreviations, as English does. (hrs, mins). Assuming these are generally pretty short, this might be the best compromise.

We can rely on translators to do the right thing. We can include instructions for the translation (qqq) mentioning the following:

  • Represent the "hour" unit of time abbreviated as much as makes sense in your language.
  • This message will appear in contexts next to similarly abbreviated units for "days" (link to the other message). If the abbreviation in your language makes them indistinguishable, use the full word instead.

Looking at my notifications, I now see that the relative scale goes from "a few seconds ago" to "24 days ago" to "3 months ago" to "2 years ago" -- and probably beyond.

Assuming we drop "ago," in English that would be:

a few secs
30 mins
45 hrs
24 days
3 mos
2 yrs
(looks like we don't do weeks).

I would submit that after "1 day," simple date notation would be just as helpful-- or more helpful, in fact. If we used dates and added a rule that we don't note the year for the year we're currently in, then using a date would save space or be equal in most instances. E.g.: "3 mos" vs. "1/15". I'm a little worried about scope here, so the question for me, anyway, is which is easier to do?

Using abbreviations is liable to be simple technically but to involve a certain amount of work to internationalize. Implementing numerical dates after 1 day (or 2 or whatever we decide) -- while not showing year for the current year -- involves some programming but, but maybe it's code we've more or less written already?

So, I'd appreciate some input on this. @Amire80? @Mattflaschen?

Using abbreviations is liable to be simple technically but to involve a certain amount of work to internationalize.

I've seen this statement repeated before a few times, so I have to point out that sadly, that's not quite as easy technically. Moment JS doesn't support abbreviations, so while we can add it in, it will require some manipulation on top of the translation. I took a look at this early on when work on the new notifications started, and it was decided we skip it for now not just because of the translations.

In not saying it's impossible, but it's also not as easy or quick as it sounds.

I would submit that after "1 day," simple date notation would be just as helpful-- or more helpful, in fact. If we used dates and added a rule that we don't note the year for the year we're currently in, then using a date would save space or be equal in most instances. E.g.: "3 mos" vs. "1/15". I'm a little worried about scope here, so the question for me, anyway, is which is easier to do?

This aligns with what I proposed earlier: relative times for the current day, and abbreviated dates (skipping the year if it is the current one) for older items. I could not find the ticket about that discussion, but in any case we can approach this in incremental steps:

  1. Use time units instead of references to the past: "2 hours ago" -> "2 hours".
  2. Abbreviate relative times: "2 hours" -> "2h"
  3. Be smarter about when is better to use relative vs. absolute time: "2h", "12 Feb", "10 Feb 1998"

If there are no big concerns with step 1, let's start with that.

In not saying it's impossible, but it's also not as easy or quick as it sounds.

From the moment.js documentation it seems they accept localised abbreviations, maybe we could consider adding those from Mediwiki messages that get translated as other strings of our products. Which are the specific issues you are anticipating for this case?

Change 273560 had a related patch set uploaded (by Mooeypoo):
Add a short abbreviation for timestamps in notifications

https://gerrit.wikimedia.org/r/273560

Mooeypoo claimed this task.Feb 27 2016, 1:20 AM

Timestamps are now short with this commit; only caveat is that we have to make sure these abbreviations are translated.

Also, this uses a bit of a hacky method to override momentjs' locale settings.

Timestamps are now short with this commit; only caveat is that we have to make sure these abbreviations are translated.

Also, this uses a bit of a hacky method to override momentjs' locale settings.

It's the standard way to do it, AFAICT. The only part that's hacky is that you have to reset the global locale after defining one. They're apparently planning to change this.

The other thing that could be done differently is to have a shared local Moment instance used for Echo. I don't see a need for that, though.

I wasn't sure if that's the standard way to go because of the need to switch the actual locale afterwards, but I think the more "hacky" thing here is that we're mixing the momentjs translations with mediawiki's i18n translations. In this case it's probably okay, but it does make it weird for momentjs-specific translations.

There's no real good way to add those translations to our use or some extension of momentjs in the way that mediawiki currently using it, though, so this is probably the best that we have right now.

Change 273560 merged by jenkins-bot:
Add a short abbreviation for timestamps in notifications

https://gerrit.wikimedia.org/r/273560

The short abbreviations have been added - see the examples in the screenshots for seconds, minutes, days, and months.
@jmatazzoni: We are ok with

  • no plural forms - no mos
  • no dot after the abbreviation - not 3mo.
  • no space - 2h - not 2 h

In some languages it's not as easy to make one- or two- letter abbreviations.

In English it's easy: s, m, h, d, mo, y.

But in Hebrew, second, hour and year begin with the same letter; second and year begin with the same two letters; and since the word "year" has three letters, it doesn't make sense to abbreviate it.

Also when it's "1 year" or "2 years" it's better not to write the number, because there are special words for it.

So I had to translate most of these with more than one letter. I hope there will still be room for them.

Of course, it's likely that Hebrew is not the only language that has issues of this kind.

In some languages it's not as easy to make one- or two- letter abbreviations.

In English it's easy: s, m, h, d, mo, y.

But in Hebrew, second, hour and year begin with the same letter; second and year begin with the same two letters; and since the word "year" has three letters, it doesn't make sense to abbreviate it.

Also when it's "1 year" or "2 years" it's better not to write the number, because there are special words for it.

So I had to translate most of these with more than one letter. I hope there will still be room for them.

Of course, it's likely that Hebrew is not the only language that has issues of this kind.

The goal is to encourage a shorter version whenever it is possible according to the language. I tried to capture the idea in T125970#2018445. If there is way to communicate that to translators, it would be great (I proposed some note in qqq but not sure if there are better options)

@Etonkovidova points out that the new abbreviations have:

no plural forms - no mos
no dot after the abbreviation - not 3mo.
no space - 2h - not 2 h

I don't love it but it looks like we're following the Twitter model here and I guess I'm OK with that. Arguably Twitter is a more restricted space than ours, though I see in the above screenshot that it can get pretty tight in bundled messages.

I'm closing this but will be open to hearing from anyone who thinks we need to be more verbose with these abbreviations.

jmatazzoni closed this task as Resolved.Mar 11 2016, 12:57 AM