Last modified: 2013-06-27 20:59:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49211, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47211 - incorrect noun case for 'Month XX' in certain languages
incorrect noun case for 'Month XX' in certain languages
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Echo (Other open bugs)
unspecified
All All
: Unprioritized normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
https://www.mediawiki.org/wiki/Specia...
: i18n
: 48583 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-14 09:33 UTC by Raimond Spekking
Modified: 2013-06-27 20:59 UTC (History)
10 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Raimond Spekking 2013-04-14 09:33:49 UTC
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)
Comment 1 Nischay Nahata 2013-04-14 09:55:22 UTC
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.
Comment 2 Ryan Kaldari 2013-04-18 23:58:10 UTC
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.
Comment 3 Ryan Kaldari 2013-04-19 00:10:11 UTC
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?
Comment 4 Raimond Spekking 2013-04-19 08:31:20 UTC
"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.
Comment 5 Andre Klapper 2013-04-19 09:59:19 UTC
(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.
Comment 6 Ryan Kaldari 2013-04-19 23:28:13 UTC
@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?
Comment 7 Ryan Kaldari 2013-04-19 23:32:55 UTC
@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
Comment 8 Andre Klapper 2013-04-20 12:40:55 UTC
(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. :)
Comment 9 Nischay Nahata 2013-04-20 13:58:24 UTC
Kaldari, I had a point nobody answered :) Is it using local time or server time to do these calculations?
Comment 10 Ryan Kaldari 2013-04-22 17:49:34 UTC
@Nischay: It might be using server time currently, but it's all about to be replaced anyway.
Comment 11 Ryan Kaldari 2013-05-17 20:22:20 UTC
@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?
Comment 12 Ryan Kaldari 2013-05-17 20:34:20 UTC
*** Bug 48583 has been marked as a duplicate of this bug. ***
Comment 13 Ryan Kaldari 2013-05-17 21:01:36 UTC
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.
Comment 14 Raimond Spekking 2013-05-17 21:12:31 UTC
(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".
Comment 15 Gerrit Notification Bot 2013-05-17 21:26:06 UTC
Related URL: https://gerrit.wikimedia.org/r/64437 (Gerrit Change Idca1bfc9f4eff7dc561253424f15c15ea007ab6d)
Comment 16 Ryan Kaldari 2013-05-17 21:31:44 UTC
@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.
Comment 17 Mormegil 2013-05-23 12:13:17 UTC
(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.
Comment 18 Ryan Kaldari 2013-05-23 17:28:03 UTC
@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).
Comment 19 Niklas Laxström 2013-05-23 21:39:46 UTC
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.
Comment 20 Mormegil 2013-05-30 09:58:22 UTC
(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”).
Comment 21 Gerrit Notification Bot 2013-06-13 00:26:41 UTC
Related URL: https://gerrit.wikimedia.org/r/68323 (Gerrit Change I7c5eae52857fac2d82ff1cb0b10864a1e1b30b6a)
Comment 22 Ryan Kaldari 2013-06-13 00:29:31 UTC
@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
Comment 23 MZMcBride 2013-06-14 01:34:58 UTC
(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. :-/
Comment 24 Andre Klapper 2013-06-14 16:56:56 UTC
(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.
Comment 25 Ryan Kaldari 2013-06-14 17:18:38 UTC
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.
Comment 26 Ryan Kaldari 2013-06-18 18:35:31 UTC
This is deployed on test.wiki now.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links