diff options
Diffstat (limited to 'pkg/gui/files_panel.go')
-rw-r--r-- | pkg/gui/files_panel.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go index 8c4c5cb6f..2bf8e754b 100644 --- a/pkg/gui/files_panel.go +++ b/pkg/gui/files_panel.go @@ -14,11 +14,14 @@ import ( "github.com/fatih/color" "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands" + "github.com/jesseduffield/lazygit/pkg/i18n" ) +var tr *i18n.Localizer + var ( - errNoFiles = errors.New(lang.SLocalize("NoChangedFiles", "No changed files")) - errNoUsername = errors.New(lang.SLocalize("NoUsernameSetErr", `No username set. Please do: git config --global user.name "Your Name"`)) + errNoFiles = errors.New(tr.SLocalize("NoChangedFiles", "No changed files")) + errNoUsername = errors.New(tr.SLocalize("NoUsernameSetErr", `No username set. Please do: git config --global user.name "Your Name"`)) ) func (gui *Gui) stagedFiles() []commands.File { @@ -86,10 +89,10 @@ func (gui *Gui) handleAddPatch(g *gocui.Gui, v *gocui.View) error { return err } if !file.HasUnstagedChanges { - return gui.createErrorPanel(g, lang.SLocalize("FileHasNoUnstagedChanges", "File has no unstaged changes to add")) + return gui.createErrorPanel(g, tr.SLocalize("FileHasNoUnstagedChanges", "File has no unstaged changes to add")) } if !file.Tracked { - return gui.createErrorPanel(g, lang.SLocalize("CannotGitAdd", "Cannot git add --patch untracked files")) + return gui.createErrorPanel(g, tr.SLocalize("CannotGitAdd", "Cannot git add --patch untracked files")) } sub, err := gui.GitCommand.AddPatch(file.Name) if err != nil { @@ -139,7 +142,7 @@ func (gui *Gui) handleIgnoreFile(g *gocui.Gui, v *gocui.View) error { return gui.createErrorPanel(g, err.Error()) } if file.Tracked { - return gui.createErrorPanel(g, lang.SLocalize("CantIgnoreTrackFiles", "Cannot ignore tracked files")) + return gui.createErrorPanel(g, tr.SLocalize("CantIgnoreTrackFiles", "Cannot ignore tracked files")) } gui.GitCommand.Ignore(file.Name) return gui.refreshFiles(g) |