Date format and languange spesific date strings

Hi! I do not get the date format to be correct. I have done translations into Norwegian. I have translated date.locale to no (also tried nb_NO) and date.altFormatLong to d.m.y H:i and date.altFormatShort to d.m.y

I have tested this on the demo server of yours, around 24 hours after doing the translation.

Any idea what is wrong? All other strings work ok when translated.

Is the translation approved?

Where did you expect the string to be used?

Hi! Several strings are shown in english. All strings are approved translated so they exists in Norwegian. See this screen capture: Pågående oppgaver | Vikunja

Are the unlocalized strings only dates? Because that’s a different issue:

Yes, only strings associated with dates. And date format itself is not correct. Always in standard English format. If I switch to German the date format is in German format.

Any news about this one? Quite annoing with those English date strings around…

There’s an open PR: #3039 - fix: remove date-fns - vikunja - Gitea

ok. How can I fix my self hosted installation with this fix? The demo has not got the fix?

Once it’s merged, you can get the fix on your instance through the
unstable release. Until then, you’d need to check out the sources of
that PR and build Vikunja yourself.

This is now fixed in 021d71b90e, please check with the next unstable build (should be ready for deployment in ~45min, also on try).

Thanks, it works! Another problem I found when testing on your demo installation: not possible to set time in 24 hour format. I set language to Norwegian, but not possible to enter e.g. time 23 or use the arrows. 23 changes to 11 and so on. The date format in Norwegian translation is d.m.y H:i

I guess we need a way to set these independent from the locale.

Have you changed anything? I cannot fint the string date.locale in language files anymore. Norwegian date strings are still wrong. Norwegian can either be nn or nb or no. The correct is probably nb and not nn as i seems to be right now.

I’ve removed them since it was duplicated information, which in some cases was wrong. We’re now using the values from the codebase.

Would love a PR for that!

What do you mean by PR?

A “Pull Request”, basically, make the changes and propose them for review, then they might get integrated into the project. This is the core of open-source projects, allowing the community to participate directly.

OK, but my question is how the language is set? Hardcoded or browser language? In Norwegian language the wrong strings are picked for date strings. Those strings are not picked from the translated language files but from some where else.

The date translations are loaded from here:
dayjs/src/locale at dev · iamkun/dayjs · GitHub

And the mapping in Vikunja happens here: vikunja/useDayjsLanguageSync.ts at main - vikunja - Gitea

Thanks. The problem is found in the sync file. Change line 18 to ‘no-no’: ‘nb’. End of line 45 should be nb not nn.

This is now fixed in a0c14826bc, please check with the next unstable build (should be ready for deployment in ~45min, also on try).