1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Use sentence case everywhere

We have not been good at consistent casing so far. Now we use 'Sentence case' everywhere. EVERYWHERE.

Also Removing 'Lc' prefix from i18n field names: the 'Lc' stood for lowercase but now that everything
is in 'Sentence case' there's no need for the distinction.

I've got a couple lower case things I've kept: namely, things that show up in parentheses.
This commit is contained in:
Jesse Duffield
2023-05-25 21:11:51 +10:00
parent e5534d9781
commit d772c9f1d4
143 changed files with 2691 additions and 2683 deletions

View File

@ -180,7 +180,7 @@ func (self *MergeAndRebaseHelper) workingTreeStateNoun() string {
// PromptToContinueRebase asks the user if they want to continue the rebase/merge that's in progress
func (self *MergeAndRebaseHelper) PromptToContinueRebase() error {
return self.c.Confirm(types.ConfirmOpts{
Title: "continue",
Title: self.c.Tr.Continue,
Prompt: self.c.Tr.ConflictsResolved,
HandleConfirm: func() error {
return self.genericMergeCommand(REBASE_OPTION_CONTINUE)

View File

@ -53,7 +53,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
return self.withResetButton(
fmt.Sprintf(
"%s %s",
self.c.Tr.LcShowingGitDiff,
self.c.Tr.ShowingGitDiff,
"git diff "+strings.Join(self.diffHelper.DiffArgs(), " "),
),
style.FgMagenta,
@ -64,7 +64,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
{
IsActive: self.c.Git().Patch.PatchBuilder.Active,
Description: func() string {
return self.withResetButton(self.c.Tr.LcBuildingPatch, style.FgYellow.SetBold())
return self.withResetButton(self.c.Tr.BuildingPatch, style.FgYellow.SetBold())
},
Reset: self.patchBuildingHelper.Reset,
},
@ -74,7 +74,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
return self.withResetButton(
fmt.Sprintf(
"%s '%s'",
self.c.Tr.LcFilteringBy,
self.c.Tr.FilteringBy,
self.c.Modes().Filtering.GetPath(),
),
style.FgRed,
@ -86,9 +86,9 @@ func (self *ModeHelper) Statuses() []ModeStatus {
IsActive: self.c.Modes().CherryPicking.Active,
Description: func() string {
copiedCount := len(self.c.Modes().CherryPicking.CherryPickedCommits)
text := self.c.Tr.LcCommitsCopied
text := self.c.Tr.CommitsCopied
if copiedCount == 1 {
text = self.c.Tr.LcCommitCopied
text = self.c.Tr.CommitCopied
}
return self.withResetButton(
@ -109,7 +109,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
Description: func() string {
workingTreeState := self.c.Git().Status.WorkingTreeState()
return self.withResetButton(
presentation.FormatWorkingTreeState(workingTreeState), style.FgYellow,
presentation.FormatWorkingTreeStateTitle(self.c.Tr, workingTreeState), style.FgYellow,
)
},
Reset: self.mergeAndRebaseHelper.AbortMergeOrRebaseWithConfirm,
@ -119,7 +119,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
return self.c.Model().BisectInfo.Started()
},
Description: func() string {
return self.withResetButton("bisecting", style.FgGreen)
return self.withResetButton(self.c.Tr.Bisect.Bisecting, style.FgGreen)
},
Reset: self.bisectHelper.Reset,
},

View File

@ -584,7 +584,7 @@ func (self *RefreshHelper) refreshStatus() {
workingTreeState := self.c.Git().Status.WorkingTreeState()
if workingTreeState != enums.REBASE_MODE_NONE {
status += style.FgYellow.Sprintf("(%s) ", presentation.FormatWorkingTreeState(workingTreeState))
status += style.FgYellow.Sprintf("(%s) ", presentation.FormatWorkingTreeStateLower(self.c.Tr, workingTreeState))
}
name := presentation.GetBranchTextStyle(currentBranch.Name).Sprint(currentBranch.Name)

View File

@ -121,18 +121,20 @@ func (self *RefsHelper) ResetToRef(ref string, strength string, envVars []string
func (self *RefsHelper) CreateGitResetMenu(ref string) error {
type strengthWithKey struct {
strength string
label string
key types.Key
}
strengths := []strengthWithKey{
{strength: "soft", key: 's'},
{strength: "mixed", key: 'm'},
{strength: "hard", key: 'h'},
// not i18'ing because it's git terminology
{strength: "soft", label: "Soft reset", key: 's'},
{strength: "mixed", label: "Mixed reset", key: 'm'},
{strength: "hard", label: "Hard reset", key: 'h'},
}
menuItems := slices.Map(strengths, func(row strengthWithKey) *types.MenuItem {
return &types.MenuItem{
LabelColumns: []string{
fmt.Sprintf("%s reset", row.strength),
row.label,
style.FgRed.Sprintf("reset --%s %s", row.strength, ref),
},
OnPress: func() error {
@ -144,7 +146,7 @@ func (self *RefsHelper) CreateGitResetMenu(ref string) error {
})
return self.c.Menu(types.CreateMenuOptions{
Title: fmt.Sprintf("%s %s", self.c.Tr.LcResetTo, ref),
Title: fmt.Sprintf("%s %s", self.c.Tr.ResetTo, ref),
Items: menuItems,
})
}

View File

@ -88,7 +88,7 @@ func (self *ReposHelper) getCurrentBranch(path string) string {
}
}
return self.c.Tr.LcBranchUnknown
return self.c.Tr.BranchUnknown
}
func (self *ReposHelper) CreateRecentReposMenu() error {

View File

@ -100,7 +100,7 @@ func (self *SuggestionsHelper) GetBranchNameSuggestionsFunc() func(string) []*ty
// Notably, unlike other suggestion functions we're not showing all the options
// if nothing has been typed because there'll be too much to display efficiently
func (self *SuggestionsHelper) GetFilePathSuggestionsFunc() func(string) []*types.Suggestion {
_ = self.c.WithWaitingStatus(self.c.Tr.LcLoadingFileSuggestions, func() error {
_ = self.c.WithWaitingStatus(self.c.Tr.LoadingFileSuggestions, func() error {
trie := patricia.NewTrie()
// load every non-gitignored file in the repo
ignore, err := gitignore.FromGit()

View File

@ -23,13 +23,13 @@ func (self *TagsHelper) CreateTagMenu(ref string, onCreate func()) error {
Title: self.c.Tr.TagMenuTitle,
Items: []*types.MenuItem{
{
Label: self.c.Tr.LcLightweightTag,
Label: self.c.Tr.LightweightTag,
OnPress: func() error {
return self.handleCreateLightweightTag(ref, onCreate)
},
},
{
Label: self.c.Tr.LcAnnotatedTag,
Label: self.c.Tr.AnnotatedTag,
OnPress: func() error {
return self.handleCreateAnnotatedTag(ref, onCreate)
},

View File

@ -2,7 +2,6 @@ package helpers
import (
"github.com/jesseduffield/lazycore/pkg/boxlayout"
"github.com/jesseduffield/lazygit/pkg/gui/constants"
"github.com/jesseduffield/lazygit/pkg/gui/context"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/utils"
@ -179,7 +178,7 @@ func (self *WindowArrangementHelper) infoSectionChildren(informationStr string,
return []*boxlayout.Box{
{
Window: "searchPrefix",
Size: runewidth.StringWidth(constants.SEARCH_PREFIX),
Size: runewidth.StringWidth(self.c.Tr.SearchPrefix),
},
{
Window: "search",

View File

@ -154,7 +154,7 @@ func (self *WorkingTreeHelper) HandleCommitPress() error {
prefixReplace := commitPrefixConfig.Replace
rgx, err := regexp.Compile(prefixPattern)
if err != nil {
return self.c.ErrorMsg(fmt.Sprintf("%s: %s", self.c.Tr.LcCommitPrefixPatternError, err.Error()))
return self.c.ErrorMsg(fmt.Sprintf("%s: %s", self.c.Tr.CommitPrefixPatternError, err.Error()))
}
prefix := rgx.ReplaceAllString(self.refHelper.GetCheckedOutRef().Name, prefixReplace)
message = prefix