Localization Formatting Error in the %{date} function

AI-generated summary

User inquisitorOzzak reported a localization formatting error in the Croatian language pack where the js.topic.created_at and js.topic.bumped_at fields displayed the year twice (e.g., “252025”). The issue was identified as a missing Y in the js.dates.long_with_year translation string, which was set to D MMM, YYY instead of the correct D MMM, YYYY.

User Moin confirmed the root cause and suggested that the text could be customized directly on the site or corrected via the Crowdin translation interface. inquisitorOzzak verified that the fix was correct and easy to implement, noting that a team member is already working on the Croatian translations on Crowdin and will include this correction. The thread was subsequently marked as solved.

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!

4 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”

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.