mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
type the translations
This commit is contained in:
parent
5d40c084a5
commit
129c9bbe9e
17 changed files with 123 additions and 132 deletions
2
main.go
2
main.go
|
|
@ -54,6 +54,6 @@ func main() {
|
||||||
stackTrace := newErr.ErrorStack()
|
stackTrace := newErr.ErrorStack()
|
||||||
app.Log.Error(stackTrace)
|
app.Log.Error(stackTrace)
|
||||||
|
|
||||||
log.Fatal(fmt.Sprintf("%s\n\n%s", app.Tr.SLocalize("ErrorOccurred"), stackTrace))
|
log.Fatal(fmt.Sprintf("%s\n\n%s", app.Tr.ErrorOccurred, stackTrace))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ type App struct {
|
||||||
OSCommand *commands.OSCommand
|
OSCommand *commands.OSCommand
|
||||||
DockerCommand *commands.DockerCommand
|
DockerCommand *commands.DockerCommand
|
||||||
Gui *gui.Gui
|
Gui *gui.Gui
|
||||||
Tr *i18n.Localizer
|
Tr i18n.TranslationSet
|
||||||
ErrorChan chan error
|
ErrorChan chan error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,7 +33,7 @@ func NewApp(config *config.AppConfig) (*App, error) {
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
app.Log = log.NewLogger(config, "23432119147a4367abf7c0de2aa99a2d")
|
app.Log = log.NewLogger(config, "23432119147a4367abf7c0de2aa99a2d")
|
||||||
app.Tr := i18n.NewTranslationSet(logger)
|
app.Tr = i18n.NewTranslationSet(app.Log)
|
||||||
app.OSCommand = commands.NewOSCommand(app.Log, config)
|
app.OSCommand = commands.NewOSCommand(app.Log, config)
|
||||||
|
|
||||||
// here is the place to make use of the docker-compose.yml file in the current directory
|
// here is the place to make use of the docker-compose.yml file in the current directory
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import (
|
||||||
type DockerCommand struct {
|
type DockerCommand struct {
|
||||||
Log *logrus.Entry
|
Log *logrus.Entry
|
||||||
OSCommand *OSCommand
|
OSCommand *OSCommand
|
||||||
Tr *i18n.Localizer
|
Tr i18n.TranslationSet
|
||||||
Config *config.AppConfig
|
Config *config.AppConfig
|
||||||
Client *client.Client
|
Client *client.Client
|
||||||
InDockerComposeProject bool
|
InDockerComposeProject bool
|
||||||
|
|
@ -37,7 +37,7 @@ type DockerCommand struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewDockerCommand it runs git commands
|
// NewDockerCommand it runs git commands
|
||||||
func NewDockerCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.Localizer, config *config.AppConfig, errorChan chan error) (*DockerCommand, error) {
|
func NewDockerCommand(log *logrus.Entry, osCommand *OSCommand, tr i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*DockerCommand, error) {
|
||||||
cli, err := client.NewEnvClient()
|
cli, err := client.NewEnvClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ func NewDummyDockerCommandWithOSCommand(osCommand *OSCommand) *DockerCommand {
|
||||||
return &DockerCommand{
|
return &DockerCommand{
|
||||||
Log: NewDummyLog(),
|
Log: NewDummyLog(),
|
||||||
OSCommand: osCommand,
|
OSCommand: osCommand,
|
||||||
Tr: i18n.NewLocalizer(NewDummyLog()),
|
Tr: i18n.NewTranslationSet(NewDummyLog()),
|
||||||
Config: NewDummyAppConfig(),
|
Config: NewDummyAppConfig(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,16 +130,6 @@ func (gui *Gui) createPopupPanel(g *gocui.Gui, currentView *gocui.View, title, p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) setKeyBindings(g *gocui.Gui, handleConfirm, handleClose func(*gocui.Gui, *gocui.View) error) error {
|
func (gui *Gui) setKeyBindings(g *gocui.Gui, handleConfirm, handleClose func(*gocui.Gui, *gocui.View) error) error {
|
||||||
actions := gui.Tr.TemplateLocalize(
|
|
||||||
"CloseConfirm",
|
|
||||||
Teml{
|
|
||||||
"keyBindClose": "esc",
|
|
||||||
"keyBindConfirm": "enter",
|
|
||||||
},
|
|
||||||
)
|
|
||||||
if err := gui.renderString(g, "options", actions); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := g.SetKeybinding("confirmation", gocui.KeyEnter, gocui.ModNone, gui.wrappedConfirmationFunction(handleConfirm)); err != nil {
|
if err := g.SetKeybinding("confirmation", gocui.KeyEnter, gocui.ModNone, gui.wrappedConfirmationFunction(handleConfirm)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -168,7 +158,7 @@ func (gui *Gui) createSpecificErrorPanel(message string, nextView *gocui.View, w
|
||||||
|
|
||||||
colorFunction := color.New(color.FgRed).SprintFunc()
|
colorFunction := color.New(color.FgRed).SprintFunc()
|
||||||
coloredMessage := colorFunction(strings.TrimSpace(message))
|
coloredMessage := colorFunction(strings.TrimSpace(message))
|
||||||
return gui.createConfirmationPanel(gui.g, nextView, gui.Tr.SLocalize("Error"), coloredMessage, nil, nil)
|
return gui.createConfirmationPanel(gui.g, nextView, gui.Tr.ErrorTitle, coloredMessage, nil, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) createErrorPanel(g *gocui.Gui, message string) error {
|
func (gui *Gui) createErrorPanel(g *gocui.Gui, message string) error {
|
||||||
|
|
|
||||||
|
|
@ -350,17 +350,17 @@ func (gui *Gui) handleContainersRemoveMenu(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
|
||||||
options := []*removeContainerOption{
|
options := []*removeContainerOption{
|
||||||
{
|
{
|
||||||
description: gui.Tr.SLocalize("remove"),
|
description: gui.Tr.Remove,
|
||||||
command: "docker rm " + container.ID[1:10],
|
command: "docker rm " + container.ID[1:10],
|
||||||
configOptions: types.ContainerRemoveOptions{},
|
configOptions: types.ContainerRemoveOptions{},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: gui.Tr.SLocalize("removeWithVolumes"),
|
description: gui.Tr.RemoveWithVolumes,
|
||||||
command: "docker rm --volumes " + container.ID[1:10],
|
command: "docker rm --volumes " + container.ID[1:10],
|
||||||
configOptions: types.ContainerRemoveOptions{RemoveVolumes: true},
|
configOptions: types.ContainerRemoveOptions{RemoveVolumes: true},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: gui.Tr.SLocalize("cancel"),
|
description: gui.Tr.Cancel,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -370,13 +370,13 @@ func (gui *Gui) handleContainersRemoveMenu(g *gocui.Gui, v *gocui.View) error {
|
||||||
}
|
}
|
||||||
configOptions := options[index].configOptions
|
configOptions := options[index].configOptions
|
||||||
|
|
||||||
return gui.WithWaitingStatus(gui.Tr.SLocalize("RemovingStatus"), func() error {
|
return gui.WithWaitingStatus(gui.Tr.RemovingStatus, func() error {
|
||||||
if cerr := container.Remove(configOptions); cerr != nil {
|
if cerr := container.Remove(configOptions); cerr != nil {
|
||||||
var originalErr commands.ComplexError
|
var originalErr commands.ComplexError
|
||||||
if xerrors.As(cerr, &originalErr) {
|
if xerrors.As(cerr, &originalErr) {
|
||||||
if originalErr.Code == commands.MustStopContainer {
|
if originalErr.Code == commands.MustStopContainer {
|
||||||
return gui.createConfirmationPanel(gui.g, v, gui.Tr.SLocalize("Confirm"), gui.Tr.SLocalize("mustForceToRemoveContainer"), func(g *gocui.Gui, v *gocui.View) error {
|
return gui.createConfirmationPanel(gui.g, v, gui.Tr.Confirm, gui.Tr.MustForceToRemoveContainer, func(g *gocui.Gui, v *gocui.View) error {
|
||||||
return gui.WithWaitingStatus(gui.Tr.SLocalize("RemovingStatus"), func() error {
|
return gui.WithWaitingStatus(gui.Tr.RemovingStatus, func() error {
|
||||||
configOptions.Force = true
|
configOptions.Force = true
|
||||||
if err := container.Remove(configOptions); err != nil {
|
if err := container.Remove(configOptions); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
@ -404,8 +404,8 @@ func (gui *Gui) handleContainerStop(g *gocui.Gui, v *gocui.View) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return gui.createConfirmationPanel(gui.g, v, gui.Tr.SLocalize("Confirm"), gui.Tr.SLocalize("StopContainer"), func(g *gocui.Gui, v *gocui.View) error {
|
return gui.createConfirmationPanel(gui.g, v, gui.Tr.Confirm, gui.Tr.StopContainer, func(g *gocui.Gui, v *gocui.View) error {
|
||||||
return gui.WithWaitingStatus(gui.Tr.SLocalize("StoppingStatus"), func() error {
|
return gui.WithWaitingStatus(gui.Tr.StoppingStatus, func() error {
|
||||||
if err := container.Stop(); err != nil {
|
if err := container.Stop(); err != nil {
|
||||||
return gui.createErrorPanel(gui.g, err.Error())
|
return gui.createErrorPanel(gui.g, err.Error())
|
||||||
}
|
}
|
||||||
|
|
@ -422,7 +422,7 @@ func (gui *Gui) handleContainerRestart(g *gocui.Gui, v *gocui.View) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return gui.WithWaitingStatus(gui.Tr.SLocalize("RestartingStatus"), func() error {
|
return gui.WithWaitingStatus(gui.Tr.RestartingStatus, func() error {
|
||||||
if err := container.Restart(); err != nil {
|
if err := container.Restart(); err != nil {
|
||||||
return gui.createErrorPanel(gui.g, err.Error())
|
return gui.createErrorPanel(gui.g, err.Error())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,15 +44,12 @@ type SentinelErrors struct {
|
||||||
// localising things in the code.
|
// localising things in the code.
|
||||||
func (gui *Gui) GenerateSentinelErrors() {
|
func (gui *Gui) GenerateSentinelErrors() {
|
||||||
gui.Errors = SentinelErrors{
|
gui.Errors = SentinelErrors{
|
||||||
ErrSubProcess: errors.New(gui.Tr.SLocalize("RunningSubprocess")),
|
ErrSubProcess: errors.New(gui.Tr.RunningSubprocess),
|
||||||
ErrNoContainers: errors.New(gui.Tr.SLocalize("NoContainers")),
|
ErrNoContainers: errors.New(gui.Tr.NoContainers),
|
||||||
ErrNoImages: errors.New(gui.Tr.SLocalize("NoImages")),
|
ErrNoImages: errors.New(gui.Tr.NoImages),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Teml is short for template used to make the required map[string]interface{} shorter when using gui.Tr.SLocalize and gui.Tr.TemplateLocalize
|
|
||||||
type Teml i18n.Teml
|
|
||||||
|
|
||||||
// Gui wraps the gocui Gui object which handles rendering and events
|
// Gui wraps the gocui Gui object which handles rendering and events
|
||||||
type Gui struct {
|
type Gui struct {
|
||||||
g *gocui.Gui
|
g *gocui.Gui
|
||||||
|
|
@ -62,7 +59,7 @@ type Gui struct {
|
||||||
SubProcess *exec.Cmd
|
SubProcess *exec.Cmd
|
||||||
State guiState
|
State guiState
|
||||||
Config *config.AppConfig
|
Config *config.AppConfig
|
||||||
Tr *i18n.Localizer
|
Tr i18n.TranslationSet
|
||||||
Errors SentinelErrors
|
Errors SentinelErrors
|
||||||
statusManager *statusManager
|
statusManager *statusManager
|
||||||
waitForIntro sync.WaitGroup
|
waitForIntro sync.WaitGroup
|
||||||
|
|
@ -111,7 +108,7 @@ type guiState struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewGui builds a new gui handler
|
// NewGui builds a new gui handler
|
||||||
func NewGui(log *logrus.Entry, dockerCommand *commands.DockerCommand, oSCommand *commands.OSCommand, tr *i18n.Localizer, config *config.AppConfig, errorChan chan error) (*Gui, error) {
|
func NewGui(log *logrus.Entry, dockerCommand *commands.DockerCommand, oSCommand *commands.OSCommand, tr i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*Gui, error) {
|
||||||
|
|
||||||
initialState := guiState{
|
initialState := guiState{
|
||||||
PreviousView: "services",
|
PreviousView: "services",
|
||||||
|
|
@ -172,7 +169,7 @@ func (gui *Gui) loadNewDirectory() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) promptAnonymousReporting() error {
|
func (gui *Gui) promptAnonymousReporting() error {
|
||||||
return gui.createConfirmationPanel(gui.g, nil, gui.Tr.SLocalize("AnonymousReportingTitle"), gui.Tr.SLocalize("AnonymousReportingPrompt"), func(g *gocui.Gui, v *gocui.View) error {
|
return gui.createConfirmationPanel(gui.g, nil, gui.Tr.AnonymousReportingTitle, gui.Tr.AnonymousReportingPrompt, func(g *gocui.Gui, v *gocui.View) error {
|
||||||
gui.waitForIntro.Done()
|
gui.waitForIntro.Done()
|
||||||
return gui.Config.WriteToUserConfig(func(userConfig *config.UserConfig) error {
|
return gui.Config.WriteToUserConfig(func(userConfig *config.UserConfig) error {
|
||||||
userConfig.Reporting = "on"
|
userConfig.Reporting = "on"
|
||||||
|
|
@ -197,10 +194,10 @@ func (gui *Gui) renderAppStatus() error {
|
||||||
|
|
||||||
func (gui *Gui) renderGlobalOptions() error {
|
func (gui *Gui) renderGlobalOptions() error {
|
||||||
return gui.renderOptionsMap(map[string]string{
|
return gui.renderOptionsMap(map[string]string{
|
||||||
"PgUp/PgDn": gui.Tr.SLocalize("scroll"),
|
"PgUp/PgDn": gui.Tr.Scroll,
|
||||||
"← → ↑ ↓": gui.Tr.SLocalize("navigate"),
|
"← → ↑ ↓": gui.Tr.Navigate,
|
||||||
"esc/q": gui.Tr.SLocalize("close"),
|
"esc/q": gui.Tr.Close,
|
||||||
"x": gui.Tr.SLocalize("menu"),
|
"x": gui.Tr.Menu,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -278,7 +275,7 @@ func (gui *Gui) reRenderMain() error {
|
||||||
|
|
||||||
func (gui *Gui) quit(g *gocui.Gui, v *gocui.View) error {
|
func (gui *Gui) quit(g *gocui.Gui, v *gocui.View) error {
|
||||||
if gui.Config.UserConfig.ConfirmOnQuit {
|
if gui.Config.UserConfig.ConfirmOnQuit {
|
||||||
return gui.createConfirmationPanel(g, v, "", gui.Tr.SLocalize("ConfirmQuit"), func(g *gocui.Gui, v *gocui.View) error {
|
return gui.createConfirmationPanel(g, v, "", gui.Tr.ConfirmQuit, func(g *gocui.Gui, v *gocui.View) error {
|
||||||
return gocui.ErrQuit
|
return gocui.ErrQuit
|
||||||
}, nil)
|
}, nil)
|
||||||
}
|
}
|
||||||
|
|
@ -291,7 +288,7 @@ func (gui *Gui) handleDonate(g *gocui.Gui, v *gocui.View) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
cx, _ := v.Cursor()
|
cx, _ := v.Cursor()
|
||||||
if cx > len(gui.Tr.SLocalize("Donate")) {
|
if cx > len(gui.Tr.Donate) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return gui.OSCommand.OpenLink("https://donorbox.org/lazydocker")
|
return gui.OSCommand.OpenLink("https://donorbox.org/lazydocker")
|
||||||
|
|
@ -327,7 +324,7 @@ func (gui *Gui) runSyncOrAsyncCommand(sub *exec.Cmd, err error) (bool, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) handleCustomCommand(g *gocui.Gui, v *gocui.View) error {
|
func (gui *Gui) handleCustomCommand(g *gocui.Gui, v *gocui.View) error {
|
||||||
return gui.createPromptPanel(g, v, gui.Tr.SLocalize("CustomCommand"), func(g *gocui.Gui, v *gocui.View) error {
|
return gui.createPromptPanel(g, v, gui.Tr.CustomCommandTitle, func(g *gocui.Gui, v *gocui.View) error {
|
||||||
command := gui.trimmedContent(v)
|
command := gui.trimmedContent(v)
|
||||||
gui.SubProcess = gui.OSCommand.RunCustomCommand(command)
|
gui.SubProcess = gui.OSCommand.RunCustomCommand(command)
|
||||||
return gui.Errors.ErrSubProcess
|
return gui.Errors.ErrSubProcess
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ func (gui *Gui) handleImageSelect(g *gocui.Gui, v *gocui.View) error {
|
||||||
if err != gui.Errors.ErrNoImages {
|
if err != gui.Errors.ErrNoImages {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return gui.renderString(g, "main", gui.Tr.SLocalize("NoImages"))
|
return gui.renderString(g, "main", gui.Tr.NoImages)
|
||||||
}
|
}
|
||||||
|
|
||||||
key := Image.ID + "-" + gui.getImageContexts()[gui.State.Panels.Images.ContextIndex]
|
key := Image.ID + "-" + gui.getImageContexts()[gui.State.Panels.Images.ContextIndex]
|
||||||
|
|
@ -238,19 +238,19 @@ func (gui *Gui) handleImagesRemoveMenu(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
|
||||||
options := []*removeImageOption{
|
options := []*removeImageOption{
|
||||||
{
|
{
|
||||||
description: gui.Tr.SLocalize("remove"),
|
description: gui.Tr.Remove,
|
||||||
command: "docker image rm " + Image.ID[1:20],
|
command: "docker image rm " + Image.ID[1:20],
|
||||||
configOptions: types.ImageRemoveOptions{PruneChildren: true},
|
configOptions: types.ImageRemoveOptions{PruneChildren: true},
|
||||||
runCommand: true,
|
runCommand: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: gui.Tr.SLocalize("removeWithoutPrune"),
|
description: gui.Tr.RemoveWithoutPrune,
|
||||||
command: "docker image rm --no-prune " + Image.ID[1:20],
|
command: "docker image rm --no-prune " + Image.ID[1:20],
|
||||||
configOptions: types.ImageRemoveOptions{PruneChildren: false},
|
configOptions: types.ImageRemoveOptions{PruneChildren: false},
|
||||||
runCommand: true,
|
runCommand: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: gui.Tr.SLocalize("cancel"),
|
description: gui.Tr.Cancel,
|
||||||
runCommand: false,
|
runCommand: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -271,8 +271,8 @@ func (gui *Gui) handleImagesRemoveMenu(g *gocui.Gui, v *gocui.View) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) handlePruneImages(g *gocui.Gui, v *gocui.View) error {
|
func (gui *Gui) handlePruneImages(g *gocui.Gui, v *gocui.View) error {
|
||||||
return gui.createConfirmationPanel(gui.g, v, gui.Tr.SLocalize("Confirm"), gui.Tr.SLocalize("confirmPruneImages"), func(g *gocui.Gui, v *gocui.View) error {
|
return gui.createConfirmationPanel(gui.g, v, gui.Tr.Confirm, gui.Tr.ConfirmPruneImages, func(g *gocui.Gui, v *gocui.View) error {
|
||||||
return gui.WithWaitingStatus(gui.Tr.SLocalize("PruningStatus"), func() error {
|
return gui.WithWaitingStatus(gui.Tr.PruningStatus, func() error {
|
||||||
err := gui.DockerCommand.PruneImages()
|
err := gui.DockerCommand.PruneImages()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return gui.createErrorPanel(gui.g, err.Error())
|
return gui.createErrorPanel(gui.g, err.Error())
|
||||||
|
|
|
||||||
|
|
@ -124,14 +124,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||||
Key: 'e',
|
Key: 'e',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleEditConfig,
|
Handler: gui.handleEditConfig,
|
||||||
Description: gui.Tr.SLocalize("EditConfig"),
|
Description: gui.Tr.EditConfig,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "status",
|
ViewName: "status",
|
||||||
Key: 'o',
|
Key: 'o',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleOpenConfig,
|
Handler: gui.handleOpenConfig,
|
||||||
Description: gui.Tr.SLocalize("OpenConfig"),
|
Description: gui.Tr.OpenConfig,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "menu",
|
ViewName: "menu",
|
||||||
|
|
@ -156,119 +156,119 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||||
Key: '[',
|
Key: '[',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleContainersPrevContext,
|
Handler: gui.handleContainersPrevContext,
|
||||||
Description: gui.Tr.SLocalize("previousContext"),
|
Description: gui.Tr.PreviousContext,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "containers",
|
ViewName: "containers",
|
||||||
Key: ']',
|
Key: ']',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleContainersNextContext,
|
Handler: gui.handleContainersNextContext,
|
||||||
Description: gui.Tr.SLocalize("nextContext"),
|
Description: gui.Tr.NextContext,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "containers",
|
ViewName: "containers",
|
||||||
Key: 'd',
|
Key: 'd',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleContainersRemoveMenu,
|
Handler: gui.handleContainersRemoveMenu,
|
||||||
Description: gui.Tr.SLocalize("remove"),
|
Description: gui.Tr.Remove,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "containers",
|
ViewName: "containers",
|
||||||
Key: 's',
|
Key: 's',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleContainerStop,
|
Handler: gui.handleContainerStop,
|
||||||
Description: gui.Tr.SLocalize("stop"),
|
Description: gui.Tr.Stop,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "containers",
|
ViewName: "containers",
|
||||||
Key: 'r',
|
Key: 'r',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleContainerRestart,
|
Handler: gui.handleContainerRestart,
|
||||||
Description: gui.Tr.SLocalize("restart"),
|
Description: gui.Tr.Restart,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "containers",
|
ViewName: "containers",
|
||||||
Key: 'a',
|
Key: 'a',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleContainerAttach,
|
Handler: gui.handleContainerAttach,
|
||||||
Description: gui.Tr.SLocalize("attach"),
|
Description: gui.Tr.Attach,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "services",
|
ViewName: "services",
|
||||||
Key: 'd',
|
Key: 'd',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleServiceRemoveMenu,
|
Handler: gui.handleServiceRemoveMenu,
|
||||||
Description: gui.Tr.SLocalize("removeService"),
|
Description: gui.Tr.RemoveService,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "services",
|
ViewName: "services",
|
||||||
Key: 's',
|
Key: 's',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleServiceStop,
|
Handler: gui.handleServiceStop,
|
||||||
Description: gui.Tr.SLocalize("stop"),
|
Description: gui.Tr.Stop,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "services",
|
ViewName: "services",
|
||||||
Key: 'r',
|
Key: 'r',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleServiceRestart,
|
Handler: gui.handleServiceRestart,
|
||||||
Description: gui.Tr.SLocalize("restart"),
|
Description: gui.Tr.Restart,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "services",
|
ViewName: "services",
|
||||||
Key: 'a',
|
Key: 'a',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleServiceAttach,
|
Handler: gui.handleServiceAttach,
|
||||||
Description: gui.Tr.SLocalize("attach"),
|
Description: gui.Tr.Attach,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "services",
|
ViewName: "services",
|
||||||
Key: 'm',
|
Key: 'm',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleServiceViewLogs,
|
Handler: gui.handleServiceViewLogs,
|
||||||
Description: gui.Tr.SLocalize("viewLogs"),
|
Description: gui.Tr.ViewLogs,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "services",
|
ViewName: "services",
|
||||||
Key: '[',
|
Key: '[',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleServicesPrevContext,
|
Handler: gui.handleServicesPrevContext,
|
||||||
Description: gui.Tr.SLocalize("previousContext"),
|
Description: gui.Tr.PreviousContext,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "services",
|
ViewName: "services",
|
||||||
Key: ']',
|
Key: ']',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleServicesNextContext,
|
Handler: gui.handleServicesNextContext,
|
||||||
Description: gui.Tr.SLocalize("nextContext"),
|
Description: gui.Tr.NextContext,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "images",
|
ViewName: "images",
|
||||||
Key: '[',
|
Key: '[',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleImagesPrevContext,
|
Handler: gui.handleImagesPrevContext,
|
||||||
Description: gui.Tr.SLocalize("previousContext"),
|
Description: gui.Tr.PreviousContext,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "images",
|
ViewName: "images",
|
||||||
Key: ']',
|
Key: ']',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleImagesNextContext,
|
Handler: gui.handleImagesNextContext,
|
||||||
Description: gui.Tr.SLocalize("nextContext"),
|
Description: gui.Tr.NextContext,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "images",
|
ViewName: "images",
|
||||||
Key: 'd',
|
Key: 'd',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleImagesRemoveMenu,
|
Handler: gui.handleImagesRemoveMenu,
|
||||||
Description: gui.Tr.SLocalize("removeImage"),
|
Description: gui.Tr.RemoveImage,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "images",
|
ViewName: "images",
|
||||||
Key: 'D',
|
Key: 'D',
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handlePruneImages,
|
Handler: gui.handlePruneImages,
|
||||||
Description: gui.Tr.SLocalize("pruneImages"),
|
Description: gui.Tr.PruneImages,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
||||||
if err.Error() != "unknown view" {
|
if err.Error() != "unknown view" {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
v.Title = gui.Tr.SLocalize("NotEnoughSpace")
|
v.Title = gui.Tr.NotEnoughSpace
|
||||||
v.Wrap = true
|
v.Wrap = true
|
||||||
_, _ = g.SetViewOnTop("limit")
|
_, _ = g.SetViewOnTop("limit")
|
||||||
}
|
}
|
||||||
|
|
@ -142,7 +142,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
||||||
if err.Error() != "unknown view" {
|
if err.Error() != "unknown view" {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
v.Title = gui.Tr.SLocalize("StatusTitle")
|
v.Title = gui.Tr.StatusTitle
|
||||||
v.FgColor = gocui.ColorWhite
|
v.FgColor = gocui.ColorWhite
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -152,7 +152,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
servicesView.Highlight = true
|
servicesView.Highlight = true
|
||||||
servicesView.Title = gui.Tr.SLocalize("ServicesTitle")
|
servicesView.Title = gui.Tr.ServicesTitle
|
||||||
servicesView.FgColor = gocui.ColorWhite
|
servicesView.FgColor = gocui.ColorWhite
|
||||||
|
|
||||||
gui.focusPoint(0, gui.State.Panels.Services.SelectedLine, len(gui.DockerCommand.Services), servicesView)
|
gui.focusPoint(0, gui.State.Panels.Services.SelectedLine, len(gui.DockerCommand.Services), servicesView)
|
||||||
|
|
@ -164,7 +164,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
containersView.Highlight = true
|
containersView.Highlight = true
|
||||||
containersView.Title = gui.Tr.SLocalize("ContainersTitle")
|
containersView.Title = gui.Tr.ContainersTitle
|
||||||
containersView.FgColor = gocui.ColorWhite
|
containersView.FgColor = gocui.ColorWhite
|
||||||
|
|
||||||
gui.focusPoint(0, gui.State.Panels.Containers.SelectedLine, len(gui.DockerCommand.Containers), containersView)
|
gui.focusPoint(0, gui.State.Panels.Containers.SelectedLine, len(gui.DockerCommand.Containers), containersView)
|
||||||
|
|
@ -176,7 +176,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
imagesView.Highlight = true
|
imagesView.Highlight = true
|
||||||
imagesView.Title = gui.Tr.SLocalize("ImagesTitle")
|
imagesView.Title = gui.Tr.ImagesTitle
|
||||||
imagesView.FgColor = gocui.ColorWhite
|
imagesView.FgColor = gocui.ColorWhite
|
||||||
|
|
||||||
gui.focusPoint(0, gui.State.Panels.Images.SelectedLine, len(gui.DockerCommand.Images), imagesView)
|
gui.focusPoint(0, gui.State.Panels.Images.SelectedLine, len(gui.DockerCommand.Images), imagesView)
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@ func (gui *Gui) handleMenuPrevLine(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
|
||||||
func (gui *Gui) renderMenuOptions() error {
|
func (gui *Gui) renderMenuOptions() error {
|
||||||
optionsMap := map[string]string{
|
optionsMap := map[string]string{
|
||||||
"esc/q": gui.Tr.SLocalize("close"),
|
"esc/q": gui.Tr.Close,
|
||||||
"↑ ↓": gui.Tr.SLocalize("navigate"),
|
"↑ ↓": gui.Tr.Navigate,
|
||||||
"space": gui.Tr.SLocalize("execute"),
|
"space": gui.Tr.Execute,
|
||||||
}
|
}
|
||||||
return gui.renderOptionsMap(optionsMap)
|
return gui.renderOptionsMap(optionsMap)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,5 +49,5 @@ func (gui *Gui) handleCreateOptionsMenu(g *gocui.Gui, v *gocui.View) error {
|
||||||
return bindings[index].Handler(g, v)
|
return bindings[index].Handler(g, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
return gui.createMenu(strings.Title(gui.Tr.SLocalize("menu")), bindings, len(bindings), handleMenuPress)
|
return gui.createMenu(strings.Title(gui.Tr.Menu), bindings, len(bindings), handleMenuPress)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -203,15 +203,15 @@ func (gui *Gui) handleServiceRemoveMenu(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
|
||||||
options := []*removeServiceOption{
|
options := []*removeServiceOption{
|
||||||
{
|
{
|
||||||
description: gui.Tr.SLocalize("remove"),
|
description: gui.Tr.Remove,
|
||||||
command: fmt.Sprintf("%s rm --stop --force %s", composeCommand, service.Name),
|
command: fmt.Sprintf("%s rm --stop --force %s", composeCommand, service.Name),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: gui.Tr.SLocalize("removeWithVolumes"),
|
description: gui.Tr.RemoveWithVolumes,
|
||||||
command: fmt.Sprintf("%s rm --stop --force -v %s", composeCommand, service.Name),
|
command: fmt.Sprintf("%s rm --stop --force -v %s", composeCommand, service.Name),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: gui.Tr.SLocalize("cancel"),
|
description: gui.Tr.Cancel,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -219,7 +219,7 @@ func (gui *Gui) handleServiceRemoveMenu(g *gocui.Gui, v *gocui.View) error {
|
||||||
if options[index].command == "" {
|
if options[index].command == "" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return gui.WithWaitingStatus(gui.Tr.SLocalize("RemovingStatus"), func() error {
|
return gui.WithWaitingStatus(gui.Tr.RemovingStatus, func() error {
|
||||||
if err := gui.OSCommand.RunCommand(options[index].command); err != nil {
|
if err := gui.OSCommand.RunCommand(options[index].command); err != nil {
|
||||||
return gui.createErrorPanel(gui.g, err.Error())
|
return gui.createErrorPanel(gui.g, err.Error())
|
||||||
}
|
}
|
||||||
|
|
@ -237,8 +237,8 @@ func (gui *Gui) handleServiceStop(g *gocui.Gui, v *gocui.View) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return gui.createConfirmationPanel(gui.g, v, gui.Tr.SLocalize("Confirm"), gui.Tr.SLocalize("StopService"), func(g *gocui.Gui, v *gocui.View) error {
|
return gui.createConfirmationPanel(gui.g, v, gui.Tr.Confirm, gui.Tr.StopService, func(g *gocui.Gui, v *gocui.View) error {
|
||||||
return gui.WithWaitingStatus(gui.Tr.SLocalize("StoppingStatus"), func() error {
|
return gui.WithWaitingStatus(gui.Tr.StoppingStatus, func() error {
|
||||||
if err := service.Stop(); err != nil {
|
if err := service.Stop(); err != nil {
|
||||||
return gui.createErrorPanel(gui.g, err.Error())
|
return gui.createErrorPanel(gui.g, err.Error())
|
||||||
}
|
}
|
||||||
|
|
@ -255,7 +255,7 @@ func (gui *Gui) handleServiceRestart(g *gocui.Gui, v *gocui.View) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return gui.WithWaitingStatus(gui.Tr.SLocalize("RestartingStatus"), func() error {
|
return gui.WithWaitingStatus(gui.Tr.RestartingStatus, func() error {
|
||||||
if err := service.Restart(); err != nil {
|
if err := service.Restart(); err != nil {
|
||||||
return gui.createErrorPanel(gui.g, err.Error())
|
return gui.createErrorPanel(gui.g, err.Error())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ func (gui *Gui) runCommand() error {
|
||||||
gui.SubProcess.Stdin = nil
|
gui.SubProcess.Stdin = nil
|
||||||
gui.SubProcess = nil
|
gui.SubProcess = nil
|
||||||
|
|
||||||
fmt.Fprintf(os.Stdout, "\n%s", utils.ColoredString(gui.Tr.SLocalize("pressEnterToReturn"), color.FgGreen))
|
fmt.Fprintf(os.Stdout, "\n%s", utils.ColoredString(gui.Tr.PressEnterToReturn, color.FgGreen))
|
||||||
|
|
||||||
fmt.Scanln() // wait for enter press
|
fmt.Scanln() // wait for enter press
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ func (gui *Gui) newLineFocused(g *gocui.Gui, v *gocui.View) error {
|
||||||
v.Highlight = false
|
v.Highlight = false
|
||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
panic(gui.Tr.SLocalize("NoViewMachingNewLineFocusedSwitchStatement"))
|
panic(gui.Tr.NoViewMachingNewLineFocusedSwitchStatement)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -280,7 +280,6 @@ func (gui *Gui) resizePopupPanel(g *gocui.Gui, v *gocui.View) error {
|
||||||
if vx0 == x0 && vy0 == y0 && vx1 == x1 && vy1 == y1 {
|
if vx0 == x0 && vy0 == y0 && vx1 == x1 && vy1 == y1 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
gui.Log.Info(gui.Tr.SLocalize("resizingPopupPanel"))
|
|
||||||
_, err := g.SetView(v.Name(), x0, y0, x1, y1, 0)
|
_, err := g.SetView(v.Name(), x0, y0, x1, y1, 0)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,7 @@ type TranslationSet struct {
|
||||||
Execute string
|
Execute string
|
||||||
Scroll string
|
Scroll string
|
||||||
Close string
|
Close string
|
||||||
Error string
|
ErrorTitle string
|
||||||
ResizingPopupPanel string
|
|
||||||
RunningSubprocess string
|
RunningSubprocess string
|
||||||
NoViewMachingNewLineFocusedSwitchStatement string
|
NoViewMachingNewLineFocusedSwitchStatement string
|
||||||
OpenConfig string
|
OpenConfig string
|
||||||
|
|
@ -23,7 +22,7 @@ type TranslationSet struct {
|
||||||
ErrorOccurred string
|
ErrorOccurred string
|
||||||
Donate string
|
Donate string
|
||||||
Cancel string
|
Cancel string
|
||||||
CustomCommand string
|
CustomCommandTitle string
|
||||||
Remove string
|
Remove string
|
||||||
RemoveWithVolumes string
|
RemoveWithVolumes string
|
||||||
MustForceToRemoveContainer string
|
MustForceToRemoveContainer string
|
||||||
|
|
@ -55,52 +54,58 @@ type TranslationSet struct {
|
||||||
|
|
||||||
func englishSet() TranslationSet {
|
func englishSet() TranslationSet {
|
||||||
return TranslationSet{
|
return TranslationSet{
|
||||||
NotEnoughSpace: "Not enough space to render panels",
|
PruningStatus: "pruning",
|
||||||
StatusTitle: "Status",
|
RemovingStatus: "removing",
|
||||||
Navigate: "navigate",
|
RestartingStatus: "restarting",
|
||||||
Menu: "menu",
|
StoppingStatus: "stopping",
|
||||||
Execute: "execute",
|
|
||||||
Scroll: "scroll",
|
RunningSubprocess: "running subprocess",
|
||||||
Close: "close",
|
|
||||||
Error: "Error",
|
|
||||||
ResizingPopupPanel: "resizing popup panel",
|
|
||||||
RunningSubprocess: "running subprocess",
|
|
||||||
NoViewMachingNewLineFocusedSwitchStatement: "No view matching newLineFocused switch statement",
|
NoViewMachingNewLineFocusedSwitchStatement: "No view matching newLineFocused switch statement",
|
||||||
OpenConfig: "open config container",
|
|
||||||
EditConfig: "edit config container",
|
ErrorOccurred: "An error occurred! Please create an issue at https://github.com/jesseduffield/lazydocker/issues",
|
||||||
AnonymousReportingTitle: "Help make lazydocker better",
|
Donate: "Donate",
|
||||||
AnonymousReportingPrompt: "Would you like to enable anonymous reporting data to help improve lazydocker? (enter/esc)",
|
Confirm: "Confirm",
|
||||||
|
|
||||||
|
Navigate: "navigate",
|
||||||
|
Execute: "execute",
|
||||||
|
Close: "close",
|
||||||
|
Menu: "menu",
|
||||||
|
Scroll: "scroll",
|
||||||
|
OpenConfig: "open config container",
|
||||||
|
EditConfig: "edit config container",
|
||||||
|
Cancel: "cancel",
|
||||||
|
Remove: "remove",
|
||||||
|
RemoveWithVolumes: "remove with volumes",
|
||||||
|
RemoveService: "remove containers",
|
||||||
|
Stop: "stop",
|
||||||
|
Restart: "restart",
|
||||||
|
PreviousContext: "previous context",
|
||||||
|
NextContext: "next context",
|
||||||
|
Attach: "attach",
|
||||||
|
ViewLogs: "view logs",
|
||||||
|
RemoveImage: "remove image",
|
||||||
|
RemoveWithoutPrune: "remove without deleting untagged parents",
|
||||||
|
PruneImages: "prune unused images",
|
||||||
|
|
||||||
|
AnonymousReportingTitle: "Help make lazydocker better",
|
||||||
|
AnonymousReportingPrompt: "Would you like to enable anonymous reporting data to help improve lazydocker? (enter/esc)",
|
||||||
|
|
||||||
|
StatusTitle: "Status",
|
||||||
|
ServicesTitle: "Services",
|
||||||
|
ContainersTitle: "Containers",
|
||||||
|
ImagesTitle: "Images",
|
||||||
|
CustomCommandTitle: "Custom Command:",
|
||||||
|
ErrorTitle: "Error",
|
||||||
|
|
||||||
|
NoContainers: "No containers",
|
||||||
|
NoImages: "No images",
|
||||||
|
|
||||||
ConfirmQuit: "Are you sure you want to quit?",
|
ConfirmQuit: "Are you sure you want to quit?",
|
||||||
ErrorOccurred: "An error occurred! Please create an issue at https://github.com/jesseduffield/lazydocker/issues",
|
|
||||||
Donate: "Donate",
|
|
||||||
Cancel: "cancel",
|
|
||||||
CustomCommand: "Custom Command:",
|
|
||||||
Remove: "remove",
|
|
||||||
RemoveWithVolumes: "remove with volumes",
|
|
||||||
MustForceToRemoveContainer: "You cannot remove a running container unless you force it. Do you want to force it?",
|
MustForceToRemoveContainer: "You cannot remove a running container unless you force it. Do you want to force it?",
|
||||||
Confirm: "Confirm",
|
NotEnoughSpace: "Not enough space to render panels",
|
||||||
StopContainer: "Are you sure you want to stop this container?",
|
|
||||||
RestartingStatus: "restarting",
|
|
||||||
StoppingStatus: "stopping",
|
|
||||||
RemovingStatus: "removing",
|
|
||||||
RemoveService: "remove containers",
|
|
||||||
Stop: "stop",
|
|
||||||
Restart: "restart",
|
|
||||||
PreviousContext: "previous context",
|
|
||||||
NextContext: "next context",
|
|
||||||
Attach: "attach",
|
|
||||||
ViewLogs: "view logs",
|
|
||||||
ServicesTitle: "Services",
|
|
||||||
ContainersTitle: "Containers",
|
|
||||||
ImagesTitle: "Images",
|
|
||||||
NoContainers: "No containers",
|
|
||||||
NoImages: "No images",
|
|
||||||
RemoveImage: "remove image",
|
|
||||||
RemoveWithoutPrune: "remove without deleting untagged parents",
|
|
||||||
PruneImages: "prune unused images",
|
|
||||||
ConfirmPruneImages: "Are you sure you want to prune all unused images?",
|
ConfirmPruneImages: "Are you sure you want to prune all unused images?",
|
||||||
PruningStatus: "pruning",
|
|
||||||
StopService: "Are you sure you want to stop this service's containers? (enter/esc)",
|
StopService: "Are you sure you want to stop this service's containers? (enter/esc)",
|
||||||
|
StopContainer: "Are you sure you want to stop this container?",
|
||||||
PressEnterToReturn: "Press enter to return to lazydocker",
|
PressEnterToReturn: "Press enter to return to lazydocker",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ func writeString(file *os.File, str string) {
|
||||||
|
|
||||||
func localisedTitle(mApp *app.App, str string) string {
|
func localisedTitle(mApp *app.App, str string) string {
|
||||||
viewTitle := strings.Title(str) + "Title"
|
viewTitle := strings.Title(str) + "Title"
|
||||||
return mApp.Tr.SLocalize(viewTitle)
|
return mApp.Tr.ViewTitle // FIXME: this used to be dynamic but we can't make this dynamic again without reflection since we're now using a struct of translation strings
|
||||||
}
|
}
|
||||||
|
|
||||||
func formatTitle(title string) string {
|
func formatTitle(title string) string {
|
||||||
|
|
@ -116,7 +116,7 @@ func addBinding(title string, bindingSections []*bindingSection, binding *gui.Bi
|
||||||
}
|
}
|
||||||
|
|
||||||
func formatSections(mApp *app.App, bindingSections []*bindingSection) string {
|
func formatSections(mApp *app.App, bindingSections []*bindingSection) string {
|
||||||
content := fmt.Sprintf("# Lazydocker %s\n", mApp.Tr.SLocalize("menu"))
|
content := fmt.Sprintf("# Lazydocker %s\n", mApp.Tr.Menu)
|
||||||
|
|
||||||
for _, section := range bindingSections {
|
for _, section := range bindingSections {
|
||||||
content += formatTitle(section.title)
|
content += formatTitle(section.title)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue