[Mediawiki-i18n] moment.js and i18n messages

Jon Robson jrobson at wikimedia.org
Wed Nov 5 01:55:13 UTC 2014


FYI mobile do this too in the top of thr page in the last modified bar. It
would be good to standardise our approach here. Maybe we could propose
something for core?
On 4 Nov 2014 12:35, "Erik Bernhardson" <ebernhardson at wikimedia.org> wrote:

> secWithin flow we display a number of humanized timestamps, such as '5
> minutes ago'  These are provided by MWTimestamp::getHumanTimestamp() in php
> and moment.js in javascript.  We are adjusting this feature to have a few
> more messages, in english these would be:
>
> * 5 minutes ago
> * Edited 5 minutes ago
> * Edited by ErikB 5 minutes ago
>
> We would like to represent the last two with i18n messages like:
>
> * Edited $1
> * Edited by $1 $2
>
> This is the exact same use case and solution that is already used in
> MobileFrontend:
>
> https://www.mediawiki.org/wiki/MediaWiki:Mobile-frontend-watchlist-modified
>
> The alternative is to define a message for every possible timeframe from a
> moment ago
> up to N years ago(which is also much less robust than the builtin ago
> methods):
>
> * Edited a moment ago
> * Edited $1 {{PLURAL:$1|second|seconds}} ago
> * Edited $1 {{PLURAL:$1|minute|minutes}} ago
> ...
>
> I'm writing to double check that this is reasonable and allowed by the
> i18n team.
>
> Erik B.
>
>
> _______________________________________________
> Mediawiki-i18n mailing list
> Mediawiki-i18n at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-i18n
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.wikimedia.org/pipermail/mediawiki-i18n/attachments/20141104/f80c63d1/attachment.html>


More information about the Mediawiki-i18n mailing list