Setting Slovak (sk_SK) as default language, but users must still be able to change it

I’m running Nextcloud AIO 11.11.0 with Nextcloud 32.0.1.

I want to set Slovak (sk / sk_SK) as the default language and locale for:

  • login page

  • guests / public share links

  • new user accounts

But users must still be able to change their own language later, so I cannot use force_language or force_locale.

The only guidance I found was this AIO discussion from 2022:
https://github.com/nextcloud/all-in-one/discussions/482
Since AIO changed a lot since then, I want to confirm the current method.

Is this still the correct way for AIO?

docker exec -u www-data -it nextcloud-aio-nextcloud \
  php occ config:system:set default_language --value="sk"

docker exec -u www-data -it nextcloud-aio-nextcloud \
  php occ config:system:set default_locale --value="sk_SK"

docker exec -u www-data -it nextcloud-aio-nextcloud \
  php occ config:system:set default_phone_region --value="SK"

Question:
Is this the right approach in 2025 for AIO 11.11.0 / NC 32.0.1 to set Slovak as the default while still allowing users to change language?

As far as I know, this is not AIO-specific, and yes, you can do it that way, and yes, users will still be able to change it.

Also, if I understand the docs correctly, Nextcloud normally uses the language and locale sent by the browser (unless you force a specific language and locale). The default_language and the default_locale settings are intended for edge cases where automatic detection doesn’t work properly. In that situation, it will fall back to these default values.

Note: all of this only applies when a user has not set their own language and locale. Otherwise, the user’s own settings are always used — unless, of course, you explicitly force a specific language and locale via force_language and force_locale , in which case the user can no longer change those settings.

1 Like

I have one practical issue I want to verify.

In the past, when someone invited me as a guest to their Nextcloud, the invitation page was shown to me in German, even though my browser language was Slovak (sk).
This was specifically a Calendar meeting invitation (the page you open when someone shares a meeting link with you).

According to what you described, this should only happen if:

  • their server had force_language enabled, or

  • my browser sent a different preferred language

But my browser was definitely set to Slovak, so this does not fully match the expected behavior.

Before I configure this on my AIO instance, I need to clarify one thing:

For guest access and public pages (including Calendar meeting invitations), does Nextcloud always use the browser language first and only fall back to the server’s default language if the browser language is not supported?

Or:

Can the inviter’s personal language setting override the guest’s browser language?

I want to avoid situations where guests see an unexpected language like German or English.

I tested this and it does indeed seem to be the case that, if a default language and locale are set, these are used on the first login regardless of whether a language and locale are sent, or which language and locale the browser sends.

And not only that, the language and locale also do not change afterwards if the user logs in with a browser that sends a (different) language. The initially assigned language and locale seem to remain set for that account unless the user changes them manually.

So, yeah, in that case, it’s probably better not to set a default if you have guests who come from other language regions.

Whether this is a bug or a feature, I honestly don’t know.

EDIT:
I’ve just noticed that when no defaults are set, everything is in English for new accounts. Either Nextcloud’s detection isn’t working or my browsers aren’t sending the correct language information. So take the above with a grain of salt.

However, I tested three browsers: Chromium, Firefox, and LibreWolf (for the latter, I would expect it not to send anything).

It seems that at least Chromium and Firefox are sending something, because the login page appears in German for both of them, and in English for LibreWolf. So it seems more likely that the language detection in Nextcloud isn’t working properly — but only after you’re logged in. The login page itself correctly detects the browser language.

Or maybe there’s something else going on with the server I tested it on… :thinking:

EDIT2:
Or maybe it’s because I’m on Linux…?

Either way, I suggest you test this thoroughly before setting a default language. For existing users, it probably won’t make any difference, and for foreign guests, it’s probably still better if everything defaults to English rather than Slovak. :wink:

But as I said, make sure to test it yourself as well, my setup might have some quirk that prevents the detection from working correctly.

In my case, I’ve always used English as the default language and never even considered changing it. But the situation now requires me to switch the default to Slovak — not for myself, but for the other users on my Nextcloud instance. That’s the only reason I’m configuring this at all.

Just like you, I’ll probably need to test this more thoroughly. I also use only Linux on the desktop and don’t use Windows at all.

And honestly, it wouldn’t surprise me at all if the Windows version of a browser behaved differently from the Linux version of the same browser when it comes to sending language preferences.

I’ll run some tests on my side and see how consistent the behavior is.

Yep.

I did some more testing, including on a fresh AIO instance, and it definitely seems that the detection doesn’t work. New accounts are always in English after the first login if no defaults are set, or in the language of the defaults if any are set.

The login page, however, correctly detects the language sent by the browser, which makes me think it’s not an issue with my client OS or browsers, but rather a bug in Nextcloud…

That aligns with what I’m seeing as well.
If the login page correctly detects the browser language, but the first login for a new account always ends up in English (or in whatever defaults are set), then it really looks more like a Nextcloud-side issue rather than a client OS/browser quirk.

I also tested creating a guest account just now. The welcome email was correctly in Slovak — which makes sense, because I already set my server defaults to Slovak. But when I clicked the link to go to the password-reset/login page, that page showed up in English, which is also consistent with the fact that I use English on my desktop and in all my browsers.

At this point, it might be worth having @szaimen take a look. He usually knows best where AIO behavior ends and where upstream Nextcloud logic takes over, and whether this is intended or a regression.

I’ll continue testing …

1 Like

Yes, that’s exactly how it behaves for me too.

By the way, I tested it on both a classic LAMP stack and with AIO. Both are running NC 32.0.2, and both behaved exactly the same way.

1 Like

So yes, this should be reported to nextcloud/server as the responsible code is handled there.