1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-09-16 09:16:26 +02:00

chore(i18n): localize panel titles

This commit is contained in:
Ryooooooga
2022-05-10 20:10:59 +09:00
parent e28d1334e9
commit 5275161a88
10 changed files with 75 additions and 66 deletions

View File

@@ -41,28 +41,6 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>[</kbd>: previous tab
</pre>
## Branches
<pre>
<kbd>ctrl+o</kbd>: copy branch name to clipboard
<kbd>i</kbd>: show git-flow options
<kbd>space</kbd>: checkout
<kbd>n</kbd>: new branch
<kbd>o</kbd>: create pull request
<kbd>O</kbd>: create pull request options
<kbd>ctrl+y</kbd>: copy pull request URL to clipboard
<kbd>c</kbd>: checkout by name
<kbd>F</kbd>: force checkout
<kbd>d</kbd>: delete branch
<kbd>r</kbd>: rebase checked-out branch onto this branch
<kbd>M</kbd>: merge into currently checked out branch
<kbd>f</kbd>: fast-forward this branch from its upstream
<kbd>g</kbd>: view reset options
<kbd>R</kbd>: rename branch
<kbd>u</kbd>: set/unset upstream
<kbd>enter</kbd>: view commits
</pre>
## Commit Files
<pre>
@@ -137,6 +115,28 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>f</kbd>: fetch
</pre>
## Local Branches
<pre>
<kbd>ctrl+o</kbd>: copy branch name to clipboard
<kbd>i</kbd>: show git-flow options
<kbd>space</kbd>: checkout
<kbd>n</kbd>: new branch
<kbd>o</kbd>: create pull request
<kbd>O</kbd>: create pull request options
<kbd>ctrl+y</kbd>: copy pull request URL to clipboard
<kbd>c</kbd>: checkout by name
<kbd>F</kbd>: force checkout
<kbd>d</kbd>: delete branch
<kbd>r</kbd>: rebase checked-out branch onto this branch
<kbd>M</kbd>: merge into currently checked out branch
<kbd>f</kbd>: fast-forward this branch from its upstream
<kbd>g</kbd>: view reset options
<kbd>R</kbd>: rename branch
<kbd>u</kbd>: set/unset upstream
<kbd>enter</kbd>: view commits
</pre>
## Main Panel (Merging)
<pre>

View File

@@ -194,10 +194,6 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>R</kbd>: ブランチ名を変更
<kbd>u</kbd>: set/unset upstream
<kbd>enter</kbd>: コミットを閲覧
<kbd>f</kbd>: リモートをfetch
<kbd>n</kbd>: リモートを新規追加
<kbd>d</kbd>: リモートを削除
<kbd>e</kbd>: リモートを編集
</pre>
## メインパネル (Merging)
@@ -259,6 +255,15 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>E</kbd>: edit hunk
</pre>
## リモート
<pre>
<kbd>f</kbd>: リモートをfetch
<kbd>n</kbd>: リモートを新規追加
<kbd>d</kbd>: リモートを削除
<kbd>e</kbd>: リモートを編集
</pre>
## リモートブランチ
<pre>

View File

@@ -41,28 +41,6 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>[</kbd>: previous tab
</pre>
## Branches
<pre>
<kbd>ctrl+o</kbd>: copy branch name to clipboard
<kbd>i</kbd>: show git-flow options
<kbd>space</kbd>: przełącz
<kbd>n</kbd>: nowa gałąź
<kbd>o</kbd>: utwórz żądanie pobrania
<kbd>O</kbd>: utwórz opcje żądania ściągnięcia
<kbd>ctrl+y</kbd>: skopiuj adres URL żądania pobrania do schowka
<kbd>c</kbd>: przełącz używając nazwy
<kbd>F</kbd>: wymuś przełączenie
<kbd>d</kbd>: usuń gałąź
<kbd>r</kbd>: zmiana bazy gałęzi
<kbd>M</kbd>: scal do obecnej gałęzi
<kbd>f</kbd>: fast-forward this branch from its upstream
<kbd>g</kbd>: wyświetl opcje resetu
<kbd>R</kbd>: rename branch
<kbd>u</kbd>: set/unset upstream
<kbd>enter</kbd>: view commits
</pre>
## Commity
<pre>
@@ -96,6 +74,28 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>enter</kbd>: przeglądaj pliki commita
</pre>
## Local Branches
<pre>
<kbd>ctrl+o</kbd>: copy branch name to clipboard
<kbd>i</kbd>: show git-flow options
<kbd>space</kbd>: przełącz
<kbd>n</kbd>: nowa gałąź
<kbd>o</kbd>: utwórz żądanie pobrania
<kbd>O</kbd>: utwórz opcje żądania ściągnięcia
<kbd>ctrl+y</kbd>: skopiuj adres URL żądania pobrania do schowka
<kbd>c</kbd>: przełącz używając nazwy
<kbd>F</kbd>: wymuś przełączenie
<kbd>d</kbd>: usuń gałąź
<kbd>r</kbd>: zmiana bazy gałęzi
<kbd>M</kbd>: scal do obecnej gałęzi
<kbd>f</kbd>: fast-forward this branch from its upstream
<kbd>g</kbd>: wyświetl opcje resetu
<kbd>R</kbd>: rename branch
<kbd>u</kbd>: set/unset upstream
<kbd>enter</kbd>: view commits
</pre>
## Main Panel (Patch Building)
<pre>

View File

@@ -13,7 +13,7 @@ func (gui *Gui) branchesRenderToMain() error {
return gui.refreshMainViews(refreshMainOpts{
main: &viewUpdateOpts{
title: "Log",
title: gui.c.Tr.LogTitle,
task: task,
},
})

View File

@@ -4,6 +4,7 @@ import (
"sync"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/i18n"
)
const (
@@ -144,39 +145,39 @@ type TabContext struct {
Context types.Context
}
func (tree ContextTree) InitialViewTabContextMap() map[string][]TabContext {
func (tree ContextTree) InitialViewTabContextMap(tr *i18n.TranslationSet) map[string][]TabContext {
return map[string][]TabContext{
"branches": {
{
Tab: "Local Branches",
Tab: tr.LocalBranchesTitle,
Context: tree.Branches,
},
{
Tab: "Remotes",
Tab: tr.RemotesTitle,
Context: tree.Remotes,
},
{
Tab: "Tags",
Tab: tr.TagsTitle,
Context: tree.Tags,
},
},
"commits": {
{
Tab: "Commits",
Tab: tr.CommitsTitle,
Context: tree.LocalCommits,
},
{
Tab: "Reflog",
Tab: tr.ReflogCommitsTitle,
Context: tree.ReflogCommits,
},
},
"files": {
{
Tab: "Files",
Tab: tr.FilesTitle,
Context: tree.Files,
},
{
Tab: "Submodules",
Tab: tr.SubmodulesTitle,
Context: tree.Submodules,
},
},

View File

@@ -343,7 +343,7 @@ func (gui *Gui) resetState(filterPath string, reuseState bool) {
Diffing: diffing.New(),
},
ViewContextMap: viewContextMap,
ViewTabContextMap: contextTree.InitialViewTabContextMap(),
ViewTabContextMap: contextTree.InitialViewTabContextMap(gui.c.Tr),
ScreenMode: screenMode,
// TODO: put contexts in the context manager
ContextManager: NewContextManager(initialContext),

View File

@@ -868,7 +868,7 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
}
}
for viewName := range self.State.Contexts.InitialViewTabContextMap() {
for viewName := range self.State.Contexts.InitialViewTabContextMap(self.c.Tr) {
bindings = append(bindings, []*types.Binding{
{
ViewName: viewName,
@@ -914,7 +914,7 @@ func (gui *Gui) resetKeybindings() error {
}
}
for viewName := range gui.State.Contexts.InitialViewTabContextMap() {
for viewName := range gui.State.Contexts.InitialViewTabContextMap(gui.c.Tr) {
viewName := viewName
tabClickCallback := func(tabIndex int) error { return gui.onViewTabClick(viewName, tabIndex) }

View File

@@ -39,7 +39,7 @@ func (gui *Gui) handleShowAllBranchLogs() error {
return gui.refreshMainViews(refreshMainOpts{
main: &viewUpdateOpts{
title: "Log",
title: gui.c.Tr.LogTitle,
task: task,
},
})

View File

@@ -24,6 +24,7 @@ type TranslationSet struct {
MergingTitle string
MergeConfirmTitle string
NormalTitle string
LogTitle string
CommitMessage string
CredentialsUsername string
CredentialsPassword string
@@ -645,6 +646,7 @@ func EnglishTranslationSet() TranslationSet {
StagingTitle: "Main Panel (Staging)",
MergingTitle: "Main Panel (Merging)",
NormalTitle: "Main Panel (Normal)",
LogTitle: "Log",
CommitMessage: "Commit message",
CredentialsUsername: "Username",
CredentialsPassword: "Password",
@@ -806,7 +808,7 @@ func EnglishTranslationSet() TranslationSet {
MergeOptionsTitle: "Merge Options",
RebaseOptionsTitle: "Rebase Options",
CommitMessageTitle: "Commit Message",
LocalBranchesTitle: "Branches",
LocalBranchesTitle: "Local Branches",
SearchTitle: "Search",
TagsTitle: "Tags",
MenuTitle: "Menu",

View File

@@ -33,6 +33,7 @@ func japaneseTranslationSet() TranslationSet {
StagingTitle: "メインパネル (Staging)",
MergingTitle: "メインパネル (Merging)",
NormalTitle: "メインパネル (Normal)",
LogTitle: "ログ",
CommitMessage: "コミットメッセージ",
CredentialsUsername: "ユーザ名",
CredentialsPassword: "パスワード",
@@ -192,7 +193,7 @@ func japaneseTranslationSet() TranslationSet {
SearchTitle: "検索",
TagsTitle: "タグ",
MenuTitle: "メニュー",
RemotesTitle: "ブランチ",
RemotesTitle: "リモート",
RemoteBranchesTitle: "リモートブランチ",
PatchBuildingTitle: "メインパネル (Patch Building)",
InformationTitle: "Information",
@@ -247,9 +248,9 @@ func japaneseTranslationSet() TranslationSet {
// CheckingOutStatus: "checking out",
// CommittingStatus: "committing",
CommitFiles: "Commit files",
SubCommitsDynamicTitle: "Commits (%s)",
SubCommitsDynamicTitle: "コミット (%s)",
CommitFilesDynamicTitle: "Diff files (%s)",
RemoteBranchesDynamicTitle: "Remote branches (%s)",
RemoteBranchesDynamicTitle: "リモートブランチ (%s)",
// LcViewItemFiles: "view selected item's files",
CommitFilesTitle: "コミットファイル",
// LcCheckoutCommitFile: "checkout file",
@@ -460,7 +461,7 @@ func japaneseTranslationSet() TranslationSet {
ShowingWhitespaceInDiffView: "空白文字の変更は差分画面に表示されます",
// IncreaseContextInDiffView: "Increase the size of the context shown around changes in the diff view",
// DecreaseContextInDiffView: "Decrease the size of the context shown around changes in the diff view",
CreatePullRequest: "pull requestを作成s",
CreatePullRequest: "pull requestを作成",
// CreatePullRequestOptions: "Create pull request options",
// LcCreatePullRequestOptions: "create pull request options",
LcDefaultBranch: "デフォルトブランチ",