Page MenuHomePhabricator

incorrect noun case for 'Month XX' in certain languages
Closed, ResolvedPublic

Description

Use user preference date for function getNotifications(). Currently it uses genitive month names which is wrong in at least in German.

Current output: Januars 04

Expected output: 4. Januar 2013 (based on user preference)


Version: unspecified
Severity: normal
URL: https://www.mediawiki.org/wiki/Special:Notifications?uselang=de

Details

Reference
bz47211

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:36 AM
bzimport added projects: Notifications, I18n.
bzimport set Reference to bz47211.
bzimport added a subscriber: Unknown Object (MLST).
Raymond created this task.Apr 14 2013, 9:33 AM

I think its also using server time rather than local time. Supposed to be an easy fix for that, like I did for PageTriage in https://gerrit.wikimedia.org/r/#/c/41373/2

(In reply to comment #0)

Current output: Januars 04
Expected output: 4. Januar 2013 (based on user preference)

From the work done in code this looks intentional, will wait for comments from original developers before submitting a change.

Without expressing any opinion on whether this is a good idea or not, we're currently not using the user pref date format on Special:Notifications on purpose. The format we're using is a shorter, less formal format:
Today, Yesterday, January 16, January 12...

Unfortunately, I don't know much about how genitive month names work, but I have a sort of basic idea of the concept. What would be the correct way to write the sequence above in German? Would it be something like:
Heute, Gestern, 16 des Januar, 12 des Januar...

That's just a guess.

All the info I've been able to find on genitive tense on the web is confusing. It seems that you're supposed to use genitive tense when the month name appears with a date number, but from Raimond's comments, I would infer the opposite. Raimond or Siebrand, can you enlighten me?

"16. des Januar" is correct in a grammatically sense but total uncommon in German. Nearly nobody writes it.

"Januars 16" or "16. Januars" is clearly wrong.

My suggestion: Use the less formal format for "today", "yesterday" and switch then to the date format per user preference.

(In reply to comment #3)

It seems that you're supposed to use genitive tense when the month name
appears with a date number

Which of the tens of thousands of human languages did you refer to with this statement? :)
For Czech using the genitive form is correct. For German it's not.

@Raimond: Could you provide me with an example of how to write January 16 in German that would be considered "correct"? The specs for this feature specifically require using a short form here. I'll suggest the alternative idea to the designer and product manager, but I need something that works in the meantime.

@Andre: I'm lost. According to MessagesCs.php, Czech has genitive month names which are different than the non-genitive month names. Why would it be wrong to use those?

@Andre: Opps, I read your comment backwards. Why would it be wrong to use the genitive month names in German? It would be great if someone could actually explain this stuff to me instead of just telling me I'm doing it wrong :P

(In reply to comment #7)

Why would it be wrong to use the genitive month names in German?

See comment 4: Simply nobody ever does that. Same in English: Would you say "December's 25th"? No, but is it wrong? Neither. :D

It would be great if someone could actually explain this stuff
to me instead of just telling me I'm doing it wrong :P

The explanation likely is: Grammars in languages differ, and not all languages use genitive for month names.
Hmm, maybe http://erack.org/blog/archives/2-LibreOffice-possessive-genitive-case-and-partitive-case-month-names.html ?

If you feel like looking up strings for a specific language (not the grammatical case though), go to http://unicode.org/cldr/trac/browser/trunk/common/main , choose your favorite language, and search for <monthContext type="format"><monthWidth type="wide"> vs. <monthContext type="stand-alone"><monthWidth type="wide">.

If strings differ, a different case is used. :)

Kaldari, I had a point nobody answered :) Is it using local time or server time to do these calculations?

@Nischay: It might be using server time currently, but it's all about to be replaced anyway.

@siebrand, Niklas: For the string "May 14" what is the correct way to construct that as an i18n string? Right now we are using...

'echo-date-header' => '$1 $2'

where $1 is something like 'may-gen' and $2 is the date for that month. Is the genitive case incorrect for this situation?

  • Bug 48583 has been marked as a duplicate of this bug. ***

After talking with Niklas on IRC, it sounds like we need to provide a separate set of i18n messages just for this specific situation, i.e.: 'January XX', 'February XX', etc. since different languages are inconsistent about whether they apply the genitive case in this situation.

(In reply to comment #13)

After talking with Niklas on IRC, it sounds like we need to provide a
separate
set of i18n messages just for this specific situation, i.e.: 'January XX',
'February XX', etc. since different languages are inconsistent about whether
they apply the genitive case in this situation.

I do not understand why do you do it so complicate.

KISS: Using standard date format works well in all languages for all dates beyond "today" and "yesterday".

Related URL: https://gerrit.wikimedia.org/r/64437 (Gerrit Change Idca1bfc9f4eff7dc561253424f15c15ea007ab6d)

@Raimond: I'm CCing Vibha, the designer to see if she could comment on that. For now, though, I have to implement this according to the design specs.

Personally, I think having a short date format available could be useful in certain contexts, regardless of whether we use it for Echo or not.

(In reply to comment #14)

I do not understand why do you do it so complicate.
KISS: Using standard date format works well in all languages for all dates
beyond "today" and "yesterday".

+1

If you need another kind of date (“date-short”), go ahead. But why should this date format be implemented in a completely different way than the rest?? The choice of genitive/nominative/whatever should be deferred to each language’s $dateFormats just as it is already for the current kinds (cf. MessagesDe.php 'j. F Y' with MessagesCs.php 'j. xg Y').

And the new messages solve nothing. You are not sure whether you should use genitive or nominative, so you split out a new set of classes, which should use… _what_? “1. leden” and “1. ledna” (January 1 in Czech) are both correct, the usage depends on context. And a generic “A date in the Gregorian month of January.” provides nothing. Were these messages specific for the specific usage in Echo, it would not be ideal (why does Echo always need something special?), but at least it would be usable.

@Mormegil: You seem to know a lot more about this than I do, so why not submit a patch? How does translation for $dateFormats work anyway? I don't imagine these get translated in translateWiki (since they aren't messages).

I'm not convinced that $dateFormats is the correct solution. We do not want to add new user selectable date format. We could add new option besides "time", "date" and "both", but then we would need to get it defined for all existing formats, which is going to be PITA given that these cannot be translated in the usual way.

It can also lead horrible results, for example in Gerrit, if you choose ISO as the date format, in listings you will get things like 05-10 (MM-DD) which is so wrong in many ways.

(In reply to comment #19)

We do not want
to add new user selectable date format. We could add new option besides
"time", "date" and "both"

Yes, that was the idea. (And don’t forget "pretty"!)

but then we would need to get it defined for all existing formats
which is going to be PITA given that these cannot be translated in the
usual way.

Possibly.

It can also lead horrible results, for example in Gerrit, if you choose ISO
as the date format, in listings you will get things like 05-10 (MM-DD) which
is so wrong in many ways.

Well, right, that is a bit of a problem, but it is not really a new problem, because of the current “pretty” implementation. If you set ISO as your date format in preferences and go to https://www.mediawiki.org/wiki/Special:Notifications, you’ll see exactly that (“05-10”).

But the fact is there is no ISO 8601-compliant way of writing just the day and month (IIANM). I would say if somebody configured ISO as their preferred date format (who does that, anyway?), then he/she _wants_ to see e.g. “2013-05-10” instead of “May 10”. In other words (MessagesEn.php):

$dateFormats = array(
'mdy time' => 'H:i',
'mdy date' => 'F j, Y',
'mdy shortdate' => 'F j',
snip...
'dmy date' => 'j F Y',
'dmy shortdate' => 'j F',
snip...
'ISO 8601 date' => 'xnY-xnm-xnd',
'ISO 8601 shortdate' => 'xnY-xnm-xnd',
);

And I would say this would be a nice and correct result (especially given the _current_ solution does not allow you to say you want “10 May” instead of “May 10”).

Related URL: https://gerrit.wikimedia.org/r/68323 (Gerrit Change I7c5eae52857fac2d82ff1cb0b10864a1e1b30b6a)

@Mormegil, Raimond Spekking: Hopefully I've come up with a solution that will meet your approval, although I'm still not sure how well the grammar works in non-English languages. Please help me test it and let me know if this is an improvement: https://gerrit.wikimedia.org/r/68323

(In reply to comment #22)

@Mormegil, Raimond Spekking: Hopefully I've come up with a solution that will
meet your approval, although I'm still not sure how well the grammar works in
non-English languages. Please help me test it and let me know if this is an
improvement: https://gerrit.wikimedia.org/r/68323

Apparently already merged. :-/

(In reply to comment #22)

Please help me test it

Is that deployed yet somewhere (labs instance or so)?
On mediawiki.org I cannot see any options under "Preferences" yet, and I get "března 14" for cs and "14 März" for de which are both weird.

No, this is not deployed anywhere. The solution is based on my discovery that the 'pretty' date format already supports 'F j' and 'j F' formatting (roughly reflecting the user's preferred date format as set in the existing prefs). This is pretty close to what Mormegil was asking for.

This is deployed on test.wiki now.