Jump to content

Module talk:I18n/complex date

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by RexxS (talk | contribs) at 14:46, 24 February 2019 (Errors in date handling.: new section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

I'm getting "Lua error in package.lua at line 80: module 'Module:Linguistic' not found." Plaba123 (talk) 18:58, 21 November 2018 (UTC)[reply]

That's because @Jarekt: synced this with Commons, but @Pppery: made a breaking change by RfD'ing Module:Linguistic. Not sure how to resolve that... Thanks. Mike Peel (talk) 21:04, 21 November 2018 (UTC)[reply]
It amusingly highlights that we have at least one code path that is not executed as otherwise we would have had similar errors already, and I think I saw a few others of similar sort reviewing the module earlier:
			if state.precision > 10 then -- precision > month
				return 'du $date1 au $date2'
			else				-- "DE septebmbre" / "D'octobre"
				return require("Module:Linguistic").of(date1, 'fr') .. " à $date2"
			end
--Izno (talk) 21:39, 21 November 2018 (UTC)[reply]
@Izno: In fact, you've underestimated the amount of never-executed code here by a lot: the entire module is basically copied from commons but useless here, as (taking that code as an example) there is no reason for an English Wikipedia article to format a date in French. {{3x|p}}ery (talk) 00:20, 22 November 2018 (UTC)[reply]
I think there needs to be a broader discussion over whether this kind of "multilingual" module should be allowed on the English Wikipedia (I'd argue no). {{3x|p}}ery (talk) 00:31, 22 November 2018 (UTC)[reply]
@Pppery: Can you copy that back over to commons so that this won't happen again? Thanks. Mike Peel (talk) 00:32, 22 November 2018 (UTC)[reply]
No, because I'm not a commons admin. {{3x|p}}ery (talk) 00:34, 22 November 2018 (UTC)[reply]

Errors in date handling.

Using Special:Permalink/882254323:

  • {{#invoke:WikidataIB |getValue |ps=1 |P582 |qid=Q2269}} → Module:I18n/complex_date:15: attempt to call field '_Ordinal' (a nil value)

The same call on Commons produces "19th century".

I'll re-synchronise from Commons.

  • {{#invoke:WikidataIB |getValue |ps=1 |P582 |qid=Q2269}} → 1820
  • {{#invoke:WikidataIB |getValue |ps=1 |P582 |qid=Q2269 |lang=fr}} → 1820
  • {{#invoke:WikidataIB |getValue |ps=1 |P582 |qid=Q2269 |lang=zh}} → 1820年

That is now working as of this timestamp. I strongly recommend that future changes are fully tested before implementation. --RexxS (talk) 14:46, 24 February 2019 (UTC)[reply]