Page MenuHomePhabricator

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


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.

Event Timeline

matej_suchanek raised the priority of this task from Medium to Needs Triage.Jul 16 2016, 7:38 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:;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.

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

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.

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

hmm, looking at "datum narození" is still displayed as "600 BCE", hence it does not seem to got fixed with (which I am not sure was intent of that patch actually)

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

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!