Page MenuHomePhabricator

Change date format for Latvian language
Closed, ResolvedPublic

Description

Please set up new date format for Latvian Wikipedia in signatures, (suppose - all) system pages (like in Recent changes page 3 aprīlī, 2015). From 3 aprīlī, 2015 to 2015. gada 3. aprīlis.

I suppose it would mean that new date format would be: Y". gada" j. F

Will update the mediawiki interface messages later, when this will be deployed. As there is at least two (which I have spotted) date+time formats, if you could give all possible variants, I could tell more precise what we need.

Community consensus (the section "Datums").

Event Timeline

Edgars2007 raised the priority of this task from to Needs Triage.
Edgars2007 updated the task description. (Show Details)
Edgars2007 added a subscriber: Edgars2007.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 3 2015, 8:16 AM

Hello,

In the early MediaWiki days, it were possible to specify a custom date format, as you wish.
This were documented here. This feature has been removed in MediaWiki 1.21, as it conflicts with user preferences.

In user preferences, there is a date format setting.

This field doesn't allow freeform customization but currently allows four date formats:

  • mdy. 10:07, aprīlī, 10, 2015
  • dmy. 10:07, 10 aprīlī, 2015
  • ymd. 10:07, 2015 aprīlī, 10
  • ISO 8601. 2015-04-10T10:07:54

