XF 2.0 Force a language to all users


Active member
I am building an addon that should bring the number of languages used back to one. Only the default language can be used.

The first step was to make template modifications. It is no longer possible to change the language in the preefrences-section, nor chose a language through the language-choser on the bottom left.

That works fine. :)

But now. People possibly have different language_id's set in the user-table. So for them, the forum will still be in that language. How can I force the forum to always use the default language?
1. I could run a query on all users to change the language_id (which they can't change back after that). But this would change data I think an addon shouldn't change.
2. I could set the language somewhere in the scripts... But where and how?
3. Possible other solution?

@bart did you meanwhile find out how to handle this? Asking due to it need to make a mass-update in my forums and it seems like a database update might be best for a one-time action


Active member
No sorry, I couldn't find out what to do. I've put xenforo on hold for a while. The learning curve is a bit to steep for me.


Active member
Ik know how to do that for myself but dont think an addon should make such changes. So thats where i got stuck.

Jeremy P

Well-known member
I'm not sure if you're still interested in this, but you could probably extend the User entity with a getter for the language_id property to make it always return whatever you want (instead of the database value).