mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Set view titles in configureViewProperties rather than createAllViews
This ensures that they are updated to the new language when changing the language in the config while lazygit is running.
This commit is contained in:
@ -424,6 +424,15 @@ func (gui *Gui) onUserConfigLoaded() error {
|
||||
userConfig := gui.Config.GetUserConfig()
|
||||
gui.Common.SetUserConfig(userConfig)
|
||||
|
||||
if gui.previousLanguageConfig != userConfig.Gui.Language {
|
||||
tr, err := i18n.NewTranslationSetFromConfig(gui.Log, userConfig.Gui.Language)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
gui.c.Tr = tr
|
||||
gui.previousLanguageConfig = userConfig.Gui.Language
|
||||
}
|
||||
|
||||
gui.setColorScheme()
|
||||
gui.configureViewProperties()
|
||||
|
||||
@ -435,15 +444,6 @@ func (gui *Gui) onUserConfigLoaded() error {
|
||||
|
||||
gui.g.Mouse = userConfig.Gui.MouseEvents
|
||||
|
||||
if gui.previousLanguageConfig != userConfig.Gui.Language {
|
||||
tr, err := i18n.NewTranslationSetFromConfig(gui.Log, userConfig.Gui.Language)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
gui.c.Tr = tr
|
||||
gui.previousLanguageConfig = userConfig.Gui.Language
|
||||
}
|
||||
|
||||
// originally we could only hide the command log permanently via the config
|
||||
// but now we do it via state. So we need to still support the config for the
|
||||
// sake of backwards compatibility. We're making use of short circuiting here
|
||||
|
Reference in New Issue
Block a user