Page MenuHomePhabricator

Localization of dates BCE on repo depends on precision
Closed, ResolvedPublic

Description

While dates with precision 8 (decades) and lower use proper localization (so that eg. in Czech you can see "př. n. l." instead of "BCE"), more precise dates always have "BCE" appended (but otherwise they are localized).

To reproduce this, check dates of birth (P569) of these entities in your language or qqx.

Details

Related Gerrit Patches:
mediawiki/extensions/Wikibase : masterIntroduce MwEraParser and improve i18n of dates BCE

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJul 16 2016, 7:37 PM
matej_suchanek raised the priority of this task from Medium to Needs Triage.Jul 16 2016, 7:38 PM
Restricted Application added a subscriber: PokestarFan. · View Herald TranscriptJul 26 2017, 11:51 PM

@thiemowmde it looks like the root cause for it is MwTimeIsoFormatter.php which return hard coded BCE. (though possibly more may needed for roundtrip)

thiemowmde triaged this task as Medium priority.Sep 7 2017, 8:29 AM
thiemowmde moved this task from incoming to ready to go on the Wikidata board.
thiemowmde added subscribers: Lydia_Pintscher, Addshore.

That is absolutely correct. There is a TODO in MwTimeIsoFormatter to replace the hard coded string with a message: https://phabricator.wikimedia.org/diffusion/EWBA/browse/master/lib/includes/Formatters/MwTimeIsoFormatter.php;6b923f763265e45f8cc008b49e43eff5ddad74bf$282. The message should be something like "$1 BCE". Such a message currently doesn't exist, just a bunch of "wikibase-time-precision-BCE-…" messages used by both MwTimeIsoFormatter as well as MwTimeIsoParser. The new message should be next to the existing ones.

Note that all date formats must round-trip! This means either MwTimeIsoParser or an other parser we have (e.g. YearTimeParser) must be able to parse all localized versions of BCE dates the MwTimeIsoFormatter outputs. I believe the best approach is to create a new version of an EraParser that knows about the BCE message introduced above (and must live in the lib directory because of this). That new parser would try to detect the message, and fall back to the existing EraParser if it couldn't find a localized one.

Even with this constraint I believe finally implementing this TODO might be a good volunteer task.

Amire80 moved this task from Untriaged to Date and time on the I18n board.Mar 12 2018, 11:37 AM

Change 538282 had a related patch set uploaded (by Matěj Suchánek; owner: Matěj Suchánek):
[mediawiki/extensions/Wikibase@master] Introduce MwEraParser and improve i18n of dates BCE

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

The query at the description is wrong, the i18n works when the date is less precise than a decade (e.g. all of the given values in the query). It doesn't work when it's more precise than a decade (e.g. https://www.wikidata.org/wiki/Q8423?uselang=qqx)

Reviewing the patch right now.

Thanks for the review!

The query at the description is wrong

Not sure what's wrong, it's supposed to select samples both with and without the problem...

Change 538282 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Introduce MwEraParser and improve i18n of dates BCE

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

hmm, looking at https://www.wikidata.org/wiki/Q8423?uselang=cs "datum narození" is still displayed as "600 BCE", hence it does not seem to got fixed with https://gerrit.wikimedia.org/r/538282 (which I am not sure was intent of that patch actually)

It hasn't been translated yet. Check with uselang=qqx or uselang=de.

WMDE-leszek closed this task as Resolved.Thu, Jan 9, 4:20 PM

Thanks! I could swear I've checked the qqx version and it didn't look i18n-ed, but I must have been blind.
Closing this as done then!