Page MenuHomePhabricator

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

Description

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

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.

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

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

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

ABorbaWMF subscribed.

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.

Screenshot_20180306-161851.png (1×1 px, 60 KB)

Screenshot_20180306-161956.png (1×1 px, 105 KB)

Meh.

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?

@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.

@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.

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