diff --git a/config/config.go b/config/config.go index 510739a36e..113038896b 100644 --- a/config/config.go +++ b/config/config.go @@ -17,6 +17,7 @@ import ( "github.com/git-lfs/git-lfs/v3/fs" "github.com/git-lfs/git-lfs/v3/git" "github.com/git-lfs/git-lfs/v3/tools" + "github.com/git-lfs/git-lfs/v3/tr" "github.com/rubyist/tracerx" ) @@ -79,7 +80,7 @@ func NewIn(workdir, gitdir string) *Configuration { callback: func() Environment { sources, err := gitConf.Sources(c.LocalWorkingDir(), ".lfsconfig") if err != nil { - fmt.Fprintf(os.Stderr, "Error reading git config: %s\n", err) + fmt.Fprintf(os.Stderr, tr.Tr.Get("Error reading git config: %s\n", err)) } return c.readGitConfig(sources...) }, diff --git a/config/extension.go b/config/extension.go index 1b5004e498..68b7607c84 100644 --- a/config/extension.go +++ b/config/extension.go @@ -1,8 +1,10 @@ package config import ( - "fmt" + "errors" "sort" + + "github.com/git-lfs/git-lfs/v3/tr" ) // An Extension describes how to manipulate files during smudge and clean. @@ -21,7 +23,7 @@ func SortExtensions(m map[string]Extension) ([]Extension, error) { for n, ext := range m { p := ext.Priority if _, exist := pMap[p]; exist { - err := fmt.Errorf("duplicate priority %d on %s", p, n) + err := errors.New(tr.Tr.Get("duplicate priority %d on %s", p, n)) return nil, err } pMap[p] = ext diff --git a/config/git_fetcher.go b/config/git_fetcher.go index bb42b62746..0ae3844047 100644 --- a/config/git_fetcher.go +++ b/config/git_fetcher.go @@ -8,6 +8,7 @@ import ( "sync" "github.com/git-lfs/git-lfs/v3/git" + "github.com/git-lfs/git-lfs/v3/tr" ) type GitFetcher struct { @@ -39,7 +40,7 @@ func readGitConfig(configs ...*git.ConfigurationSource) (gf *GitFetcher, extensi if origKey, ok := uniqKeys[key]; ok { if ShowConfigWarnings && len(vals[key]) > 0 && vals[key][len(vals[key])-1] != val && strings.HasPrefix(key, gitConfigWarningPrefix) { - fmt.Fprintf(os.Stderr, "WARNING: These git config values clash:\n") + fmt.Fprint(os.Stderr, tr.Tr.Get("warning: These git config values clash:\n")) fmt.Fprintf(os.Stderr, " git config %q = %q\n", origKey, vals[key]) fmt.Fprintf(os.Stderr, " git config %q = %q\n", pieces[0], val) } @@ -101,7 +102,7 @@ func readGitConfig(configs ...*git.ConfigurationSource) (gf *GitFetcher, extensi } if len(ignored) > 0 { - fmt.Fprintf(os.Stderr, "WARNING: These unsafe lfsconfig keys were ignored:\n\n") + fmt.Fprintf(os.Stderr, tr.Tr.Get("warning: These unsafe lfsconfig keys were ignored:\n\n")) for _, key := range ignored { fmt.Fprintf(os.Stderr, " %s\n", key) } diff --git a/t/t-config.sh b/t/t-config.sh index d3b307edf2..95b648b724 100755 --- a/t/t-config.sh +++ b/t/t-config.sh @@ -252,7 +252,7 @@ begin_test "config: ignoring unsafe lfsconfig keys" git lfs env 2>&1 | tee status.log - grep "WARNING: These unsafe lfsconfig keys were ignored:" status.log + grep "warning: These unsafe lfsconfig keys were ignored:" status.log grep " core.askpass" status.log ) end_test