To achieve what you need, we need:

  1. a change in MediaWiki to offer dates in this Latvian format
  2. once done, and if available at a custom format instead of the default MediaWiki one, to set the default format for new accounts to this one
  3. to run the UserOptions script modifying the user preferences to this new format for accounts currently at default (we'll keep any preferences with another date setting untouched).

I would suggest to get in touch with the I18n team. They could suggest the best course of action to implement this change.

It would also be a great help for development ant test if you could you provide documentation about this format, the particularities and exceptions, and a reference.

Dereckson triaged this task as Normal priority.Apr 10 2015, 10:18 AM
Dereckson added a project: I18n.
Dereckson moved this task from Untriaged to Analysis on the I18n board.Apr 10 2015, 10:21 AM
Dereckson moved this task from Analysis to Untriaged on the I18n board.

Hi!

We just wanted to make this change because none of other date formats aren't Latvian.

As for other things that you mentioned, could you be more precise, what you (Phabricator) need from us (Latvian Wikipedia or me)? Where I could contact I18n team? (i'm not the most technical-minded user here :) ). And about the format — as opposed to English, in Latvian there is one default date format (where month is name, not number), to which we want to switch. There aren't any exceptions in it, I think.

in Latvian there is one default date format (where month is name, not number), to which we want to switch. There aren't any exceptions in it, I think.

A comprehensive set of rules and a documentation about how to build the date would be useful. For example, do we always need to add s to the month, what to do with final vowels (in the first sample you switched from aprīlī to aprīlis)? To implement a date format, we need to know (in plain English, it's enough, no need to give that in code) exactly how to build it.

Ok, will try to explain.

Actually, there are bunch of forms for months (for April: "aprīlis", "aprīļa", "aprīlim", "ar aprīli", "aprīli", "aprīlī"). Some of them are used rarely, some - more often. But, as it would be kind of nightmare to implement all of them correctly, we (or I) choosed to stick around one form, which is OK. Why from aprīlī to aprīlis? Because in drop-down lists (like here; ctrl+f: No mēneša (un senāki)) form aprīlis would suite better.

And as I said, there are no exceptions. The form is: 2015. gada 13. aprīlis. If you want some other dates: 2015. gada 6. jūnijs (the mediawiki interface message would be "jūnijs"), 2000. gada 30. maijs (here the message would be "maijs"). So Latvian language in this case is quite boring :)

Does this information is enough?

Mjbmr added a comment.Apr 27 2015, 4:02 PM

In your request you want to change date format from "27 aprīlī, 2015" (dmy: j F Y) to "2015. gada 27. aprīlis" (ydm: Y". gada" j. F). So based on the translations it will produce "2015. gada 27. aprīlī," not "2015. gada 27. aprīlis", even using "Y". gada" j. xg" produces "2015. gada 27. Aprīļa" not "2015. gada 27. aprīlis". So followings must be changed:

MediaWiki:January-gen
MediaWiki:February-gen
MediaWiki:March-gen
MediaWiki:April-gen
MediaWiki:May-gen
MediaWiki:June-gen
MediaWiki:July-gen
MediaWiki:August-gen
MediaWiki:September-gen
MediaWiki:October-gen
MediaWiki:November-gen
MediaWiki:December-gen

Yes, I know that it currently would produce incorect results. I'm not changing none of interface messages to correct ones ("aprīlis"), because they are used currently and then they would produce incorect results now. As I said in the request, "will update the mediawiki interface messages later, when this will be deployed". Will update messages at Latvian Wikipedia first and translatewiki later. Will this be kind of OK?

Mjbmr added a comment.Apr 27 2015, 5:23 PM

Yeah, so which one should be used "F" or "xg"?

Mjbmr added a comment.Apr 27 2015, 5:38 PM

So, ydm should use 'Y". gada" j. F" format, and dmy should use 'j xg Y' (genitive case) format and then MediaWiki:April-gen/lv must replaced with "aprīlī," and MediaWiki:April/lv with "aprīlis." is that right?

No.

As I said (I think), there is only one form: 2015. gada 27. aprīlis (ydm). Leave everything else as it is :)

BTW, when the changes could be made?

It would be great if in Recent changes page for the Rclistfrom message april could be changed to April-gen (genetive case). Then MediaWiki:April-gen would be replaced with "aprīļa".

Mjbmr added a comment.Apr 27 2015, 6:02 PM

So If we add a ydm with "Y". gada" j. F" format and keep dmy with 'j F Y' format then ydm will produce '2015. gada 27. aprīlis' and ydm will produce '3 aprīlis 2015', is that OK?

Yes, it will be OK.

Mjbmr added a comment.Apr 27 2015, 6:07 PM

"Y". gada" j. F" will be used for 'ydm date', what about 'ydm time', 'ydm monthonly', 'ydm both' and 'ydm pretty'?

current values:

	'dmy time' => 'H:i',
	'dmy date' => 'j F Y',
	'dmy monthonly' => 'F Y',
	'dmy both' => 'H:i, j F Y',
	'dmy pretty' => 'j F',
Mjbmr renamed this task from Change date format in Latvian Wikipedia to Change date format for Latvian language.Apr 27 2015, 6:15 PM
Mjbmr set Security to None.

The perfect set would be:

	'dmy time' => 'H.i',
	'dmy date' => 'Y". gada" j. F',
	'dmy monthonly' => 'Y". gada" F',
	'dmy both' => 'Y". gada" j. F, H.i',
	'dmy pretty' => 'j F',

Change 206859 had a related patch set uploaded (by Mjbmr):
Add date format for Latvian language

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

Mjbmr added a comment.Apr 27 2015, 6:38 PM

So, basically MediaWiki will use 'ydm date' as $3 and 'ydm time' as $2 for {{int:rclistfrom}}.

The perfect set would be:

[...]
	'dmy both' => 'Y". gada" j. F, H.i',
[...]

It seems the system already inserts a comma between the date and the time parts. So it's 'Y". gada" j. F H.i' to avoid to print ,,.

Ok, but why then in the original values there is a comma for dmy both?

current values:

	'dmy both' => 'H:i, j F Y',
Mjbmr added a comment.Apr 30 2015, 8:34 PM

Ok, but why then in the original values there is a comma for dmy both?

current values:

	'dmy both' => 'H:i, j F Y',

It doesn't matter, you asked to keep others and add new values, so here are the new results:

'dmy both' => 'H:i, j F Y' => '20:23, 30 aprīlī, 2015'
'ydm both' => 'Y". gada" j. F, H.i' => '2015. gada 30. aprīlī,, 20.23'

I suggested changing other "F" to "xg" and changing MediaWiki:April-gen to "aprīlī," and changing MediaWiki:April to "aprīlis", but you insistence on keeping other values, so in this case the new results will be:

'dmy both' => 'H:i, j xg Y' => '20:23, 30 aprīlī, 2015'
'ydm both' => 'Y". gada" j. F, H.i' => '2015. gada 30. aprīlis, 20.23'

but you could list all names here including genitive cases so I can change them within the code.

Now I understood Dereckson's post :)

And as I said MediaWiki:April-gen has the right gramatical form (aprīļa), it shouldn't be "aprīlī".

I think the current situation, which is set to be deployed, is quite ok. And if we'll have some problems, we can always come here and ask you to fix them :)

Mjbmr added a comment.Apr 30 2015, 9:14 PM

Now I understood Dereckson's post :)
And as I said MediaWiki:April-gen has the right gramatical form (aprīļa), it shouldn't be "aprīlī".
I think the current situation, which is set to be deployed, is quite ok. And if we'll have some problems, we can always come here and ask you to fix them :)

Again, still your suggestion will have wrong results, see the patch.

Edgars2007 added a comment.EditedApr 30 2015, 9:26 PM

Ok, the values for other date formats. Changed them in such way [but that "crashes" the format mdy/dmy/ymd somehow :( ], that they sound at least somehow in Latvian.

	'mdy time' => 'H.i',
	'mdy date' => 'j. F, Y". gads"',
	'mdy monthonly' => 'F, Y',
	'mdy both' => 'H.i, j. F, Y',
	'mdy pretty' => 'j. F',

	'dmy time' => 'H.i',
	'dmy date' => 'j. F, Y". gads"',
	'dmy monthonly' => 'Y". gada" F',
	'dmy both' => 'H.i, j. F, Y',
	'dmy pretty' => 'j. F',

	'ymd time' => 'H.i',
	'ymd date' => 'Y". gada" j. F',
	'ymd monthonly' => 'Y". gada" F',
	'ymd both' => 'Y". gada" j. F, H.i',
	'ymd pretty' => 'j. F',

@Edgars2007

See:

'dmy both' => 'H:i, j xg Y' => '20:23, 30 aprīlī, 2015' => http://tools.wmflabs.org/mjbmr-tools/testwiki2/index.php?title=Special:RecentChanges
'ydm both' => 'Y". gada" j. F, H.i' => '2015. gada 30. aprīlis, 20.23' => http://tools.wmflabs.org/mjbmr-tools/testwiki/index.php?title=Special:RecentChanges
Dereckson added a comment.EditedApr 30 2015, 10:56 PM

[ Edit conflict: Suggestion removed, I see a test wiki is already available. ]

Well, I consulted with myself this night and decided that if we're fixing things then do it right. So could you change ydm both from

'ydm both' => 'Y". gada" j. F, H.i'

to

'ydm both' => 'Y". gada" j. F", plkst." H.i'

That should give: 2015. gada 1. maijs, plkst. 06.34

Looked through testwiki, looks fine. If monhts are taken from here, not from translatewiki.

As for other date formats. None of them should be using xg instead of F. So isn't these ones OK? Quite the same to values, that I mensioned Thu, Apr 30, 9:26 PM. The only change is , plkst. adding for ymd.

	'mdy time' => 'H.i',
	'mdy date' => 'j. F, Y". gads"',
	'mdy monthonly' => 'F, Y',
	'mdy both' => 'H.i, j. F, Y',
	'mdy pretty' => 'j. F',

	'dmy time' => 'H.i',
	'dmy date' => 'j. F, Y". gads"',
	'dmy monthonly' => 'Y". gada" F',
	'dmy both' => 'H.i, j. F, Y',
	'dmy pretty' => 'j. F',

	'ymd time' => 'H.i',
	'ymd date' => 'Y". gada" j. F',
	'ymd monthonly' => 'Y". gada" F',
	'ymd both' => 'Y". gada" j. F", plkst." H.i',
	'ymd pretty' => 'j. F',
Mjbmr added a comment.May 1 2015, 7:30 AM

@Edgars2007 I've updated patch and test wikis. btw 'XXX both' is not being used in {{int:rclistfrom}}, it uses 'XXX date' as $3 and 'XXX time' as $2 in {{int:rclistfrom}}.

You missed closing " for ydm both, now it is screwed up :) And yes, I noticed about {{int:rclistfrom}}.

Mjbmr added a comment.May 1 2015, 1:41 PM

Fixed, see if the translations in the patch are the right ones.

Mjbmr added a comment.May 2 2015, 3:39 PM

@Edgars2007 Do you confirm the changes?

Edgars2007 added a comment.EditedMay 3 2015, 7:35 AM

Sorry for the delay. Testwiki looks fine.

If it's so important with this, then you can make such changes:

	"january-gen": "janvāra",
	"february-gen": "februāra",
	"march-gen": "marta",
	"april-gen": "aprīļa",
	"may-gen": "maija",
	"june-gen": "jūnija",
	"july-gen": "jūlija",
	"august-gen": "augusta",
	"september-gen": "septembra",
	"october-gen": "oktobra",
	"november-gen": "novembra",
	"december-gen": "decembra",

Also monday should have lowecase (I already updated translation at translatewiki):

	"monday": "pirmdiena",
Mjbmr removed Mjbmr as the assignee of this task.Aug 9 2015, 8:17 PM

No confirmation from the user so far. I have no idea if we supposed to deploy the patch or not.

Restricted Application added a subscriber: Matanya. · View Herald TranscriptAug 9 2015, 8:18 PM

@Mjbmr oh, so you waited some confirmation? My colleagues will kill me, I think :)

Yes, you can deploy it.

Change 206859 merged by jenkins-bot:
Add date format for Latvian language

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

Mjbmr closed this task as Resolved.Aug 28 2015, 8:11 AM
Mjbmr claimed this task.