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.
Erik Bernhardson, 04/11/2014 21:35:
I'm writing to double check that this is reasonable and allowed by the i18n team.
I don't know what's the current best practice, but https://bugzilla.wikimedia.org/show_bug.cgi?id=67959
Nemo
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@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@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-i18n
Jon Robson, 05/11/2014 02:55:
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?
Conversations on such timestamp issues have been going on since 2012 with no conclusion, AFAIK. In 2013 something started with jQuery devs, Krinkle would know about it. I've dumped something in https://www.mediawiki.org/wiki/JQuery.globalize
Nemo
Hi,
On Tue, Nov 4, 2014 at 9:35 PM, Erik Bernhardson <ebernhardson@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
If I understand you correctly, you take the result of MWTimestamp::getHumanTimestamp() and put it into “Edited $1”? That should work, I believe (in Czech, at least, I can’t speak for all languages). You definitely cannot use “Edited $1 ago”, with $1 being just a plain time indicator like “5 minutes”, which is what bug 67959 is about.
-- [[cs:User:Mormegil | Petr Kadlec]]
In the CLDR "x ago" are full strings. They will have a reason to have done that.
So, something like
* a moment ago * $1 {{PLURAL:$1|second|seconds}} ago * $1 {{PLURAL:$1|minute|minutes}} ago
and
Edited $1
with an approproate translators comment sounds best to me, and the time strings should definitely be in core and translated ony once across all of Mediawiki.
Maybe you can even take the "X ago" part directly from the CLDR?
mediawiki-i18n@lists.wikimedia.org