diff --git a/pkg/gui/presentation/branches.go b/pkg/gui/presentation/branches.go index bb8beee1e..c6b92d3e6 100644 --- a/pkg/gui/presentation/branches.go +++ b/pkg/gui/presentation/branches.go @@ -2,6 +2,7 @@ package presentation import ( "fmt" + "strconv" "strings" "github.com/jesseduffield/lazygit/pkg/commands/models" @@ -42,6 +43,21 @@ func getBranchDisplayStrings(b *models.Branch, fullDescription bool, diffed, sho } res := []string{recencyColor.Sprint(b.Recency), coloredName} + if showGithub { + if b.PR != nil { + colour := style.FgMagenta // = state MERGED + switch b.PR.State { + case "OPEN": + colour = style.FgGreen + case "CLOSED": + colour = style.FgRed + } + res = append(res, colour.Sprint("#"+strconv.Itoa(b.PR.Number))) + } else { + res = append(res, "") + } + } + if fullDescription { return append(res, style.FgYellow.Sprint(b.UpstreamName)) } diff --git a/pkg/i18n/chinese.go b/pkg/i18n/chinese.go index f54f8d657..3306a9e83 100644 --- a/pkg/i18n/chinese.go +++ b/pkg/i18n/chinese.go @@ -163,7 +163,7 @@ func chineseTranslationSet() TranslationSet { SwitchRepo: `切换到最近的仓库`, LcAllBranchesLogGraph: `显示所有分支的日志`, UnsupportedGitService: `不支持的 git 服务`, - LcCreatePullRequest: `创建抓取请求`, + LcCreateOrOpenPullRequestOptions: `创建抓取请求`, LcCopyPullRequestURL: `将抓取请求 URL 复制到剪贴板`, NoBranchOnRemote: `该分支在远程上不存在. 您需要先将其推送到远程.`, LcFetch: `抓取`, @@ -436,9 +436,8 @@ func chineseTranslationSet() TranslationSet { ToggleWhitespaceInDiffView: "切换是否在差异视图中显示空白更改", IgnoringWhitespaceInDiffView: "差异视图中的空格将被忽略", ShowingWhitespaceInDiffView: "空白将显示在差异视图中", - CreatePullRequest: "创建抓取请求", - CreatePullRequestOptions: "创建抓取请求选项", - LcCreatePullRequestOptions: "创建抓取请求选项", + LcCreateOrShowPullRequest: "创建抓取请求", + CreateOrOpenPullRequestOptions: "创建抓取请求选项", LcDefaultBranch: "默认分支", LcSelectBranch: "选择分支", CreatingPullRequestAtUrl: "在 URL 创建抓取请求: %s", diff --git a/pkg/i18n/polish.go b/pkg/i18n/polish.go index 4c223d246..6d73f8534 100644 --- a/pkg/i18n/polish.go +++ b/pkg/i18n/polish.go @@ -107,7 +107,7 @@ func polishTranslationSet() TranslationSet { ConfirmQuit: "Na pewno chcesz wyjść z programu?", LcAllBranchesLogGraph: "pokaż wszystkie logi gałęzi", UnsupportedGitService: "Nieobsługiwana usługa git", - LcCreatePullRequest: "utwórz żądanie pobrania", + LcCreateOrShowPullRequest: `maak of laat een pull-request zien`, LcCopyPullRequestURL: "skopiuj adres URL żądania pobrania do schowka", NoBranchOnRemote: "Ta gałąź nie istnieje w zdalnym repo. Najpierw musisz ją wysłać.", LcFetch: "pobierz", @@ -231,6 +231,6 @@ func polishTranslationSet() TranslationSet { CommitMessageCopiedToClipboard: "Komunikat commita skopiowany do schowka", LcCopiedToClipboard: "skopiowany do schowka", CreateOrOpenPullRequestOptions: "Utwórz opcje żądania ściągnięcia", - LcCreateOrOpenPullRequestOptions: "utwórz opcje żądania ściągnięcia", + LcCreateOrOpenPullRequestOptions: "utwórz opcje żądania", } }