mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02: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:
parent
1213e875bb
commit
8c014641d1
2 changed files with 32 additions and 44 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue