Page MenuHomePhabricator

[[Wikimedia:Wikipedia-android-strings-events count text/ja]] translation issue
Open, LowPublic

Description

The Japanese translation for this sentence is "%2$sから%3$dまでに起こった%1$s件の出来事".

The first "%2$s" comes with a year suffix of 年 (i.e. 紀元前30年) when replaced, but the latter one "%3$d" does not come with that year suffix of 年.
As a result, this phrase is shown like:

紀元前30年から2015までに起こった44件の出来事

The latter one (2015 replacing %3$d) should come with that one and should be shown as:

紀元前30年から2015年までに起こった44件の出来事

This suffix is needed for Japanese to describe a calendar year.
I believe this is not a problem of translation but do not know how to solve this.

This bug occurs on 2.7.239-beta-2018-07-31.


URL: https://translatewiki.net/wiki/Wikimedia:Wikipedia-android-strings-events count text/ja

Event Timeline

Takot created this task.Aug 13 2018, 3:51 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 13 2018, 3:51 PM
Takot updated the task description. (Show Details)Aug 13 2018, 3:53 PM

This is definitely not a Content Translation issue, and probably not a translatewiki issue either.

It sounds more related to date formatting that is done in the app code to some parameters, but not consistently.

@Amire80 - i'm never sure how to tag these things. But if you look on the page (https://translatewiki.net/wiki/Wikimedia:Wikipedia-android-strings-events_count_text/ja) the character that @Takot mentions is actually missing from that as well. So not sure how it could be app-related?

I'm really not much of a Java or Android coder, but as far as I can see, the relevant code is this:

dayInfoTextView.setText(String.format(getString(R.string.events_count_text), Integer.toString(events.size()),
        DateUtil.yearToStringWithEra(beginningYear), events.get(0).year()));

The file is app/src/main/java/org/wikipedia/feed/onthisday/OnThisDayFragment.java.

The source English string is: %1$s events from %2$s–%3$d

The params in the string are %1$s, %2$s, and %3$d.

The current qqq documentation is:

Label indicating the number of events that occurred in a certain range of years. The "%1$s" symbol is replaced with the number of events, "%2$s" is the beginning year, and "%3$d" is the ending year

So, it's a bit strange that %2$s and %3$d are both years, but the format for %2 is "s", and the format for %3 is "d". They are also sent quite differently in the code:

  • %2 is DateUtil.yearToStringWithEra(beginningYear)
  • %3 is events.get(0).year()

So as far as I can see, the dates use different parameter formats, and very different-looking Java functions.

My suspicion is that one of the Java functions produces this Japanese character, and the other one doesn't. The "Era" part in the name of the function yearToStringWithEra also hints at this. But this should really be looked at by someone who knows the relevant Java code well.

Charlotte triaged this task as Low priority.Nov 27 2019, 5:29 PM