Page MenuHomePhabricator

[[MediaWiki:Pageinfo-visiting-watchers]] cannot be properly translated (plurals versus dealing with vague time)
Closed, ResolvedPublic

Description

I'm concerned about the formatting of this message, as I can't see any support for either the PLURAL tag or any way of gauging the grammatical gender of the variable result in the documentation (assuming both "day"/"dag" and "year"/"år" are expected results, having different "genders" in Norwegian, which would add different determiners: "Den siste dagen.", "De siste dagene.", and "Det siste året" being examples of this. How may I ensure that the message stays true to the original string, as well as being grammatically correct in the target language?


Message URL: https://translatewiki.net/w/i.php?title=Special:Translate&showMessage=pageinfo-visiting-watchers&group=core&language=nb

Event Timeline

It cannot contain year/år (the number is specified in seconds, and a leap year doesn’t consist of the same number of seconds as a non-leap year, so to avoid disambiguity, the largest unit to display is days), but it may contain minutes or seconds if the specified time duration is not more than two days (172,800 seconds) – in this case, no days are displayed. So some possible values:

  • 30 dager (usual)
  • 2 dager
  • 48 timer 0 minutter
  • 24 timer 1 minutt
  • 59 minutter 59 sekunder
  • 1 minutt 1 sekund (we’re getting to really way too little values, but they are AFAIK technically possible)
  • 1 minutt 0 sekunder
  • 59 sekunder
  • 9,0 sekunder (if the number is less than 10, a decimal digit is displayed)
  • 1,0 sekund

So you can safely assume that it will never contain singlar dag. If necessary, you can also assume that it will always contain dager, since any really useful value is larger than 48 hours, but you should be aware that values as little as 1.0 second are technically possible.

So you can safely assume that it will never contain singlar dag.

This may be correct for nb. It is an incorrect assumption for languages which use the singular word day for a specific number of days greater than 1.
So I consider this a valid bug.

I never said it’s not a valid bug. It may not be a realistically fixable one, though…

Heh, I agree (sorry if it sounded like "correcting" you, wasn't my intention!)

I already made some comments about this in the relevant patch, but they've gone unanswered (presumably because the patch is already merged), so I'll copy them here:

First comment:

The change in the message here is a bit problematic from an i18n POV for a couple of reasons. Time intervals/durations in translations are difficult. I'll use my native Norwegian to explain.
$1 is a time period of an arbitrary length (decided by config). I'm not sure if it's always given as days, but in any case it is problematic.
If the length is one day, the last $1 in Norwegian would be "den siste dagen". If the length is 2 or more days, it would be "de siste 2 dagene". However, the $1 as given will produce "2 dager", so you will get "de siste 2 dager" instead of "de siste 2 dagene".
Also, if the $1 produces different time units (like months or years), the gender of the word could be different. Again, in Norwegian, if $1 is "1 year", the translation of "the last $1" would be "det siste året", but if it is "1 month", it will be "den siste måneden".
These examples are for Norwegian, but they would also be applicable to lots of other langauges – and consider languages like Russian where 32, 42, 52, etc. use the same conjugation as 2, so it's not just one vs. many.

Second comment:

Proposed solution: Choose one time unit (probably days) and use only that, and include that explicitly in the message, like what is done for the message activeusers-intro. That way translators will know what "the last" refers to, and they will be able to use PLURAL on $1 if necessary.
Alternatively, use separate messages for various time units (at least the ones most commonly relevant for this – perhaps hours, days, months, years?). That would be a bit cumbersome though.

Aklapper renamed this task from [[MediaWiki:Pageinfo-visiting-watchers/nb]] translation issue, grammatical gender and possibly plural results when dealing with vague time to [[MediaWiki:Pageinfo-visiting-watchers]] cannot be properly translated (plurals versus dealing with vague time).Apr 29 2024, 8:59 PM

Change #1025677 had a related patch set uploaded (by Jon Harald Søby; author: Jon Harald Søby):

[mediawiki/core@master] InfoAction: Specify days directly in pageinfo-visiting-watchers

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

Change #1025677 merged by jenkins-bot:

[mediawiki/core@master] InfoAction: Specify days directly in pageinfo-visiting-watchers

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