Add option to force default language for public users #765

Closed
opened 2026-02-04 22:13:07 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @vasiliev123 on GitHub (Aug 3, 2018).

After adding APP_LANG to the .env file, only the language for logged in user changes and not for the whole site.

Steps to reproduce the behavior:

  1. Add APP_LANG=pl to the .env file
  2. Log in as admin@admin.com
  3. Set Allow public viewing? to yes
  4. Log out
  5. Homepage is still in english

Expected behavior
Whole site should change language to the polish/french/german etc..

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): 0.23
  • PHP Version: 7.2
  • Using Docker or reverse proxy (Yes/No): No
Originally created by @vasiliev123 on GitHub (Aug 3, 2018). After adding APP_LANG to the .env file, only the language for logged in user changes and not for the whole site. Steps to reproduce the behavior: 1. Add **APP_LANG=pl** to the .env file 2. Log in as admin@admin.com 3. Set **Allow public viewing?** to yes 4. Log out 5. Homepage is still in english **Expected behavior** Whole site should change language to the polish/french/german etc.. **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): 0.23 - PHP Version: 7.2 - Using Docker or reverse proxy (Yes/No): No
OVERLORD added the 🛠️ Enhancement📖 Docs Update labels 2026-02-04 22:13:07 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Aug 3, 2018):

Hi @vasiliev123,

Setting the APP_LANG Parameter provides a fallback for all users and a default for logged-in users.

For logged-out users, BookStack will try to identify their preferred language via headers sent by the browser (Most browsers have option to set languages) before falling back on the APP_LANG value.

@ssddanbrown commented on GitHub (Aug 3, 2018): Hi @vasiliev123, Setting the `APP_LANG` Parameter provides a fallback for all users and a default for logged-in users. For logged-out users, BookStack will try to identify their preferred language via headers sent by the browser (Most browsers have option to set languages) before falling back on the `APP_LANG` value.
Author
Owner

@vasiliev123 commented on GitHub (Aug 5, 2018):

Thanks Dan for the answer :) so currently there is no way to force it? My whole site will be in polish so there is no need to use english anywhere.

@vasiliev123 commented on GitHub (Aug 5, 2018): Thanks Dan for the answer :) so currently there is no way to force it? My whole site will be in polish so there is no need to use english anywhere.
Author
Owner

@ssddanbrown commented on GitHub (Aug 6, 2018):

@vasiliev123 Not at the moment but I can see your use case.

I'll update this issue to be requesting an option to force the language for public users.
Since this will be fairly simple to implement I'll mark this for the next release.

@ssddanbrown commented on GitHub (Aug 6, 2018): @vasiliev123 Not at the moment but I can see your use case. I'll update this issue to be requesting an option to force the language for public users. Since this will be fairly simple to implement I'll mark this for the next release.
Author
Owner

@vasiliev123 commented on GitHub (Aug 7, 2018):

@ssddanbrown Thank you!

@vasiliev123 commented on GitHub (Aug 7, 2018): @ssddanbrown Thank you!
Author
Owner

@ssddanbrown commented on GitHub (Aug 12, 2018):

Will be in the patch release going out today. You'll be able to set APP_AUTO_LANG_PUBLIC=false in your .env file to force a language for public users.

@ssddanbrown commented on GitHub (Aug 12, 2018): Will be in the patch release going out today. You'll be able to set `APP_AUTO_LANG_PUBLIC=false` in your `.env` file to force a language for public users.
Author
Owner

@juanmacuevas commented on GitHub (Jul 16, 2022):

Thanks for this!

@juanmacuevas commented on GitHub (Jul 16, 2022): Thanks for this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#765