Adjust preferred Language by Roles #4318

Closed
opened 2026-02-05 08:32:08 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @DarkZoneSD on GitHub (Nov 14, 2023).

Describe the feature you'd like

To have the option of configuring a preferred language for a certain Role. I have attatched a mockup version of the UI implementation in the Roles configuration.
Mockup

Describe the benefits this would bring to existing BookStack users

This could be very handy when implementing BookStack into an existing Active-Directory Environment for example, to migrate mass ammounts of users into a AD-Group, that can be synchronised via LDAP or similar. Having an AD-Group like "BookStack_Lang_CZ" setting the preferred lagnuage to czech would be an example.

Can the goal of this request already be achieved via other means?

By manually adding the users and selecting the preferred language, otherwise I am not aware of different solutions.

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundamental request

How long have you been using BookStack?

3 months to 1 year

Additional context

No response

Originally created by @DarkZoneSD on GitHub (Nov 14, 2023). ### Describe the feature you'd like To have the option of configuring a preferred language for a certain Role. I have attatched a mockup version of the UI implementation in the Roles configuration. ![Mockup](https://github.com/BookStackApp/BookStack/assets/113187443/4b165a38-fe41-44bd-928e-7e88564cd021) ### Describe the benefits this would bring to existing BookStack users This could be very handy when implementing BookStack into an existing Active-Directory Environment for example, to migrate mass ammounts of users into a AD-Group, that can be synchronised via LDAP or similar. Having an AD-Group like "BookStack_Lang_CZ" setting the preferred lagnuage to czech would be an example. ### Can the goal of this request already be achieved via other means? By manually adding the users and selecting the preferred language, otherwise I am not aware of different solutions. ### Have you searched for an existing open/closed issue? - [X] I have searched for existing issues and none cover my fundamental request ### How long have you been using BookStack? 3 months to 1 year ### Additional context _No response_
OVERLORD added the 🔨 Feature Request label 2026-02-05 08:32:08 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Nov 14, 2023):

Thanks for the suggestion @DarkZoneSD.
Personally I'm not too keen on adding options unless there's significant proven need, especially here where it could by a bit awkward since it's a user preference applied at role level, where roles can often be changed and multiple applied.

If you have any development capabilities, this is something that could likely be built onto BookStack using our logical theme system if desired. You could hook into login/registration events and update the language based on available data.

Alternatively, if you just want to bulk update with the users that are already in BookStack, the user language can be updated via the API.

@ssddanbrown commented on GitHub (Nov 14, 2023): Thanks for the suggestion @DarkZoneSD. Personally I'm not too keen on adding options unless there's significant proven need, especially here where it could by a bit awkward since it's a user preference applied at role level, where roles can often be changed and multiple applied. If you have any development capabilities, this is something that could likely be built onto BookStack using our [logical theme system](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/logical-theme-system.md) if desired. You could hook into login/registration events and update the language based on available data. Alternatively, if you just want to bulk update with the users that are already in BookStack, the user language can be updated via the API.
Author
Owner

@DarkZoneSD commented on GitHub (Nov 14, 2023):

If you have any development capabilities, this is something that could likely be built onto BookStack using our logical theme system if desired. You could hook into login/registration events and update the language based on available data.

Thank you for the quick reply @ssddanbrown .

That sounds doable, I'll look into it and post it if i find a proper solution to this. Alternatively, is something like a DeepL API integration into BookStacks main Branch something that would be worth considering?

@DarkZoneSD commented on GitHub (Nov 14, 2023): > If you have any development capabilities, this is something that could likely be built onto BookStack using our [logical theme system](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/logical-theme-system.md) if desired. You could hook into login/registration events and update the language based on available data. Thank you for the quick reply @ssddanbrown . That sounds doable, I'll look into it and post it if i find a proper solution to this. Alternatively, is something like a DeepL API integration into BookStacks main Branch something that would be worth considering?
Author
Owner

@ssddanbrown commented on GitHub (Nov 14, 2023):

Alternatively, is something like a DeepL API integration into BookStacks main Branch something that would be worth considering?

That's not something I'd consider to be honest. I try to avoid any kind of specific platform support/integration in BookStack, especially where that platform/service is not open.
When (If) we include specific content multi-language support then I may consider some level of abstract API to support different external translation platforms (Defaulting to an open option) but that's some way off.

Otherwise, you could create such integration already yourself if desired via our REST API and/or theme systems:
https://www.bookstackapp.com/docs/admin/hacking-bookstack/

@ssddanbrown commented on GitHub (Nov 14, 2023): > Alternatively, is something like a DeepL API integration into BookStacks main Branch something that would be worth considering? That's not something I'd consider to be honest. I try to avoid any kind of specific platform support/integration in BookStack, especially where that platform/service is not open. When (If) we include specific content multi-language support then I may consider some level of abstract API to support different external translation platforms (Defaulting to an open option) but that's some way off. Otherwise, you could create such integration already yourself if desired via our REST API and/or theme systems: https://www.bookstackapp.com/docs/admin/hacking-bookstack/
Author
Owner

@DarkZoneSD commented on GitHub (Nov 14, 2023):

I missed something in the documentation saying

<html>

For users that are not logged-in BookStack will try to detect their language based off of information sent from their browser. If you’d prefer to force the language seen to be the APP_LANG setting you can set the following in your .env file:

--
APP_AUTO_LANG_PUBLIC=false
</html> Is it possible to enable the APP_AUTO_LANG_PUBLIC entry to be used for every user as the default instead and then let them configure their preferred Language in the Profile settings if desired?
@DarkZoneSD commented on GitHub (Nov 14, 2023): I missed something in the documentation saying <html><body> <!--StartFragment--><p>For users that are not logged-in BookStack will try to detect their language based off of information sent from their browser. If you’d prefer to force the language seen to be the <code>APP_LANG</code> setting you can set the following in your <code>.env</code> file:</p> <div class="highlight"><div class="chroma"> -- </div></div> <pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nv">APP_AUTO_LANG_PUBLIC</span><span class="o">=</span><span class="nb">false</span> </span></span></code></pre><!--EndFragment--> </body> </html> Is it possible to enable the APP_AUTO_LANG_PUBLIC entry to be used for every user as the default instead and then let them configure their preferred Language in the Profile settings if desired?
Author
Owner

@ssddanbrown commented on GitHub (Nov 14, 2023):

That's not an option built-in or supported right now, and it's a bit awkward to implement since we can't be sure that interaction with the user will be via browser (Email notification triggered by another user's action for example), so ideally we'd have their language preference set. You could technically track their last used matching browser language to consider as a suggestion, but then that's an extra system and value to juggle alongside the existing preference, so probably not worth it.

Is again something that could be hacked in via the logical theme system with some development hackery.

@ssddanbrown commented on GitHub (Nov 14, 2023): That's not an option built-in or supported right now, and it's a bit awkward to implement since we can't be sure that interaction with the user will be via browser (Email notification triggered by another user's action for example), so ideally we'd have their language preference set. You could technically track their last used matching browser language to consider as a suggestion, but then that's an extra system and value to juggle alongside the existing preference, so probably not worth it. Is again something that could be hacked in via the logical theme system with some development hackery.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4318