Template talk:WOTD

On my browser, the image hides up the beginning of the letter "W" on "Word of the day". I shrank it to 52px instead of 62 px, and that problem was solved, see User:Keene/Sandbox. --Keene 03:01, 1 January 2008 (UTC)Reply

What is 'my browser' ? My tests show no problems, no matter how I play with window size. Robert Ullmann 15:08, 2 January 2008 (UTC)Reply
Note that on IE 6, it looks crappy because IE can't display the image properly (you are seeing a white background over the box border? the image background is transparent.) Look at it in Firefox. Robert Ullmann 15:15, 2 January 2008 (UTC)Reply
Some users don't have that option. If I'm at work, I have to use IE6. Many American schools are using IE6 because updating would cost money. If there is a problem with display in IE6, then it affects a large fraction of our users. --EncycloPetey 17:13, 2 January 2008 (UTC)Reply
Keene is right, I can't make out a single letter of today's (apparently short) WOTD :

we need at last one empty line in between (I'm working on a network, using the non-specified standard browser for Word) Matricularius 11:17, 28 February 2008 (UTC)Reply

Redlink or no redlink edit

Would it make sense to put an #ifexist function around the audio so that it doesn't show up unless an audio file exists? --Yair rand 00:46, 12 March 2010 (UTC)Reply

Date edit

"Word of the day for December 28"

  1. At least in Europe we have the year 2014, not the year 28 (AD), and I think one shouldn't care about uncommon US-American and e.g. Muslim year numbering.
  2. The word of which december day is it? At least the number of the day should be added, though the day (today: Sunday) could be added, too.

So, how about "28 December 2014" or "Sunday, 28 December 2014" or better "28 December 2014 (Sunday)"?
BTW: The second version would also be similar to www.bbc.co.uk ("Sunday, 28 December") & www.bbc.co.uk/radio4/programmes/schedules/fm ("Sunday 28 December 2014"). -IP, 11:14, 28 December 2014 (UTC)

Add to Wikipedia Userpage edit

How can I add the "Word of the Day" to my Wikipedia userpage? I tried several different template formats and searched, but nothing worked. SabreWolfy (talk) 08:16, 9 August 2015 (UTC)Reply

Hi, I replied on your user page. Smuconlaw (talk) 17:15, 6 January 2016 (UTC)Reply

Alignment issue edit

Hi, @Erutuon. I updated this template recently and it seems to be working well, except that there is an alignment issue on the Main Page – the Foreign Word of the Day box no longer appear directly below the WOTD box. I can't figure out what has gone wrong. Can you help? Thanks. — SGconlaw (talk) 16:24, 12 July 2018 (UTC)Reply

@Sgconlaw: I went through your recent revisions, and the position of the FWOTD changed in this edit. — Eru·tuon 17:24, 12 July 2018 (UTC)Reply
Ah, thanks. It was my addition of |}. For some reason, it looks like there is supposed to be a missing table closing markup in the template. — SGconlaw (talk) 17:38, 12 July 2018 (UTC)Reply
Hmm, so maybe it's a table that holds the FWOTD underneath the WOTD. — Eru·tuon 20:28, 12 July 2018 (UTC)Reply

Yesterday and Tomorrow links broken edit

Seemingly on every Wiktionary:Word of the day/ page, the “Yesterday” and “Tomorrow”links are broken. They lead to say ”Wiktionary:Word_of_the_day//December_13” (note the extra forward slash. That kind of makes navigating the archive a bit difficult.

The slash at the end of the line where it says “December 31” and “January 1” seems to be the issue.

If I had to guess, it’s if the “expr” block actually evaluates to anything that the slash is necessary. That expr block doesn’t account for if the page is a subpage of Wiktionary:Word of the day, does not have “/Archive” and does not have a year. If all three of those conditions are met, that entire first ifeq block in the expr block evaluates to “” (blank). Next, if today is not December 31, (or Jan 1 on yesterday link), the second ifeq block also evaluates to “” (blank), leaving a blank expr block that results in “” (blank). The following would fix that issue for all days including a separate issue regarding Jan 1 for yesterday, and Dec 31 for tomorrow (both would result in either: “expr:-1” or “expr:+1” resulting in “day/-1/December 31” and “day/1/January 1” respectively.)

