Sgwrs Defnyddiwr:Andrew Gray

Ni chefnogir cynnwys y dudalen mewn ieithoedd eraill.
Oddi ar Wicipedia

@Andrew Gray: Andrew. Please take a look at the error in the infobox on this article. I've tried importing the latest Lua Module from en, but it causes problems. I requested help from Doug, but he seems to be rather busy.

There's also another error in this WD infobox (Nodyn:Gwybodlen person/Wicidata), which I can't fix - it happens when the dob and dod are BC eg Sima Qian, where I've had to supress the dod. Or if it's year only (see Allgo). Cheers! 'Spouce' also causes a problem! see here where it's been surpressed.Llywelyn2000 (sgwrs) 20:32, 22 Tachwedd 2017 (UTC)[ateb]

Gwybodlen person/Wicidata[golygu cod]

There's another error on Template:Gwybodlen person/Wicidata with dates; this time an error is called when date is only available as year. Here's an example: Llwchaiarn. Any help would be appreciated. Diolch Andrew! Llywelyn2000 (sgwrs) 06:19, 11 Ionawr 2018 (UTC)[ateb]

@Llywelyn2000: sorry for the delay replying to this! I've had a poke around and it's confusing me.

  • The error seems to be in the code which generates the age at death (... oed).
  • Both birth and death date are year only
  • Dewi Sant also has year-precision birth and death and was working fine. I looked at the data item (d:Q331697) and discovered that David's years were set as Gregorian, not Julian (ie the old-fashioned calendar)
  • Changing David's dates to Julian (which they should have been anyway!) breaks the infobox on Dewi Sant in the same way as Llwchaiarn.

I think this means we've identified the bug - it's something to do with the way Julian-calendar dates are represented. en:Module:Wd has a promising note:

raw: If this flag is used with time datatypes, then the returned date will be in the format of yyyy-mm-dd (e.g. 1731-02-11), or yyyy-mm, or yyyy depending on the date's precision. Dates in the Julian calendar stored with a precision of days through millenniums will have /Julian attached to the output (e.g. 1731-02-11/Julian, which may be split off using the {{ #titleparts}} template function).

The confusing thing is that the template seems to be using #titleparts already - ({{#expr: trunc ({{#time: Y.md|{{#titleparts:{{wikidata|property|raw|{{{qid|}}}|P570}}|1}} }}-{{#time: Y.md|{{#titleparts:{{wikidata|property|raw|{{{qid|}}}|P569}}|1}} }})}} oed)

In theory this should do exactly what's needed - I can't see what it's doing wrong. I think you might need to find an expert for this one! Andrew Gray (sgwrs) 20:25, 27 Mawrth 2018 (UTC)[ateb]

Many thanks for your time on this Andrew. There is no better expert than you in this field, so I'm stumped! Unless Andy Mabett or Magnus have a go! Thanks again... diolch i ti! Llywelyn2000 (sgwrs) 15:42, 28 Mawrth 2018 (UTC)[ateb]
Updating [:en:Module:Wd]] from the enwiki version does fix the dates. The module doesn't seem to contain any specific localisation either, but I haven't copied it over yet until @Llywelyn2000: has a look --Dafyddt (sgwrs) 17:20, 28 Mawrth 2018 (UTC)[ateb]
Gwych iawn Dafydd! The last update was 28th January (two months ago) yet the problem was spotted on the 11th (see above), which means that I must have knudged something whilest adjusting to other cywiki templates! Siiiigh! Dafydd - have a go! Please ping me when done so that I can help check the effect on other templates. Diolch both! Llywelyn2000 (sgwrs) 07:35, 29 Mawrth 2018 (UTC)[ateb]
I updated the module and it fixed Dewi Sant and others that I had made a note of. It still breaks on birthdates BCE e.g. I had previously suppressed the death date on Aristoteles but that's probably a different issue as I'm not it deals with BCE dates anyway. See also Arminius. --Dafyddt (sgwrs) 15:10, 29 Mawrth 2018 (UTC)[ateb]