Localization Formatting Error in the %{date} function

Hello guys,

I’m working on a Croatian language Localization for a small tech forum.
And I found an error in the formatting of the %{date} function.

Here’s the print screen:

as you can see the year is displayed as “252025”.
it looks to me like:

  • %e %b., %y%Y %H:%M

where it should be:

  • %e %b., %Y %H:%M

ie. the year is inserted twice

The error shown above is on these js localization variables:

  • js.topic.created_at

  • js.topic.bumped_at

sooo…
Is there a way to fix this on my side (control panel or server side)?
Or is it a deeper problem in the source code?
Any advice is appreciated.

Thanks in advance. :slight_smile:
Regards,
Ozzak

ps.
And let me know if you need any more info on the problem.

2 Likes

another useful print screen

1 Like

Welcome to Meta :waving_hand:

I think the text that doesn’t work as expected is js.dates.long_with_year. While the English version is MMM D, YYYY h:mm a, the Croatian version is D MMM, YYY h:mm, so there is one Y missing. You should be able to customize that on your site like any other text.

If that fixes the problem, it would be great if you could also improve this text for all forums where users use the Discourse interface in Croatian by improving the translation on Crowdin. (If you struggle with the interface of Crowdin, I’m happy to help. Alternatively, I can suggest the change if you tell me what it should be. You can learn more about the date formats of moment.js here)

Thank you for improving the translation of Discourse!

3 Likes

yep… you are 100% correct.
that was the exact problem.
and I implemented your fix.
quick and easy.

thank you very much :slight_smile:

ps.
and yeah…
another member of my team is working on Crowdin Croatian translations for the past few months.
I’ll tell her to include this as well.

3 Likes

also…
@mods - I guess you can move this from “Bug” to “Support” category.
and mark it as “Solved”

2 Likes