Module talk:I18n/complex date: Difference between revisions

Content deleted Content added
 
(12 intermediate revisions by 5 users not shown)
Line 3:
[[User:Plaba123|Plaba123]] ([[User talk:Plaba123|talk]]) 18:58, 21 November 2018 (UTC)
: That's because {{ping|Jarekt}} synced this with Commons, but {{ping|Pppery}} made a breaking change by [[Wikipedia:Templates_for_discussion/Log/2018_October_5#Module:Linguistic|RfD'ing]] [[Module:Linguistic]]. Not sure how to resolve that... Thanks. [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 21:04, 21 November 2018 (UTC)
::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:<syntaxhighlight lang=lua> 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</syntaxhighlight> --[[User:Izno|Izno]] ([[User talk:Izno|talk]]) 21:39, 21 November 2018 (UTC)
::: {{ping|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. [[User:Pppery|&#123;&#123;3x&#124;p&#125;&#125;ery]] ([[User talk:Pppery|talk]]) 00:20, 22 November 2018 (UTC)
::: 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). [[User:Pppery|&#123;&#123;3x&#124;p&#125;&#125;ery]] ([[User talk:Pppery|talk]]) 00:31, 22 November 2018 (UTC)
:::: {{ping|Pppery}} Can you copy that back over to commons so that this won't happen again? Thanks. [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 00:32, 22 November 2018 (UTC)
::::: No, because I'm not a commons admin. [[User:Pppery|&#123;&#123;3x&#124;p&#125;&#125;ery]] ([[User talk:Pppery|talk]]) 00:34, 22 November 2018 (UTC)
 
== Errors in date handling. ==
 
Using [[Special:Permalink/882254323]]:
* <code><nowiki>{{#invoke:WikidataIB |getValue |ps=1 |P582 |qid=Q2269}}</nowiki></code> → 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.
* <code><nowiki>{{#invoke:WikidataIB |getValue |ps=1 |P582 |qid=Q2269}}</nowiki></code> → {{#invoke:WikidataIB |getValue |ps=1 |P582 |qid=Q2269}}
* <code><nowiki>{{#invoke:WikidataIB |getValue |ps=1 |P582 |qid=Q2269 |lang=fr}}</nowiki></code> → {{#invoke:WikidataIB |getValue |ps=1 |P582 |qid=Q2269 |lang=fr}}
* <code><nowiki>{{#invoke:WikidataIB |getValue |ps=1 |P582 |qid=Q2269 |lang=zh}}</nowiki></code> → {{#invoke:WikidataIB |getValue |ps=1 |P582 |qid=Q2269 |lang=zh}}
That is now working as of this timestamp. I strongly recommend that future changes are fully tested before implementation. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 14:46, 24 February 2019 (UTC)
: {{ping|RexxS}} I don't think this worked in any version of the module before the one you just created. [[User:Pppery|Pppery]], [[User talk:Pppery|the demodulator]] 22:07, 25 February 2019 (UTC)
:: Alert: {{u|χ}}, the module you simplified has cropped back up again as [[Module:Ordinal-cd]]. [[User:Pppery|Pppery]], [[User talk:Pppery|the demodulator]] 22:20, 25 February 2019 (UTC)
::: {{re|Pppery}} It has always worked on Commons using the modules there: [[:c:Module talk:WikidataIB/testing #Earliest and latest date as qualifiers]]. Restoring the enwiki versions to the ones used in Commons fixed the problem illustrated by the first invoke in my previous post. So it's difficult to see how the changes/deletions made to the Commons modules since they were originally imported were ''not'' responsible for the error, but I don't intend to quibble about it. However, I really think we ought to be trying to keep modules working fully, rather than worrying about keeping the namespace tidy. In the long-term, I'd really like to consolidate the functionality of most of the dependent modules into WikidataIB{{snd}} it's currently about 100kB or about the size of one or two images, so not a big load on the servers. But I need to find the time to sandbox a series of changes to reduce the number of dependencies. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 22:38, 25 February 2019 (UTC)
::: Unfortunately, when trying to fix a problem that manifests itself on enwiki and not on Commons, the simplest fix is to re-import the contents of the modules from Commons. I recommend checking the testcases following changes from known, working code. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 22:38, 25 February 2019 (UTC)
 
== CKB translation ==
 
Hello, Please someone copy [https://ckb.wikipedia.org/wiki/مۆدیوول:I18n/complex_date this] and paste to the module (ckb translation is available now). Thanks! ⇒ [[User:Aram|<span style="color:#ff0;background:#000;font-family:cursive;text-shadow:3px 3px 5px #ff0;">Aram</span>]][[User talk:Aram|<span style="color:#000;background:#ff0;font-family:cursive;text-shadow:3px 3px 5px #000;">Talk</span>]] 14:02, 28 July 2019 (UTC)
:
: {{done}}. Thank you for the expansion, {{u|Aram}}. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 14:18, 28 July 2019 (UTC)