[[Wiktionary:Word of the day/{{#ifeq:{{ROOTPAGENAME}}|Word of the day
    | {{#expr:{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|2}}|Archive
        | {{#titleparts:{{FULLPAGENAME}}|1|3}}
        | {{#if:{{num|{{#titleparts:{{FULLPAGENAME}}|1|2}}}}<!--Does page name have year?-->
            | {{#titleparts:{{FULLPAGENAME}}|1|2}}
          }}
      }}{{#if:{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|2}}|Archive
        | 1
        | {{#if:{{num|{{#titleparts:{{FULLPAGENAME}}|1|2}}}}<!--Does page name have year?-->
            | 1
          }}
      }}|{{#ifeq:{{#time:F j|{{{4|{{CURRENTMONTHNAME}}}}} {{{5|{{CURRENTDAY}}}}}}}|December 31|+1}}}}}}{{#if: {{#expr:{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|2}}|Archive
        | {{#titleparts:{{FULLPAGENAME}}|1|3}}
        | {{#if:{{num|{{#titleparts:{{FULLPAGENAME}}|1|2}}}}<!--Does page name have year?-->
            | {{#titleparts:{{FULLPAGENAME}}|1|2}}
          }}
      }}{{#if:{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|2}}|Archive
        | 1
        | {{#if:{{num|{{#titleparts:{{FULLPAGENAME}}|1|2}}}}<!--Does page name have year?-->
            | 1
          }}
      }}|{{#ifeq:{{#time:F j|{{{4|{{CURRENTMONTHNAME}}}}} {{{5|{{CURRENTDAY}}}}}}}|December 31|+1}}}}}}|/}}
    | {{#ifexist:Wiktionary:Word of the day/{{CURRENTYEAR}}/{{{4|{{CURRENTMONTHNAME}}}}} {{{5|{{CURRENTDAY}}}}}|{{CURRENTYEAR}}/}}
  }}{{#time:F j|{{{4|{{CURRENTMONTHNAME}}}}} {{{5|{{CURRENTDAY}}}}} + 1 day}}|tomorrow&nbsp;→]]

for tomorrow, and something similar for yesterday. I checked it in ExpandTemplates and Wiktionary:Word of the day/2017/December 10, Wiktionary:Word of the day/December 10, Main Page, and Wiktionary:Word of the day/Archive/2017/December 20, all link properly (well, aside from the fact that Wiktionary:Word of the day/2017/December 11, and similar don’t exist, and that the number for next day defaults to current day.) Days like “day/December 31” (with unnamed 5 = 31, and 4 = December) link to “day/January 1”.

The template right now also assumes that if the page contains Archive, that it also contains a year. This leads to “Expression error: Unrecognized word "december"” or similar being output.

This fix is ugly, clunky, way too convoluted, but generally works (at least somewhat better than currently). I’m sure this can be reduced in size, but, I’m not sure how. Actually, since Wiktionary supports Scribunto, wouldn’t this work much better in a module? (it’d at least halve the code size as the value of the expr block could be stored in a variable, and hence not be repeated again.)

Meh, I tried my best, it’s hard to debug things on mobile. I was scared the edit page would reload on me and I’d lose this entire comment. Yikes. — EmptySora (talk) 05:16, 11 December 2019 (UTC)Reply

Sorry if this is semi-incoherent, I rewrote and removed portions of that comment multiple times as I was finding out what caused the slash issue. — EmptySora (talk) 05:39, 11 December 2019 (UTC)Reply
@EmptySora: Thanks. I'm aware of the issue. It's actually a temporary problem, because we are migrating from using pages with the format "Wiktionary:Word of the day/December 31", to those with the format "Wiktionary:Word of the day/2020/January 1". Thus, in the new year the links will all work properly. I have been thinking about whether it is necessary to provide for backwards compatibility but haven't found the time to examine the matter in detail yet. — SGconlaw (talk) 07:59, 11 December 2019 (UTC)Reply
I should mention that I only know how to use Wikitext templates, and not Scribunto (is this the same as Lua?). Someone else will have to work on that (and continue to maintain the template) if it is desired to convert the whole template to Scribunto. — SGconlaw (talk) 08:01, 11 December 2019 (UTC)Reply
Just modified /sandbox to reflect the above. You can use:
{{WOTD/sandbox|a1|a2|a3|December|31}}
{{WOTD/sandbox|a1|a2|a3|January|1}}
in Special:ExpandTemplates to test it (checked: “Wiktionary:Word of the day/December 10”, “Wiktionary:Word of the day/2019/December 10”, “Wiktionary:Word of the day/Archive/2019/December 10”, “Main Page” and it works.
are the archive subpages supposed to link to non /archive?
and I just noticed you replied... it’s way too late for me to be doing edits...
Backwards compatibility is nice, especially should something break. Scribunto is the MW extension that allows programming languages to be used (modules), currently only supports Lua, so yes. If I have time, I can draft such a module.
I don’t think people should have to wait until New Years to have functional navlinks... maybe keep it as a temporary thing until New Years? — EmptySora (talk) 08:12, 11 December 2019 (UTC)Reply
Personally, I hate that code. It’s nonsensical that you have to use that to account for a single erroneous page convention. Anything to NOT use that code would make my day. — EmptySora (talk) 08:15, 11 December 2019 (UTC)Reply
@EmptySora: thanks, am at work now, so let me have a look at what you've put in the Sandbox when I get home later. Also:
  • As regards your question "are the archive subpages supposed to link to non /archive?", I'm afraid you have to explain as I'm not sure what you mean.
  • The template also needs to work properly with "Template:Word of the day" and "Wiktionary:Word of the day/Archive". I noticed this but, as mentioned above, haven't had time yet to look into the issue.
  • Note that the "edit" link at the top right corner also needs to work properly.
  • Happy for you to try and do a Lua conversion at some stage, but note that it would then be good if you can stick around and help to maintain the template because I won't be able to, at least not in the short term. I'd like to learn how to use Lua at some stage but have a feeling there may be quite a long learning curve for me.
SGconlaw (talk) 08:25, 11 December 2019 (UTC)Reply

──────────────────────────────────────────────────────────────────────────────────────────────────── Assuming I'm not crazy (I very well could be, it's 4:22AM here on the east coast of the US), in the very least, my edit doesn't break things, IE: if "Template:Word of the day" and "Wiktionary:Word of the day/Archive" already didn't work, I can't guarantee mine fixes it. All I did was make it such that on subpages of Wiktionary:Word of the day, the links work relatively fine (mainly by wrapping Wiktionary:Word of the day/December 31 - Wiktionary:Word of the day/January 1 properly such that /1January, and /-1December don't end up in there; and by making the "//" issue go away (ie: Wiktionary:Word of the day/December 10 links to Wiktionary:Word of the day/December 11, not Wiktionary:Word of the day//December 11)) That's really all I did.

As for the "/archive" thing I mentioned, should "Wiktionary:Word of the day/Archive/2019/December 10" be linking to "Wiktionary:Word of the day/2019/December 11" (as it would currently, even without my edit), or "Wiktionary:Word of the day/Archive/2019/December 11"?

There's an issue with the "edit" link? Did my edit in the sandbox break it? Judging from whats there, it's probably the same issue that was with tomorrow/yesterday links.

As for Lua, I suck at it too, and any language that remotely resembles Visual Basic. I was thinking that while an outright rewrite of the entire template would be impossible right off the bat... what we could do is instead migrate various pieces of the template into the lua module (ie: Module:WOTD) and then someone who is a lot better at it can pull the rest of it. Ideally, we should be able to have Template:WOTD look like:

{{#invoke:WOTD|WOTD}}<noinclude>{{doc}}</noinclude>

or something along those lines. (like at Wikipedia:Template:Infobox)

Here's a start:

 
--
-- This module implements {{WOTD}}
--
local yesno, getArgs -- lazily initialized
local p = {}
local wrap = {}

local audioPrefixes = {
    'en-us-',
    'en-uk-',
    'en-au-'
}
local audioSuffixes = {
    '.ogg',
    '.oga',
    '.flac'
}
local audioNS = 'Media'

function wrap.audioLink(args)
    local page
    local html
    for its, vs in pairs(audioSuffixes) do
        for itp, vp in pairs(audioPrefixes) do
            page = vp .. args[1] .. vs
            if mw.title.new(page, audioNS).exists then
                html = mw.html.create('div')
                    :cssText('float:right;')
                    :wikitext('[[' .. page .. '|noicon]]')
            end
        end
    end
    return tostring( html )
end

local mt = { __index = function(t, k)
	return function(frame)
		if not getArgs then
			getArgs = require('Module:Arguments').getArgs
		end
		return wrap[k](getArgs(frame))  -- Argument processing is left to Module:Arguments. Whitespace is trimmed and blank arguments are removed.
	end
end }


return setmetatable(p, mt)

The audio section could be changed from...

 
    |<!--Do nothing-->
    | {{#if:{{{audio|}}}
        |<div style="float:right">[[File:{{{audio}}}|noicon]]</div>
        | {{#ifexist:Media:En-us-{{{1}}}.ogg
            | <div style="float:right">[[File:En-us-{{{1}}}.ogg|noicon]]</div>
            | {{#ifexist:Media:En-uk-{{{1}}}.ogg
                | <div style="float:right">[[File:En-uk-{{{1}}}.ogg|noicon]]</div>
                | {{#ifexist:Media:En-us-{{{1}}}.oga
                    | <div style="float:right">[[File:En-us-{{{1}}}.oga|noicon]]</div>
                    | {{#ifexist:Media:En-uk-{{{1}}}.oga
                        | <div style="float:right">[[File:En-uk-{{{1}}}.oga|noicon]]</div>
                        | {{#ifexist:Media:En-au-{{{1}}}.oga
                            | <div style="float:right">[[File:En-au-{{{1}}}.oga|noicon]]</div>
                            | {{#ifexist:Media:En-au-{{{1}}}.ogg
                                | <div style="float:right">[[File:En-au-{{{1}}}.ogg|noicon]]</div>
                                | {{#ifexist:Media:En-us-{{{1}}}.flac
                                    | <div style="float:right">[[File:En-us-{{{1}}}.flac|noicon]]</div>
                                    | {{#ifexist:Media:En-uk-{{{1}}}.flac
                                        | <div style="float:right">[[File:En-uk-{{{1}}}.flac|noicon]]</div>
                                      }}
                                  }}
                              }}
                          }}
                      }}
                  }}
              }}
          }}
      }}
  }}<div id="WOTD-rss-description">

to...

 
    |<!--Do nothing-->
    | {{#if:{{{audio|}}}
        |<div style="float:right">[[File:{{{audio}}}|noicon]]</div>
        |{{#invoke:WOTD|audioLink|{{{1}}}}}
      }}
  }}<div id="WOTD-rss-description">

Has the added benefit of being able to easily add/remove file extensions/language codes without risking breaking anything or making that mess of a pyramid any worse. Also, it checks to see if any extension per each language code exists (ie: it checks for any en-US audio files, then en-UK, then en-AU instead of mixing them around. Consistency ftw~!) Haven't tested that script, but it doesn't have any blatant errors, well, aside from the fact that Module:Arguments doesn't exist here (see: Wikipedia:Module:Arguments), but that's just a Wikipedia:Special:Export and Special:Import away from not being an issue, assuming someone has import rights, if that's a thing. Worst case scenario we do a broken copy and paste, those are always fun. *cough cough*

Ideally, the yesterday/tomorrow/edit/etc. links would be the next to go into a module after this. -- EmptySora (talk) 09:48, 11 December 2019 (UTC)Reply

"View" link edit

Hi, @Erutuon, I tried to add a "View" link to the top right corner of the template as sometimes it's useful to be able to jump to a specific WOTD (for example, "Wiktionary:Word of the day/2020/May 5") without entering the edit page. However, I realize my edit isn't going to achieve the right effect if the link is clicked on from an archive page such as "Wiktionary:Word of the day/Archive/2019/December". Any idea on how to fix this? How does the line <small class="editlink"> automatically determine the correct year? — SGconlaw (talk) 15:47, 5 May 2020 (UTC)Reply

@Sgconlaw: Well, there's already the complicated bit in {{edit}} that apparently retrieves the title of the correct page. (Hard to remember exactly how it works, though I edited it before.) Copying it should do the job. — Eru·tuon 06:27, 7 May 2020 (UTC)Reply
@Erutuon: ah, thanks. I didn’t know we had {{edit}}. — SGconlaw (talk) 07:46, 7 May 2020 (UTC)Reply
@Sgconlaw: Sorry, I'm not explaining well. I mean the code in the first parameter to {{edit}} in the source code of {{WOTD}} that somehow figured out the right WotD page name. — Eru·tuon
@Erutuon: yes, I saw your edits to the template. — SGconlaw (talk) 08:18, 7 May 2020 (UTC)Reply

Archived feedback: March 2020 edit

“Tomorrow” link not working properly on the Main Page edit

Hi, @Erutuon, I’ve noticed something odd. When I view the page “Wiktionary:Word of the day/2020/December 31” and click on the “tomorrow” link, it correctly displays “Wiktionary:Word of the day/2021/January 1”. However, when I look at the Main Page and click on that link, I am sent to “Wiktionary:Word of the day/2020/January 1” instead. Any idea what’s wrong? — SGconlaw (talk) 09:10, 31 December 2020 (UTC)Reply

Recent edits edit

@This, that and the other: what is your recent amendment intended for? It is producing an unintended result on pages like “Wiktionary:Word of the day/Archive/2023/December”. — Sgconlaw (talk) 04:50, 12 December 2023 (UTC)Reply

@Sgconlaw sorry about this. It is supposed to appear on pages like WT:Word of the day/January 23, because it took me some time to work out what they were for. I'll fix the erroneous appearance of this template on archive page right away. This, that and the other (talk) 05:45, 12 December 2023 (UTC)Reply
@Sgconlaw I think it is fixed. I'm done editing WOTD stuff for now; sorry again. This, that and the other (talk) 06:02, 12 December 2023 (UTC)Reply
@This, that and the other: thanks! Another thing I've been meaning to fix but have not got to yet is the fact that the "yesterday" and "tomorrow" links don't work properly on pages like "Wiktionary:Word of the day/January 1" and when there is a change of year (31 December/1 January). — Sgconlaw (talk) 13:43, 12 December 2023 (UTC)Reply

──────────────────────────────────────────────────────────────────────────────────────────────────── @This, that and the other: in some cases (for example, at "Wiktionary:Word of the day/Archive/2023/December"), the edit link at the top right corner of the template is linking to the wrong page. For example, the link is https://en.wiktionary.org/w/index.php?title=Wiktionary:Word_of_the_day/2023December_13&action=edit—it is missing a slash between the year and month. — Sgconlaw (talk) 22:02, 12 December 2023 (UTC)Reply

@Sgconlaw both should be addressed now. This, that and the other (talk) 00:14, 13 December 2023 (UTC)Reply
@This, that and the other: that’s great! Thanks! — Sgconlaw (talk) 04:49, 13 December 2023 (UTC)Reply

Template doesn't handle change of year properly edit

@This, that and the other: happy New Year (where I am, anyway)! Wondering if you can figure this out, as I've failed to. As I mentioned previously, the "yesterday" and "tomorrow" links don't work properly when there is a change of year (31 December to 1 January). For example, the "tomorrow" link at the WOTD for 31 December 2023 currently on the Home Page is linking to "Wiktionary:Word of the day/2023/January 1" instead of "Wiktionary:Word of the day/2024/January 1". I assume the problem lies with {{Template:WOTD/previous or next day}}. — Sgconlaw (talk) 19:05, 31 December 2023 (UTC)Reply

@Sgconlaw should be resolved now. This, that and the other (talk) 02:20, 1 January 2024 (UTC)Reply
@Sgconlaw also, Happy New Year to you as well! This, that and the other (talk) 02:21, 1 January 2024 (UTC)Reply
@This, that and the other: fantastic! Thanks. — Sgconlaw (talk) 04:24, 1 January 2024 (UTC)Reply
Return to "WOTD" page.