diff options
author | Dwarven YANG <prison.yang@gmail.com> | 2021-08-27 15:00:53 +0800 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-08-30 09:12:29 +1000 |
commit | 63072af5bc4f93207b4ff1f49c45772a828fa13f (patch) | |
tree | 5a519f346585a0f2fb3095e31fe2d20253da5629 /pkg/commands | |
parent | 44d08edfb02686c3dd22429356a9e4b327191f91 (diff) |
allow user to configure the gui language
Diffstat (limited to 'pkg/commands')
-rw-r--r-- | pkg/commands/dummies.go | 5 | ||||
-rw-r--r-- | pkg/commands/git_test.go | 3 | ||||
-rw-r--r-- | pkg/commands/loading_commits_test.go | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/pkg/commands/dummies.go b/pkg/commands/dummies.go index 6feb908e3..b1b6e9441 100644 --- a/pkg/commands/dummies.go +++ b/pkg/commands/dummies.go @@ -14,11 +14,12 @@ func NewDummyGitCommand() *GitCommand { // NewDummyGitCommandWithOSCommand creates a new dummy GitCommand for testing func NewDummyGitCommandWithOSCommand(osCommand *oscommands.OSCommand) *GitCommand { + newAppConfig := config.NewDummyAppConfig() return &GitCommand{ Log: utils.NewDummyLog(), OSCommand: osCommand, - Tr: i18n.NewTranslationSet(utils.NewDummyLog()), - Config: config.NewDummyAppConfig(), + Tr: i18n.NewTranslationSet(utils.NewDummyLog(), newAppConfig.GetUserConfig().Gui.Language), + Config: newAppConfig, getGitConfigValue: func(string) (string, error) { return "", nil }, } } diff --git a/pkg/commands/git_test.go b/pkg/commands/git_test.go index e31fe8910..6891fdc53 100644 --- a/pkg/commands/git_test.go +++ b/pkg/commands/git_test.go @@ -209,7 +209,8 @@ func TestNewGitCommand(t *testing.T) { for _, s := range scenarios { t.Run(s.testName, func(t *testing.T) { s.setup() - s.test(NewGitCommand(utils.NewDummyLog(), oscommands.NewDummyOSCommand(), i18n.NewTranslationSet(utils.NewDummyLog()), config.NewDummyAppConfig())) + newAppConfig := config.NewDummyAppConfig() + s.test(NewGitCommand(utils.NewDummyLog(), oscommands.NewDummyOSCommand(), i18n.NewTranslationSet(utils.NewDummyLog(), newAppConfig.GetUserConfig().Gui.Language), newAppConfig)) }) } } diff --git a/pkg/commands/loading_commits_test.go b/pkg/commands/loading_commits_test.go index a637f5bd5..bd35556d4 100644 --- a/pkg/commands/loading_commits_test.go +++ b/pkg/commands/loading_commits_test.go @@ -19,7 +19,7 @@ func NewDummyCommitListBuilder() *CommitListBuilder { Log: utils.NewDummyLog(), GitCommand: NewDummyGitCommandWithOSCommand(osCommand), OSCommand: osCommand, - Tr: i18n.NewTranslationSet(utils.NewDummyLog()), + Tr: i18n.NewTranslationSet(utils.NewDummyLog(), "auto"), } } |