Wrong relative timestamps in some languages

AI-generated summary

A user, groove6j, reported an issue with relative timestamps in the Latvian language pack, where timestamps showed “0h” or “0 days” for a period of time. Moin asked for the affected language and groove6j confirmed it was Latvian. Moin suggested the issue might be due to incorrect translations for zero and provided a link to the relevant code. Replacing “0” with “%{count}” solved the problem, as confirmed by groove6j. Moin requested that the translations be updated on Crowdin, which was acknowledged by groove6j.

Hello. I have one annoying problem and it seems to be related to language packs.

When a user makes a post, the timestamps everywhere show 0h, or after 0 days for some period of time (only while the date is relative). When I switch to another language, it’s all fine. I can’t figure out which strings should be changed. Any ideas?

Which language is affected?

Letão é afetado. Tentei inglês dos EUA e lituano e eles estavam bem.

I see that the translations for zero use 0 instead of %{count}. But I don’t know if this is the cause of the problem.

Do you use the same grammar for other numbers, like, for example, for 10? Then 0 would be shown instead of the actual count.

1 Like

It was the cause. Replacing 0 with %{count} actually solved the visible problem! Thanks!

It would be really helpful for everyone if you could update the translations on Crowdin as well.

Crowdin shows 33 strings where a variable is missing.

4 Likes

I have made some translations. I will check Crowdin. Thanks for the help!

3 Likes