Template talk:Header/year
Add topicAppearance
Latest comment: 4 years ago by Xover in topic Auto-categorization for translations
Auto-categorization for translations
[edit]@Xover: This is used by {{translation header}} though it seems that the #if statement excludes it from automated works by year categorisation, as it is not main namespace through {{SUBJECTSPACE}}
. Probably needs a #switch thrown in on {{NAMESPACENUMBER}}
for 0 and 114 with reversing the logic, which I started to do but too many distractions at the moment and lost in unmatched brackets. Are you able to look and resolve? Thanks. — billinghurst sDrewth 01:34, 22 December 2020 (UTC)
- @Billinghurst: Done. Please check that it works as intended. You may need to null edit transcluding pages to see the effect (as per usual). --Xover (talk) 11:41, 22 December 2020 (UTC)
- Incidentally, {{header}} and its dependencies are way overdue for reimplementation in Lua. They have way way too many conditionals and logic (#if, or/and-logic, etc.) that are a nightmare to handle in template syntax but are straightforward to do in a full programming language. One day, in my copious spare time… --Xover (talk) 15:28, 22 December 2020 (UTC)
- @Xover: Hmm, it is throwing a spurious year in parantheses between header and body per Translation:Copyright Act, 2537 BE (and tested elsewhere) which is something that I too managed, and why I stopped. I will see if the issue is {{translation header}}. — billinghurst sDrewth 22:11, 22 December 2020 (UTC)
- @Billinghurst: {{header/year}} is designed to be used in the part of the calling template that emits the visible year in the header (cf. where it's called in {{header}}), but in {{translation header}} it was being called down towards the end where categorization happens. Its output is
(1994) [[Category:1994 works]]
, which works in {{header}} because categories can appear anywhere in a page but fails in {{translation header}} because the (1994)
bit is being emitted outside the faux table of the header.I think we can probably just move the call to {{header/year}} up to the right part of the code in {{translation header}} and all will be fine. I'll take a look when time permits if you don't get to it before me. --Xover (talk) 13:53, 24 December 2020 (UTC)- @Billinghurst: Done. Quick testing on random translations looks like it works as intended, but I may not have a good enough grasp on the breadth of possible inputs and edge cases so there may still be errors lurking. --Xover (talk) 22:10, 24 December 2020 (UTC)
- @Billinghurst: {{header/year}} is designed to be used in the part of the calling template that emits the visible year in the header (cf. where it's called in {{header}}), but in {{translation header}} it was being called down towards the end where categorization happens. Its output is
- @Xover: Hmm, it is throwing a spurious year in parantheses between header and body per Translation:Copyright Act, 2537 BE (and tested elsewhere) which is something that I too managed, and why I stopped. I will see if the issue is {{translation header}}. — billinghurst sDrewth 22:11, 22 December 2020 (UTC)
- Incidentally, {{header}} and its dependencies are way overdue for reimplementation in Lua. They have way way too many conditionals and logic (#if, or/and-logic, etc.) that are a nightmare to handle in template syntax but are straightforward to do in a full programming language. One day, in my copious spare time… --Xover (talk) 15:28, 22 December 2020 (UTC)