Page MenuHomePhabricator

Wrong grammatical case of month names in Slavic languages in StructuredDiscussions extension
Open, Needs TriagePublic


Hi! The Croatian translation of names of months in the StructuredDiscussions extension is wrong. The names use the wrong grammatical case - they are in nominative, but they need to be in genitive. I left feedback on the talk page, but was advised to file a bug report on Phabricator.

Example of the problem:

  • date appears as: 4. svibanj 2019. (4 May 2019)
  • date should appear as: 4. svibnja 2019.

Event Timeline

Hmxhmx created this task.May 21 2019, 11:36 AM
Restricted Application added a project: Growth-Team. · View Herald TranscriptMay 21 2019, 11:36 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Aklapper renamed this task from Wrong grammatical case of names of months in the Croatian translation of the StructuredDiscussions extension to Wrong grammatical case of month names in Slavic languages in StructuredDiscussions extension.May 21 2019, 12:40 PM
Aklapper added a project: I18n.

Hi @Hmxhmx, thanks for taking the time to report this and welcome to Wikimedia Phabricator!

For future reference, steps to reproduce are welcome. I now finally realized that this is only shown when you move the mouse over the date in the header. :)

I believe that the Polish translation is correct. Also correct are: Russian, Ukrainian, Slovene, Bulgarian, Macedonian, and possibly Slovak, Kashubian, Silesian. Belarusian should be checked because their signature contains мая (month of May), but the Structured Discussions puts траўня instead. Belarusian (Taraškievica) is OK. Rusyn is not correct, should be in genitive case also. Lower Sorbian and Upper Sorbian both have German translation of month names, despite the fact those local month names are translated on

Thanks for the investigation! I tried to use the URL parameter uselang=qqx on a Flow page to find out where these date strings come from exactly (and to check whether translations on might be wrong or if the code in the extension itself splits the date string and needs to get fixed) but Flow seems to ignore that I changed the language. Grmpf.

Using the HTML class, I found that it’s added in the template handlebars/timestamp.handlebars. But the template gets the text from somewhere… Grepping for the file name haven’t given me any useful information.

Catrope added a subscriber: Catrope.EditedJun 25 2019, 12:01 AM

The text comes from the moment.js library, and it looks like this is caused by a bug in that library. Moment.js knows about the nominative and accusative forms of months, but its automatic detection for whether to use accusative is broken, because the local date format for Croatian includes a dot after the day number, which the regex for detecting accusative case does not anticipate. It appears that this is because Croation uses D. in its date format (with a hardcoded dot), rather than Do which would result in the same thing but be detected as accusative case. Croatian is the only language that has both a hard-coded dot and a different accusative form, so it's the only language affected by this bug.

Aklapper moved this task from Backlog to Patch proposed upstream on the Upstream board.