Page MenuHomePhabricator

The date in "On this day" in the Android app is not translatable, and appears incorrectly in many languages
Closed, ResolvedPublic


The month name in date that appears in the title of the "On this day" card is translated, but the whole appearance of the date is not correctly localized. In English it says "February 4", which is OK for English, but it also forces the same format for Russian and Hebrew. In Russian it's "Февраля 4", but it must be "4 февраля", and in Hebrew it's "פברואר 4", but it must be "4 בפברואר". Such problems probably exist in many other languages.

I'm not a Java expert, but as far as I can see, the date string comes from DateUtil, and it forces the same "MMMM d" format on all the languages. Instead, it should be translatable in translatewiki, or it should use another Java or CLDR function for date formatting.

Event Timeline

Amire80 created this task.Feb 4 2018, 10:03 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 4 2018, 10:03 AM
Kaganer added a subscriber: Kaganer.Feb 4 2018, 8:09 PM
Dbrant added a subscriber: Dbrant.Feb 6 2018, 6:00 PM

D'oh, I just noticed this inconsistency in the Russian localization myself.
Fortunately it looks like Android provides a little-known but very powerful method to localize different date formats. I'll apply it to this instance, as well as a few other places where we show localized dates.

Change 408566 had a related patch set uploaded (by Dbrant; owner: Dbrant):
[apps/android/wikipedia@master] Improve/fix custom date localizations.

Change 408566 merged by jenkins-bot:
[apps/android/wikipedia@master] Improve/fix custom date localizations.

Dbrant claimed this task.Feb 6 2018, 6:29 PM
ABorbaWMF added a subscriber: ABorbaWMF.

This is working for me in Russian on 5.8.0 (1365), but I do not see on this day at all in Hebrew. I am seeing the below on the Pixel and the Motorola devices.


I suspect that it's a matter of missing mp-* id attributes, or something along these lines.

I can try to fix it. Where are the right ids documented?

Dbrant added a comment.Mar 7 2018, 3:08 PM

@ABorbaWMF This is because the content service does not yet return any on-this-day content for the Hebrew language. I think this task refers to setting the *device* language to Hebrew, and looking at the On This Day card while keeping the wiki language English.

Dbrant added a comment.Mar 7 2018, 3:12 PM

@Amire80 If you like, you can try getting the latest alpha version of the app, and verify that the date strings are cleared up.

Ok, currently is look better in Russian (2.7.225-r-2018-02-06). But not a exellent.

For "On this day" section header

Used short name for months, with first letter in uppercase, in form "8 Мар" (for "March, 8"). This is possible, but not fully correctly for this purpose. Will be better using full monthname, as a lowercase, with a genitive form: "8 марта"

For "Trending‎", "Picture of the day‎" etc. section headers

Currently used form "8 Мар 2018 г."
Will be better using "8 марта 2018"

In my opinion, this is should be adjusted in the Translatewiki, for each language.

Dbrant closed this task as Resolved.Mar 22 2018, 12:44 PM

Will be superseded by a task to improve and standardize date labels on all card headers.