mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-05 00:29:48 +03:00
When preferred language of the user logged in is other than 'en' get ErrorException editing users profiles #420
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @leomartinez on GitHub (Aug 29, 2017).
Bug Report
Scenario
Preferred language of the user trying to edit profile is other than
enOperating System: Debian 9
BookStack Version: 0.17.4
PHP Version: 7.0.19-1
MySQL Version: Ver 14.14 Distrib 5.7.19
Expected Behavior
Display Edit Profile page to change own profile (or other users profiles as admin)
Actual Behavior
Get 2 ErrorExceptions:
First ErrorException:
Second ErrorException:
@ssddanbrown commented on GitHub (Sep 9, 2017):
@leomartinez Thanks for submitting an issue. I'm having trouble replicate this one. Would you be able to provide some very clear steps which always replicate the issue?
@nekromoff commented on GitHub (Sep 16, 2017):
I can confirm this.
@nekromoff commented on GitHub (Sep 16, 2017):
Clearly, if the used translation (in my case SK) is not complete, then this error is thrown.
In this case
settings.language_selectarray key is missing fromlang/sk/settings.phpfile.@nekromoff commented on GitHub (Sep 16, 2017):
When this is copied/appended to the localized translations (
lang/../settings.php):everything works as expected.
@ssddanbrown commented on GitHub (Sep 17, 2017):
Still cannot reproduce this. I go to my profile, Change my language, and every works as expected. No error.
Please confirm your
APP_LANGvariable in your.envfile. Also confirm what language causes the error. Also please confirm if you've changed any of the files in theconfigdirectory.Could also try running
sudo php artisan views:clearfrom the BookStack folder to see if things work after that.@nekromoff The values set in
ENshould act as a backup when a language is missing translations so a non-en language missing thelanguage_selectkey should not be a problem.@nekromoff commented on GitHub (Sep 18, 2017):
APP_LANG=skin .envconfig/app.php:
I guess when my language was not changing, I must have changed the fallback to sk and that's why it was not finding that array? If yes, please close this issue.
(However, language should be changed on its change in user profile, not on next login - this is important from the UX point of view and will prevent further confusion regarding language setup)
@leomartinez commented on GitHub (Sep 18, 2017):
The issue apears when changing
'fallback_locale'to other language than'en'. As @ssddanbrown said, this is a backup option when a language is missing translations.Agreed with @nekromoff that language change should be applied when the profile is saved. This would improve the UX.
This issue should be closed.
@ssddanbrown commented on GitHub (Sep 18, 2017):
Okay, I will go ahead and close this issue. The language should change right away upon profile save.
It does in my testing and there's nothing to change this upon login/logout. Changing language in
.envcan sometimes be delayed if you've cached your config at any point.@nekromoff commented on GitHub (Sep 18, 2017):
Maybe forcing cache clear for views on language change in user profile?
On Mon, Sep 18, 2017 at 3:33 PM, Dan Brown notifications@github.com wrote: