1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-19 21:28:28 +02:00

Merge pull request #1936 from Ryooooooga/feature/tab-i18n

This commit is contained in:
Jesse Duffield 2022-05-18 22:24:45 +10:00 committed by GitHub
commit 8fd9dea641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 105 additions and 97 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

@ -143,42 +143,3 @@ type TabContext struct {
Tab string
Context types.Context
}
func (tree ContextTree) InitialViewTabContextMap() map[string][]TabContext {
return map[string][]TabContext{
"branches": {
{
Tab: "Local Branches",
Context: tree.Branches,
},
{
Tab: "Remotes",
Context: tree.Remotes,
},
{
Tab: "Tags",
Context: tree.Tags,
},
},
"commits": {
{
Tab: "Commits",
Context: tree.LocalCommits,
},
{
Tab: "Reflog",
Context: tree.ReflogCommits,
},
},
"files": {
{
Tab: "Files",
Context: tree.Files,
},
{
Tab: "Submodules",
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: gui.initialViewTabContextMap(contextTree),
ScreenMode: screenMode,
// TODO: put contexts in the context manager
ContextManager: NewContextManager(initialContext),
@ -466,6 +466,45 @@ func (gui *Gui) initGocui() (*gocui.Gui, error) {
return g, nil
}
func (gui *Gui) initialViewTabContextMap(contextTree *context.ContextTree) map[string][]context.TabContext {
return map[string][]context.TabContext{
"branches": {
{
Tab: gui.c.Tr.LocalBranchesTitle,
Context: contextTree.Branches,
},
{
Tab: gui.c.Tr.RemotesTitle,
Context: contextTree.Remotes,
},
{
Tab: gui.c.Tr.TagsTitle,
Context: contextTree.Tags,
},
},
"commits": {
{
Tab: gui.c.Tr.CommitsTitle,
Context: contextTree.LocalCommits,
},
{
Tab: gui.c.Tr.ReflogCommitsTitle,
Context: contextTree.ReflogCommits,
},
},
"files": {
{
Tab: gui.c.Tr.FilesTitle,
Context: contextTree.Files,
},
{
Tab: gui.c.Tr.SubmodulesTitle,
Context: contextTree.Submodules,
},
},
}
}
// Run: setup the gui with keybindings and start the mainloop
func (gui *Gui) Run(filterPath string) error {
g, err := gui.initGocui()

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.initialViewTabContextMap(self.State.Contexts) {
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.initialViewTabContextMap(gui.State.Contexts) {
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
@ -647,6 +648,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",
@ -809,7 +811,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: "パスワード",
@ -193,7 +194,7 @@ func japaneseTranslationSet() TranslationSet {
SearchTitle: "検索",
TagsTitle: "タグ",
MenuTitle: "メニュー",
RemotesTitle: "ブランチ",
RemotesTitle: "リモート",
RemoteBranchesTitle: "リモートブランチ",
PatchBuildingTitle: "メインパネル (Patch Building)",
InformationTitle: "Information",
@ -248,9 +249,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",
@ -461,7 +462,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: "デフォルトブランチ",