mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 05:37:05 +02:00
Translate progress bar
This commit is contained in:
parent
a41318d822
commit
1f3247c3ff
5 changed files with 251 additions and 10 deletions
|
@ -24,6 +24,7 @@ import (
|
|||
"github.com/fatih/color"
|
||||
"github.com/vbauerster/mpb/v8"
|
||||
"github.com/vbauerster/mpb/v8/decor"
|
||||
"go.uploadedlobster.com/scotty/internal/i18n"
|
||||
"go.uploadedlobster.com/scotty/internal/models"
|
||||
)
|
||||
|
||||
|
@ -35,8 +36,8 @@ func progressBar(wg *sync.WaitGroup, exportProgress chan models.Progress, import
|
|||
mpb.WithAutoRefresh(),
|
||||
)
|
||||
|
||||
exportBar := setupProgressBar(p, "exporting")
|
||||
importBar := setupProgressBar(p, "importing")
|
||||
exportBar := setupProgressBar(p, i18n.Tr("exporting"))
|
||||
importBar := setupProgressBar(p, i18n.Tr("importing"))
|
||||
go updateProgressBar(exportBar, wg, exportProgress)
|
||||
go updateProgressBar(importBar, wg, importProgress)
|
||||
|
||||
|
@ -58,7 +59,7 @@ func setupProgressBar(p *mpb.Progress, name string) *mpb.Bar {
|
|||
mpb.AppendDecorators(
|
||||
decor.OnComplete(
|
||||
decor.EwmaETA(decor.ET_STYLE_GO, 0, decor.WC{C: decor.DSyncWidth}),
|
||||
"done",
|
||||
i18n.Tr("done"),
|
||||
),
|
||||
// decor.OnComplete(decor.Percentage(decor.WC{W: 5, C: decor.DSyncWidthR}), "done"),
|
||||
decor.Name(" "),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue