commands/untrack: make strings translatable

This commit is contained in:
brian m. carlson 2021-12-13 19:59:28 +00:00
parent 4a7beac307
commit ff0f378778
No known key found for this signature in database
GPG Key ID: 2D0C9BC12F82B3A1

@ -6,6 +6,7 @@ import (
"os" "os"
"strings" "strings"
"github.com/git-lfs/git-lfs/v3/tr"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -17,7 +18,7 @@ func untrackCommand(cmd *cobra.Command, args []string) {
installHooks(false) installHooks(false)
if len(args) < 1 { if len(args) < 1 {
Print("git lfs untrack <path> [path]*") Print(tr.Tr.Get("git lfs untrack <path> [path]*"))
return return
} }
@ -30,7 +31,7 @@ func untrackCommand(cmd *cobra.Command, args []string) {
attributesFile, err := os.Create(".gitattributes") attributesFile, err := os.Create(".gitattributes")
if err != nil { if err != nil {
Print("Error opening .gitattributes for writing") Print(tr.Tr.Get("Error opening .gitattributes for writing"))
return return
} }
defer attributesFile.Close() defer attributesFile.Close()
@ -48,7 +49,7 @@ func untrackCommand(cmd *cobra.Command, args []string) {
path := strings.Fields(line)[0] path := strings.Fields(line)[0]
if removePath(path, args) { if removePath(path, args) {
Print("Untracking %q", unescapeAttrPattern(path)) Print(tr.Tr.Get("Untracking %q", unescapeAttrPattern(path)))
} else { } else {
attributesFile.WriteString(line + "\n") attributesFile.WriteString(line + "\n")
} }