Make WordPress Core

Opened 5 years ago

Last modified 6 months ago

#49012 new defect (bug)

Date format output incorrect in Finnish

Reported by: kipex's profile kipex Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.3.1
Component: Date/Time Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Pretty much exactly the duplicate of previous tickets reporting this issue with at least Italian and Russian languages, like here: #48606

In my case the problem occurs with Finnish using 5.3.1. The date format "F j, Y" shows up as "2 joulukuun, 2019", which basically has F and j reversed.

Change History (5)

#1 @SergeyBiryukov
5 years ago

  • Description modified (diff)

#2 @SergeyBiryukov
5 years ago

Hi there, welcome to WordPress Trac! Thanks for the report.

This appears to be different from #48606, where wp_maybe_decline_date() didn't work as expected due to not taking word boundaries into account in the regular expression.

In this case it performs the replacement as expected, but it looks like declension rules in Finnish are different from those in Russian or other Slavic languages.

Background:

This functionality is controlled by a translation setting, which is currently set to 'on' for Finnish.

If the replacement should not happen at all, then the setting should be translated to 'off' by the Finnish translation team.

If some other replacement should be performed instead, we'll need some examples of correct and incorrect date formats in Finnish, and how they map to each other, to add a special case like we already have for the Catalan locale.

#3 @kipex
5 years ago

I see, thanks. Yeah I mostly glanced at the other ones, as they just popped up on search results as other reports of 5.3 date format outputting differently than before.

I have live sites running 5.2.4 (and older) that output <?php the_time('F j, Y') ?> as
Joulukuu 16, 2019 (=December 16, 2019).

That is what I know. Why that is now changed to 16 joulukuun, 2019 in 5.3.1, I don't know.

I can only assume someone has decided to try to make the formatting read like there's a natural relation between the day of the month and the name of the month, i.e. "16th of December" instead of simply repeating the exact "16 December" numbers and words on their own.

In Finnish language there's at least two ways to go about formatting that, which depends on whether the day (number) of the month is before or after the name of the month:

  • 16. joulukuuta
  • joulukuun 16.

So that's either a "ta" or "n" added to the end of the name of the month. Hope that helps. Beyond that, up to you guys and the translation folks :) I'm just reporting that I noticed a difference that currently makes no sense and is a big enough bug that I need to go around it in all 5.3(.1) sites, so I hope there's a fix incoming.

Last edited 5 years ago by kipex (previous) (diff)

#4 @Jyria
3 years ago

This is still present in this day in WP 5.9.3.

Even when I try to output this variable:

<?php
$date_of_birth = date_i18n( 'F j', strtotime( '2022-11-11' ) );

I get: 11 marraskuun
instead of desired: Marraskuun 11

In the same site, I tried different languages. When the site is set to english f.e. the out matches my date_i18n: November 11

Something is wrong here for finnish, that even overwrites custom formatting via date_i18n.

Anyone still on this?

#5 @Jyria
6 months ago

This is still a bug in 2024 on latest WP at this point of time.

Wrote a gist with custom function, if someone needs a fix for finnish language:
https://gist.github.com/s-a-s-k-i-a/cb25a8d354af5b61ad8b7c69d4bb91c8

Last edited 6 months ago by Jyria (previous) (diff)
Note: See TracTickets for help on using tickets.