Jump to content

Template talk:Community Wishlist Survey/Schedule box

Add topic
From Meta, a Wikimedia project coordination wiki
Latest comment: 1 year ago by MusikAnimal (WMF) in topic Date format

Mark for translation[edit]

@Quiddity (WMF) This template has not been marked for translation. Should it not be? -- Abuluntu (👨🏼‍💻💬) 06:34, 11 January 2022 (UTC)Reply

@Abuluntu No. The messages exist as separate templates, for example Template:Community Wishlist Survey/Schedule-time. This is because they are used in many places and re-used every year. All the important messages are grouped together for your convenience here. Hope this helps and thanks for helping with translation, MusikAnimal (WMF) (talk) 20:09, 11 January 2022 (UTC)Reply

Date format[edit]

@Quiddity (WMF) or anyone in the know – The current template is returning unidiomatic date ranges in CJK languages (that is, most likely all of them—not only yue but also ja, ko, kp and zh) and possibly other non-European languages. The main issue is in CJK languages the year comes first (in exactly the same order as ISO 8601), so date ranges should read “y₁-m₁-d₁ – m₂-d₂”, not “m₁-d₁ – y₂-m₂-d₂” (the current output). The current template hard-codes the first call to have no year and the second call to have a year, so the output is guaranteed to be wrong in languages where the year comes first.

Is there a straightforward way to convert the two template calls to a single translatable format string, or has this problem not been discussed before? Thanks! Al12si (talk) 03:03, 24 January 2023 (UTC)Reply

@MusikAnimal (WMF) You might be able to help with this? Quiddity (WMF) (talk) 19:47, 24 January 2023 (UTC)Reply
@Al12si Great questions! No, it has not been discussed before. This one is tricky… hmm. The issue we use Community Wishlist Survey 2023/Schedule to keep things DRY. Many other templates also reference the /Schedule page to conditionally know what to display. I'm sure we can come up with a solution, though.
It's pretty hacky, but we could use a {{#switch}} statement to conditionally change where the year is placed based on the language. That's pretty terrible, but I'm not sure how else to do it unless we change the format for everyone. Maybe we're better off doing a conditional only for English, and letting all other languages use whatever format {{date}} spits out (which should be localized). What do you think? MusikAnimal (WMF) (talk) 22:40, 24 January 2023 (UTC)Reply
@MusikAnimal (WMF) Hmm, I don’t know. How about we factored the date₁ – date₂ code into a template first, then decide what to do. We could make a hacky template first — scratch that, let the new template do exactly what the current template is doing —, then reduce the hackiness when we figure out a way to make it less hacky?
How are date strings being translated? Is it some sort of Lua code? If it’s Lua maybe I can try to figure something out. Al12si (talk) 23:27, 24 January 2023 (UTC)Reply
I got curious and looked at Template:Date. It’s a giant switch statement. I suppose this can only mean using another giant switch statement isn’t hacky at all... :-/ Al12si (talk) 00:01, 25 January 2023 (UTC)Reply
According to Template:Date, this issue should be affecting Hungarian and Lithuanian, possibly also Latvian. I wonder if we can find a Hungarian, Lithuanian and/or Latvian speaker to verify if this is affecting them.
If I haven’t missed anything, the list of languages under “Order: [Y=1] M=2 [D=3]” reads: hu, lt, nan, zh-min-nan, ko, ko-kp, ja, zh, zh-hans, zh-cn, zh-sg, zh-hant, zh-hk, zh-mo, zh-tw, wuu, zh-wuu, yue, zh-yue. There is also a short list under “Order: [Y=1] [D=3] M=2”, which has only one language listed: lv.
I’m actually surprised I’m not finding lzh (Classical Chinese), or any of the other languages that’s grouped under the zh umbrella, like cdo. This might be a latent bug. Al12si (talk) 01:23, 25 January 2023 (UTC)Reply
@Al12si It could very well be! If you have a better suited Lua implementation for {{date}}, I can help get it imported here on Meta.
As for the Schedule box, I have refactored the range bits into Template:Community Wishlist Survey/Schedule box/Date range. From here we can add our conditions, but to be frank I think it's fine to rely solely on what {{date}} does for both the start and end dates. I think we didn't want the year on the first date mostly for aesthetics, since it doesn't cause the line of text to wrap. It will wrap regardless in some other languages, so I'm thinking it's okay to use full dates for all languages except English. Barring objections I'll implement that now :) MusikAnimal (WMF) (talk) 02:19, 25 January 2023 (UTC)Reply