From 82f308de933cf537a0ae20def1c909ca49f803ff Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Fri, 1 May 2020 20:25:29 -0500 Subject: Translations for main.go, so mainly help --- cmd/gotop/main.go | 88 ++++++++++++++++++++++++++++--------------------- go.mod | 2 ++ go.sum | 8 +++++ translations/de_DE.toml | 44 +++++++++++++++++++++++++ translations/en_US.toml | 44 +++++++++++++++++++++++++ 5 files changed, 148 insertions(+), 38 deletions(-) create mode 100644 translations/de_DE.toml create mode 100644 translations/en_US.toml diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go index bd00b66..7459a97 100644 --- a/cmd/gotop/main.go +++ b/cmd/gotop/main.go @@ -5,6 +5,7 @@ import ( "flag" "fmt" "io" + "io/ioutil" "log" "net/http" "os" @@ -17,9 +18,11 @@ import ( //_ "net/http/pprof" + jj "github.com/cloudfoundry-attic/jibber_jabber" ui "github.com/gizak/termui/v3" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/shibukawa/configdir" + "github.com/xxxserxxx/lingo" "github.com/xxxserxxx/opflag" "github.com/xxxserxxx/gotop/v4" @@ -50,6 +53,7 @@ var ( bar *w.StatusBar statusbar bool stderrLogger = log.New(os.Stderr, "", 0) + tr lingo.Translations ) func parseArgs() error { @@ -58,35 +62,27 @@ func parseArgs() error { for i, p := range cds { cpaths[i] = p.Path } - help := opflag.BoolP("help", "h", false, "Show this screen.") - color := opflag.StringP("color", "c", conf.Colorscheme.Name, "Set a colorscheme.") - opflag.IntVarP(&conf.GraphHorizontalScale, "graphscale", "S", conf.GraphHorizontalScale, "Graph scale factor, >0") - version := opflag.BoolP("version", "v", false, "Print version and exit.") - versioN := opflag.BoolP("", "V", false, "Print version and exit.") - opflag.BoolVarP(&conf.PercpuLoad, "percpu", "p", conf.PercpuLoad, "Show each CPU in the CPU widget.") - opflag.BoolVarP(&conf.AverageLoad, "averagecpu", "a", conf.AverageLoad, "Show average CPU in the CPU widget.") - fahrenheit := opflag.BoolP("fahrenheit", "f", conf.TempScale == 'F', "Show temperatures in fahrenheit.Show temperatures in fahrenheit.") - opflag.BoolVarP(&conf.Statusbar, "statusbar", "s", conf.Statusbar, "Show a statusbar with the time.") - opflag.DurationVarP(&conf.UpdateInterval, "rate", "r", conf.UpdateInterval, "Refresh frequency. Most time units accepted. `1m` = refresh every minute. `100ms` = refresh every 100ms.") - opflag.StringVarP(&conf.Layout, "layout", "l", conf.Layout, `Name of layout spec file for the UI. Use "-" to pipe.`) - opflag.StringVarP(&conf.NetInterface, "interface", "i", "all", "Select network interface. Several interfaces can be defined using comma separated values. Interfaces can also be ignored using `!`") - opflag.StringVarP(&conf.ExportPort, "export", "x", conf.ExportPort, "Enable metrics for export on the specified port.") - opflag.BoolVarP(&conf.Mbps, "mbps", "", conf.Mbps, "Show network rate as mbps.") - // FIXME Where did this go?? - //conf.Band = opflag.IntP("bandwidth", "B", 100, "Specify the number of bits per seconds.") - opflag.BoolVar(&conf.Test, "test", conf.Test, "Runs tests and exits with success/failure code.") - opflag.StringP("", "C", "", "Config file to use instead of default (MUST BE FIRST ARGUMENT)") - list := opflag.String("list", "", `List - devices: Prints out device names for filterable widgets - layouts: Lists build-in layouts - colorschemes: Lists built-in colorschemes - paths: List out configuration file search paths - widgets: Widgets that can be used in a layout - keys: Show the keyboard bindings.`) - wc := opflag.Bool("write-config", false, "Write out a default config file.") + help := opflag.BoolP("help", "h", false, tr.Value("args.help")) + color := opflag.StringP("color", "c", conf.Colorscheme.Name, tr.Value("args.color")) + opflag.IntVarP(&conf.GraphHorizontalScale, "graphscale", "S", conf.GraphHorizontalScale, tr.Value("args.scale")) + version := opflag.BoolP("version", "v", false, tr.Value("args.version")) + versioN := opflag.BoolP("", "V", false, tr.Value("args.version")) + opflag.BoolVarP(&conf.PercpuLoad, "percpu", "p", conf.PercpuLoad, tr.Value("args.percpu")) + opflag.BoolVarP(&conf.AverageLoad, "averagecpu", "a", conf.AverageLoad, tr.Value("args.cpuavg")) + fahrenheit := opflag.BoolP("fahrenheit", "f", conf.TempScale == 'F', tr.Value("args.temp")) + opflag.BoolVarP(&conf.Statusbar, "statusbar", "s", conf.Statusbar, tr.Value("args.statusbar")) + opflag.DurationVarP(&conf.UpdateInterval, "rate", "r", conf.UpdateInterval, tr.Value("args.rate")) + opflag.StringVarP(&conf.Layout, "layout", "l", conf.Layout, tr.Value("args.layout")) + opflag.StringVarP(&conf.NetInterface, "interface", "i", "all", tr.Value("args.net")) + opflag.StringVarP(&conf.ExportPort, "export", "x", conf.ExportPort, tr.Value("args.export")) + opflag.BoolVarP(&conf.Mbps, "mbps", "", conf.Mbps, tr.Value("args.mbps")) + opflag.BoolVar(&conf.Test, "test", conf.Test, tr.Value("args.test")) + opflag.StringP("", "C", "", tr.Value("args.conffile")) + list := opflag.String("list", "", tr.Value("args.list")) + wc := opflag.Bool("write-config", false, tr.Value("args.write")) opflag.SortFlags = false opflag.Usage = func() { - fmt.Fprintf(os.Stderr, "Usage: %s [options]\n\nOptions:\n", os.Args[0]) + fmt.Fprintf(os.Stderr, tr.Value("usage", os.Args[0])) opflag.PrintDefaults() } opflag.Parse() @@ -115,13 +111,14 @@ func parseArgs() error { case "colorschemes": fmt.Println(_colorschemes) case "paths": - fmt.Println("Loadable colorschemes & layouts, and the config file, are searched for, in order:") + fmt.Println(tr.Value("help.paths")) paths := make([]string, 0) for _, d := range conf.ConfigDir.QueryFolders(configdir.All) { paths = append(paths, d.Path) } fmt.Println(strings.Join(paths, "\n")) - fmt.Printf("\nThe log file is in %s\n", filepath.Join(conf.ConfigDir.QueryCacheFolder().Path, logging.LOGFILE)) + fmt.Println() + fmt.Println(tr.Value("help.log", filepath.Join(conf.ConfigDir.QueryCacheFolder().Path, logging.LOGFILE))) case "devices": listDevices() case "keys": @@ -129,7 +126,7 @@ func parseArgs() error { case "widgets": fmt.Println(_widgets) default: - fmt.Printf("Unknown option \"%s\"; try layouts, colorschemes, keys, paths, or devices\n", *list) + fmt.Printf(tr.Value("errors.unknownopt", *list)) os.Exit(1) } os.Exit(0) @@ -137,10 +134,10 @@ func parseArgs() error { if *wc { path, err := conf.Write() if err != nil { - fmt.Printf("Failed to write configuration file: %s\n", err) + fmt.Println(tr.Value("errors.writefail", err.Error())) os.Exit(1) } - fmt.Printf("Config written to %s\n", path) + fmt.Println(tr.Value("help.written", path)) os.Exit(0) } return nil @@ -348,38 +345,53 @@ func main() { ec := run() if ec > 0 { if ec < 2 { - fmt.Printf("errors encountered; check the log file %s\n", filepath.Join(conf.ConfigDir.QueryCacheFolder().Path, logging.LOGFILE)) + logpath := filepath.Join(conf.ConfigDir.QueryCacheFolder().Path, logging.LOGFILE) + fmt.Println(tr.Value("errors.checklog", logpath)) + fmt.Println(ioutil.ReadFile(logpath)) } } os.Exit(ec) } func run() int { + ling, err := lingo.New("en_US", "translations", nil) + if err != nil { + fmt.Printf("failed to load language files: %s\n", err) + return 2 + } + lang, err := jj.DetectIETF() + if err != nil { + fmt.Printf("failed to get language setting from environment: %s\n", err) + return 2 + } + lang = strings.Replace(lang, "-", "_", -1) + // Get the locale from the os + tr = ling.TranslationsForLocale(lang) conf = gotop.NewConfig() // Find the config file; look in (1) local, (2) user, (3) global // Check the last argument first fs := flag.NewFlagSet("config", flag.ContinueOnError) - cfg := fs.String("C", "", "Config file") + cfg := fs.String("C", "", tr.Value("configfile")) fs.SetOutput(bufio.NewWriter(nil)) fs.Parse(os.Args[1:]) if *cfg != "" { conf.ConfigFile = *cfg } - err := conf.Load() + err = conf.Load() if err != nil { - fmt.Printf("failed to parse config file: %s\n", err) + fmt.Println(tr.Value("errors.configparse", err.Error())) return 2 } // Override with command line arguments err = parseArgs() if err != nil { - fmt.Printf("parsing CLI args: %s\n", err) + fmt.Println(tr.Value("errors.cliparse", err.Error())) return 2 } logfile, err := logging.New(conf) if err != nil { - fmt.Printf("failed to setup log file: %v\n", err) + fmt.Println(tr.Value("logsetup", err.Error())) return 2 } defer logfile.Close() diff --git a/go.mod b/go.mod index 975ca3d..5fbdd2d 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,7 @@ module github.com/xxxserxxx/gotop/v4 require ( github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect + github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 github.com/distatus/battery v0.9.0 github.com/docopt/docopt.go v0.0.0-20180111231733-ee0de3bc6815 github.com/gizak/termui/v3 v3.0.0 @@ -14,6 +15,7 @@ require ( github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect github.com/stretchr/testify v1.4.0 github.com/xxxserxxx/iSMC v1.0.1 + github.com/xxxserxxx/lingo v1.0.1 github.com/xxxserxxx/opflag v1.0.5 golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a // indirect golang.org/x/tools v0.0.0-20200425043458-8463f397d07c // indirect diff --git a/go.sum b/go.sum index 2e2c454..5a3f852 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,8 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cjbassi/drawille-go v0.0.0-20190126131713-27dc511fe6fd h1:XtfPmj9tQRilnrEmI1HjQhxXWRhEM+m8CACtaMJE/kM= github.com/cjbassi/drawille-go v0.0.0-20190126131713-27dc511fe6fd/go.mod h1:vjcQJUZJYD3MeVGhtZXSMnCHfUNZxsyYzJt90eCYxK4= +github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 h1:Yg2hDs4b13Evkpj42FU2idX2cVXVFqQSheXYKM86Qsk= +github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21/go.mod h1:MgJyK38wkzZbiZSKeIeFankxxSA8gayko/nr5x5bgBA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -40,6 +42,8 @@ github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/jdkeke142/lingo-toml v0.0.0-20181017194727-b6051718cb18 h1:LBrIpegfXvxuUKys1QUbjkStyoQgOMocUu2MFcKXHek= +github.com/jdkeke142/lingo-toml v0.0.0-20181017194727-b6051718cb18/go.mod h1:jOyiHA3tuXflvGIObzfVCShTPCceouP/e6aTo6fvi3s= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -115,6 +119,10 @@ github.com/xxxserxxx/gotop/v3 v3.5.1 h1:aBf++Oxg7qCZpKqYpPPnXKFOxT1KYLPtiEXRh57y github.com/xxxserxxx/gotop/v3 v3.5.1/go.mod h1:DGPTiAmUhqE21xvokK64BuMxW+EmnOptaxpdOlqiH6s= github.com/xxxserxxx/iSMC v1.0.1 h1:M9Gkwnnkl+evvnugoB5yRYrbUP+cRIVOPM+xrHZc3Hs= github.com/xxxserxxx/iSMC v1.0.1/go.mod h1:TGgNjU7BF2DZSuxiTft+BdzxzcujFJYqFfMCzcTl/aY= +github.com/xxxserxxx/lingo v1.0.1 h1:lPexOb0HEqYB50EaJdjaYFNATT8JhTcXljbQmCuXygE= +github.com/xxxserxxx/lingo v1.0.1/go.mod h1:C2teIFiBLAmEhpLzRkwk7wP5R0eOoveXVYqD+5KOkAs= +github.com/xxxserxxx/lingo-toml v0.0.0-20181017194727-b6051718cb18 h1:e00RDq5Gm5m22IuDG9/A7yF6AjAzoKbmQ+viQw5MUmI= +github.com/xxxserxxx/lingo-toml v0.0.0-20181017194727-b6051718cb18/go.mod h1:QStBWvZx2oKk5HLYs3xrxAFvCdn8poBdB4uhZTF6yrw= github.com/xxxserxxx/opflag v1.0.0 h1:NabxbubvejqcdzQUHnsU8pBMAiWM+a/Rh2IJe56moiU= github.com/xxxserxxx/opflag v1.0.0/go.mod h1:Zf9bGkOcA35ypGfN25KX0iujVpZB5XwauEFjcfSKcBo= github.com/xxxserxxx/opflag v1.0.2 h1:TanW4Ck/RNal4fP2VVAvhEu7eBq4z+9hhGq9Q8OTq68= diff --git a/translations/de_DE.toml b/translations/de_DE.toml new file mode 100644 index 0000000..4633352 --- /dev/null +++ b/translations/de_DE.toml @@ -0,0 +1,44 @@ +configfile="Config file" +usage="Usage: {0} [options]\n\nOptions:\n" + + +[help] +paths="Loadable colorschemes & layouts, and the config file, are searched for, in order:" +log="The log file is in {0}" +written="Config written to {0}" + + +[args] +help="Hilfetext anzeigen." +color="Ein Farbschema feststellen." +scale="Stellen den Skalierungsfaktor ein, >0" +version="Zeigen die Version aus und beenden." +percpu="Show each CPU in the CPU widget." +cpuavg="Show average CPU in the CPU widget." +temp="Show temperatures in fahrenheit.Show temperatures in fahrenheit." +statusbar="Show a statusbar with the time." +rate="Refresh frequency. Most time units accepted. \"1m\" = refresh every minute. \"100ms\" = refresh every 100ms." +layout="Name of layout spec file for the UI. Use \"-\" to pipe." +net="Select network interface. Several interfaces can be defined using comma separated values. Interfaces can also be ignored using \"!\"" +export="Enable metrics for export on the specified port." +mbps="Show network rate as mbps." +test="Runs tests and exits with success/failure code." +conffile="Config file to use instead of default (MUST BE FIRST ARGUMENT)" +list=""" +List + devices: Prints out device names for filterable widgets + layouts: Lists build-in layouts + colorschemes: Lists built-in colorschemes + paths: List out configuration file search paths + widgets: Widgets that can be used in a layout + keys: Show the keyboard bindings.""" +write="Write out a default config file." + + +[errors] +configparse="failed to parse config file: {0}" +cliparse="parsing CLI args: {0}" +logsetup="failed to setup log file: {0}" +unknownopt="Unknown option \"{0}\"; try layouts, colorschemes, keys, paths, or devices\n" +writefail="Failed to write configuration file: {0}" +checklog="errors encountered; from {0}:" diff --git a/translations/en_US.toml b/translations/en_US.toml new file mode 100644 index 0000000..05cde16 --- /dev/null +++ b/translations/en_US.toml @@ -0,0 +1,44 @@ +configfile="Config file" +usage="Usage: {0} [options]\n\nOptions:\n" + + +[help] +paths="Loadable colorschemes & layouts, and the config file, are searched for, in order:" +log="The log file is in {0}" +written="Config written to {0}" + + +[args] +help="Show this screen." +color="Set a colorscheme." +scale="Graph scale factor, >0" +version="Print version and exit." +percpu="Show each CPU in the CPU widget." +cpuavg="Show average CPU in the CPU widget." +temp="Show temperatures in fahrenheit.Show temperatures in fahrenheit." +statusbar="Show a statusbar with the time." +rate="Refresh frequency. Most time units accepted. \"1m\" = refresh every minute. \"100ms\" = refresh every 100ms." +layout="Name of layout spec file for the UI. Use \"-\" to pipe." +net="Select network interface. Several interfaces can be defined using comma separated values. Interfaces can also be ignored using \"!\"" +export="Enable metrics for export on the specified port." +mbps="Show network rate as mbps." +test="Runs tests and exits with success/failure code." +conffile="Config file to use instead of default (MUST BE FIRST ARGUMENT)" +list=""" +List + devices: Prints out device names for filterable widgets + layouts: Lists build-in layouts + colorschemes: Lists built-in colorschemes + paths: List out configuration file search paths + widgets: Widgets that can be used in a layout + keys: Show the keyboard bindings.""" +write="Write out a default config file." + + +[errors] +configparse="failed to parse config file: {0}" +cliparse="parsing CLI args: {0}" +logsetup="failed to setup log file: {0}" +unknownopt="Unknown option \"{0}\"; try layouts, colorschemes, keys, paths, or devices\n" +writefail="Failed to write configuration file: {0}" +checklog="errors encountered; from {0}:" -- cgit v1.2.3 From 444d2624ab6d5b054446a08ad6888126f9d3494c Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Tue, 5 May 2020 08:13:25 -0500 Subject: More translation work. Incomplete. --- cmd/gotop/main.go | 15 +++++----- translations/en_US.toml | 74 ++++++++++++++++++++++++++++++++++++++++++++----- widgets/battery.go | 12 ++++---- widgets/batterygauge.go | 6 ++-- widgets/cpu.go | 4 +-- widgets/disk.go | 12 ++++---- widgets/help.go | 51 ++++++---------------------------- 7 files changed, 100 insertions(+), 74 deletions(-) diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go index 7459a97..d1cffaa 100644 --- a/cmd/gotop/main.go +++ b/cmd/gotop/main.go @@ -30,7 +30,6 @@ import ( "github.com/xxxserxxx/gotop/v4/devices" "github.com/xxxserxxx/gotop/v4/layout" "github.com/xxxserxxx/gotop/v4/logging" - "github.com/xxxserxxx/gotop/v4/widgets" w "github.com/xxxserxxx/gotop/v4/widgets" ) @@ -122,11 +121,11 @@ func parseArgs() error { case "devices": listDevices() case "keys": - fmt.Println(widgets.KEYBINDS) + fmt.Println(tr.Value("widget.help")) case "widgets": fmt.Println(_widgets) default: - fmt.Printf(tr.Value("errors.unknownopt", *list)) + fmt.Printf(tr.Value("error.unknownopt", *list)) os.Exit(1) } os.Exit(0) @@ -134,7 +133,7 @@ func parseArgs() error { if *wc { path, err := conf.Write() if err != nil { - fmt.Println(tr.Value("errors.writefail", err.Error())) + fmt.Println(tr.Value("error.writefail", err.Error())) os.Exit(1) } fmt.Println(tr.Value("help.written", path)) @@ -346,7 +345,7 @@ func main() { if ec > 0 { if ec < 2 { logpath := filepath.Join(conf.ConfigDir.QueryCacheFolder().Path, logging.LOGFILE) - fmt.Println(tr.Value("errors.checklog", logpath)) + fmt.Println(tr.Value("error.checklog", logpath)) fmt.Println(ioutil.ReadFile(logpath)) } } @@ -379,13 +378,13 @@ func run() int { } err = conf.Load() if err != nil { - fmt.Println(tr.Value("errors.configparse", err.Error())) + fmt.Println(tr.Value("error.configparse", err.Error())) return 2 } // Override with command line arguments err = parseArgs() if err != nil { - fmt.Println(tr.Value("errors.cliparse", err.Error())) + fmt.Println(tr.Value("error.cliparse", err.Error())) return 2 } @@ -422,7 +421,7 @@ func run() int { defer ui.Close() setDefaultTermuiColors(conf) // done before initializing widgets to allow inheriting colors - help = w.NewHelpMenu() + help = w.NewHelpMenu(tr) if statusbar { bar = w.NewStatusBar() } diff --git a/translations/en_US.toml b/translations/en_US.toml index 05cde16..bd66458 100644 --- a/translations/en_US.toml +++ b/translations/en_US.toml @@ -35,10 +35,70 @@ List write="Write out a default config file." -[errors] -configparse="failed to parse config file: {0}" -cliparse="parsing CLI args: {0}" -logsetup="failed to setup log file: {0}" -unknownopt="Unknown option \"{0}\"; try layouts, colorschemes, keys, paths, or devices\n" -writefail="Failed to write configuration file: {0}" -checklog="errors encountered; from {0}:" +[error] +configparse="0: failed to parse config file: {0}" +cliparse="1: parsing CLI args: {0}" +logsetup="2: failed to setup log file: {0}" +unknownopt="3: Unknown option \"{0}\"; try layouts, colorschemes, keys, paths, or devices\n" +writefail="4: Failed to write configuration file: {0}" +checklog="5: errors encountered; from {0}:" +metricsetup="6: error setting up {0} metrics: {1}" +nometrics="7: no metrics for {0} {0}" +fatalfetch="8: fatal error fetching {0} info: {1}" +recovfetch="9: recoverable error fetching {0} info; skipping {0}: {0}" +nodevfound="10: no usable {0} found" +setuperr="11: error setting up {0}: {1}" + + +[widget] +disk=" Disk Usage " +cpu=" CPU Usage " +gauge=" Power Level " +battery=" Battery Status " +batt= +help=""" +Quit: q or + +Process navigation: + - k and : up + - j and : down + - : half page up + - : half page down + - : full page up + - : full page down + - gg and : jump to top + - G and : jump to bottom + +Process actions: + - : toggle process grouping + - dd: kill selected process or group of processes with SIGTERM (15) + - d3: kill selected process or group of processes with SIGQUIT (3) + - d9: kill selected process or group of processes with SIGKILL (9) + +Process sorting: + - c: CPU + - m: Mem + - p: PID + +Process filtering: + - /: start editing filter + - (while editing): + - : accept filter + - and : clear filter + +CPU and Mem graph scaling: + - h: scale in + - l: scale out + +Network: + - b: toggle between mbps and scaled bytes per second +""" + + +[widget.disk] +disk="Disk" +mount="Mount" +used="Used" +free="Free" +rs="R/s" +ws="W/s" diff --git a/widgets/battery.go b/widgets/battery.go index 7167668..dc21d60 100644 --- a/widgets/battery.go +++ b/widgets/battery.go @@ -24,7 +24,7 @@ func NewBatteryWidget(horizontalScale int) *BatteryWidget { LineGraph: ui.NewLineGraph(), updateInterval: time.Minute, } - self.Title = " Battery Status " + self.Title = tr.Value("widget.battery") self.HorizontalScale = horizontalScale // intentional duplicate @@ -46,7 +46,7 @@ func NewBatteryWidget(horizontalScale int) *BatteryWidget { func (b *BatteryWidget) EnableMetric() { bats, err := battery.GetAll() if err != nil { - log.Printf("error setting up metrics: %v", err) + log.Printf(tr.Value("error.metricsetup", "batt", err.Error())) return } b.metric = make([]prometheus.Gauge, len(bats)) @@ -63,7 +63,7 @@ func (b *BatteryWidget) EnableMetric() { } func makeID(i int) string { - return "Batt" + strconv.Itoa(i) + return tr.Value("widget.batt") + strconv.Itoa(i) } func (b *BatteryWidget) Scale(i int) { @@ -75,7 +75,7 @@ func (b *BatteryWidget) update() { if err != nil { switch errt := err.(type) { case battery.ErrFatal: - log.Printf("fatal error fetching battery info: %v", err) + log.Printf(tr.Value("error.fatalfetch", "batt", err.Error())) return case battery.Errors: batts := make([]*battery.Battery, 0) @@ -83,11 +83,11 @@ func (b *BatteryWidget) update() { if e == nil { batts = append(batts, batteries[i]) } else { - log.Printf("recoverable error fetching battery info; skipping battery: %v", e) + log.Printf(tr.Value("error.recovfetch"), "batt", e.Error()) } } if len(batts) < 1 { - log.Print("no usable batteries found") + log.Print(tr.Value("error.nodevfound", "batt")) return } batteries = batts diff --git a/widgets/batterygauge.go b/widgets/batterygauge.go index 968a63c..bb44e57 100644 --- a/widgets/batterygauge.go +++ b/widgets/batterygauge.go @@ -19,7 +19,7 @@ type BatteryGauge struct { func NewBatteryGauge() *BatteryGauge { self := &BatteryGauge{Gauge: termui.NewGauge()} - self.Title = " Power Level " + self.Title = tr.Value("widget.gauge") self.update() @@ -37,7 +37,7 @@ func NewBatteryGauge() *BatteryGauge { func (b *BatteryGauge) EnableMetric() { bats, err := battery.GetAll() if err != nil { - log.Printf("error setting up metrics: %v", err) + log.Printf(tr.Value("error.metricsetup", "power", err.Error())) return } mx := 0.0 @@ -60,7 +60,7 @@ func (b *BatteryGauge) update() { // FIXME: Getting a lot of these in the logs bats, err := battery.GetAll() if err != nil { - log.Printf("error setting up batteries: %v", err) + log.Printf(tr.Value("error.setup", "power", err.Error())) return } mx := 0.0 diff --git a/widgets/cpu.go b/widgets/cpu.go index 03346bf..8aaad7e 100644 --- a/widgets/cpu.go +++ b/widgets/cpu.go @@ -32,7 +32,7 @@ func NewCPUWidget(updateInterval time.Duration, horizontalScale int, showAverage ShowAverageLoad: showAverageLoad, ShowPerCPULoad: showPerCPULoad, } - self.Title = " CPU Usage " + self.Title = tr.Value("cpu") self.HorizontalScale = horizontalScale if !(self.ShowAverageLoad || self.ShowPerCPULoad) { @@ -129,7 +129,7 @@ func (cpu *CPUWidget) update() { cpu.Labels[key] = fmt.Sprintf("%d%%", percent) if cpu.metric != nil { if cpu.metric[key] == nil { - log.Printf("no metrics for %s", key) + log.Printf(tr.Value("error.nometrics", "cpu", key)) } else { cpu.metric[key].Set(float64(percent)) } diff --git a/widgets/disk.go b/widgets/disk.go index 0c86dc9..dd79832 100644 --- a/widgets/disk.go +++ b/widgets/disk.go @@ -38,8 +38,8 @@ func NewDiskWidget() *DiskWidget { updateInterval: time.Second, Partitions: make(map[string]*Partition), } - self.Title = " Disk Usage " - self.Header = []string{"Disk", "Mount", "Used", "Free", "R/s", "W/s"} + self.Title = tr.Value("widget.disk") + self.Header = []string{tr.Value("disk.disk"), tr.Value("disk.mount"), tr.Value("disk.used"), tr.Value("disk.free"), tr.Value("disk.rs"), tr.Value("disk.ws")} self.ColGap = 2 self.ColResizer = func() { self.ColWidths = []int{ @@ -80,7 +80,7 @@ func (disk *DiskWidget) EnableMetric() { func (disk *DiskWidget) update() { partitions, err := psDisk.Partitions(false) if err != nil { - log.Printf("failed to get disk partitions from gopsutil: %v", err) + log.Printf(tr.Value("error.setup", "disk-partitions", err.Error())) return } @@ -125,7 +125,7 @@ func (disk *DiskWidget) update() { for _, partition := range disk.Partitions { usage, err := psDisk.Usage(partition.MountPoint) if err != nil { - log.Printf("failed to get partition usage statistics from gopsutil: %v. partition: %v", err, partition) + log.Printf(tr.Value("error.recovfetch", "partition-"+partition.MountPoint+"-usage", err.Error())) continue } partition.UsedPercent = uint32(usage.UsedPercent + 0.5) @@ -134,7 +134,7 @@ func (disk *DiskWidget) update() { ioCounters, err := psDisk.IOCounters(partition.Device) if err != nil { - log.Printf("failed to get partition read/write info from gopsutil: %v. partition: %v", err, partition) + log.Printf(tr.Value("error.recovfetch", "partition-"+partition.Device+"-rw", err.Error())) continue } ioCounter := ioCounters[strings.Replace(partition.Device, "/dev/", "", -1)] @@ -176,7 +176,7 @@ func (disk *DiskWidget) update() { disk.Rows[i][5] = partition.BytesWrittenRecently if disk.metric != nil { if disk.metric[key] == nil { - log.Printf("ERROR: missing metric %s", key) + log.Printf(tr.Value("error.nometrics", "disk", key)) } else { disk.metric[key].Set(float64(partition.UsedPercent) / 100.0) } diff --git a/widgets/help.go b/widgets/help.go index a2c38e4..fff71a7 100644 --- a/widgets/help.go +++ b/widgets/help.go @@ -5,52 +5,19 @@ import ( "strings" ui "github.com/gizak/termui/v3" + "github.com/xxxserxxx/lingo" ) -// KEYBINDS is the help text for the in-program shortcuts -const KEYBINDS = ` -Quit: q or - -Process navigation: - - k and : up - - j and : down - - : half page up - - : half page down - - : full page up - - : full page down - - gg and : jump to top - - G and : jump to bottom - -Process actions: - - : toggle process grouping - - dd: kill selected process or group of processes with SIGTERM (15) - - d3: kill selected process or group of processes with SIGQUIT (3) - - d9: kill selected process or group of processes with SIGKILL (9) - -Process sorting: - - c: CPU - - m: Mem - - p: PID - -Process filtering: - - /: start editing filter - - (while editing): - - : accept filter - - and : clear filter - -CPU and Mem graph scaling: - - h: scale in - - l: scale out - -Network: - - b: toggle between mbps and scaled bytes per second -` +var tr lingo.Translations +var keyBinds string type HelpMenu struct { ui.Block } -func NewHelpMenu() *HelpMenu { +func NewHelpMenu(tra lingo.Translations) *HelpMenu { + tr = tra + keyBinds = tr.Value("widgets.help") return &HelpMenu{ Block: *ui.NewBlock(), } @@ -58,12 +25,12 @@ func NewHelpMenu() *HelpMenu { func (help *HelpMenu) Resize(termWidth, termHeight int) { textWidth := 53 - for _, line := range strings.Split(KEYBINDS, "\n") { + for _, line := range strings.Split(keyBinds, "\n") { if textWidth < len(line) { textWidth = len(line) + 2 } } - textHeight := strings.Count(KEYBINDS, "\n") + 1 + textHeight := strings.Count(keyBinds, "\n") + 1 x := (termWidth - textWidth) / 2 y := (termHeight - textHeight) / 2 @@ -73,7 +40,7 @@ func (help *HelpMenu) Resize(termWidth, termHeight int) { func (help *HelpMenu) Draw(buf *ui.Buffer) { help.Block.Draw(buf) - for y, line := range strings.Split(KEYBINDS, "\n") { + for y, line := range strings.Split(keyBinds, "\n") { for x, rune := range line { buf.SetCell( ui.NewCell(rune, ui.Theme.Default), -- cgit v1.2.3 From b6b75415247f23fda5c91db2d8065e045c97b625 Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Thu, 18 Jun 2020 19:51:01 -0500 Subject: Expand translations --- cmd/gotop/main.go | 3 +- go.mod | 2 +- go.sum | 2 + translations/de_DE.toml | 95 ++++++++++++++++++++++++++++++++- translations/en_US.toml | 65 +++++++++++++++++------ translations/tt_TT.toml | 137 ++++++++++++++++++++++++++++++++++++++++++++++++ translations/zh_CN.toml | 125 +++++++++++++++++++++++++++++++++++++------ widgets/battery.go | 4 +- widgets/batterygauge.go | 2 +- widgets/cpu.go | 2 +- widgets/disk.go | 2 +- widgets/mem.go | 2 +- widgets/net.go | 14 ++--- widgets/proc.go | 17 +++--- widgets/proc_linux.go | 8 +-- widgets/proc_other.go | 8 +-- widgets/proc_windows.go | 8 +-- widgets/temp.go | 2 +- 18 files changed, 432 insertions(+), 66 deletions(-) create mode 100644 translations/tt_TT.toml diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go index da4ee41..5feb075 100644 --- a/cmd/gotop/main.go +++ b/cmd/gotop/main.go @@ -346,7 +346,8 @@ func main() { if ec < 2 { logpath := filepath.Join(conf.ConfigDir.QueryCacheFolder().Path, logging.LOGFILE) fmt.Println(tr.Value("error.checklog", logpath)) - fmt.Println(ioutil.ReadFile(logpath)) + bs, _ := ioutil.ReadFile(logpath) + fmt.Println(string(bs)) } } os.Exit(ec) diff --git a/go.mod b/go.mod index e708845..a8433f9 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/xxxserxxx/gotop/v4 require ( - github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/VictoriaMetrics/metrics v1.11.2 + github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 github.com/distatus/battery v0.9.0 github.com/gizak/termui/v3 v3.1.0 github.com/go-ole/go-ole v1.2.4 // indirect diff --git a/go.sum b/go.sum index d92f6cc..17ea783 100644 --- a/go.sum +++ b/go.sum @@ -43,6 +43,8 @@ github.com/xxxserxxx/opflag v1.0.5 h1:2H4Qtl1qe+dSkEcGt+fBe2mQ8z14MgkWPqcLaoa6k9 github.com/xxxserxxx/opflag v1.0.5/go.mod h1:GWZtb3/tGGj5W1GE/JTyJAuqgxDxl1+jqDGAGM+P/p4= golang.org/x/sys v0.0.0-20200316230553-a7d97aace0b0 h1:4Khi5GeNOkZS5DqSBRn4Sy7BE6GuxwOqARPqfurkdNk= golang.org/x/sys v0.0.0-20200316230553-a7d97aace0b0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/translations/de_DE.toml b/translations/de_DE.toml index 4633352..06fac94 100644 --- a/translations/de_DE.toml +++ b/translations/de_DE.toml @@ -1,5 +1,6 @@ configfile="Config file" usage="Usage: {0} [options]\n\nOptions:\n" +total="Total" [help] @@ -35,10 +36,102 @@ List write="Write out a default config file." -[errors] +[error] configparse="failed to parse config file: {0}" cliparse="parsing CLI args: {0}" logsetup="failed to setup log file: {0}" unknownopt="Unknown option \"{0}\"; try layouts, colorschemes, keys, paths, or devices\n" writefail="Failed to write configuration file: {0}" checklog="errors encountered; from {0}:" +metricsetup="error setting up {0} metrics: {1}" +nometrics="no metrics for {0} {0}" +fatalfetch="fatal error fetching {0} info: {1}" +recovfetch="recoverable error fetching {0} info; skipping {0}: {0}" +nodevfound="no usable {0} found" +setuperr="error setting up {0}: {1}" + + +[widget.label] +disk=" Disk Usage " +cpu=" CPU Usage " +gauge=" Power Level " +battery=" Battery Status " +batt=" Battery " +temp=" Temperatures " +net=" Network Usage " +netint=" Network Usage: {0} " +mem=" Memory Usage " +help=""" +Quit: q or + +Process navigation: + - k and : up + - j and : down + - : half page up + - : half page down + - : full page up + - : full page down + - gg and : jump to top + - G and : jump to bottom + +Process actions: + - : toggle process grouping + - dd: kill selected process or group of processes with SIGTERM (15) + - d3: kill selected process or group of processes with SIGQUIT (3) + - d9: kill selected process or group of processes with SIGKILL (9) + +Process sorting: + - c: CPU + - m: Mem + - p: PID + +Process filtering: + - /: start editing filter + - (while editing): + - : accept filter + - and : clear filter + +CPU and Mem graph scaling: + - h: scale in + - l: scale out + +Network: + - b: toggle between mbps and scaled bytes per second +""" + + +[widget.net.err] +netactivity="failed to get network activity from gopsutil: {0}" +negvalrecv="error: negative value for recently received network data from gopsutil. recentBytesRecv: {0}" +negvalsent="error: negative value for recently sent network data from gopsutil. recentBytesSent: {0}" + + +[widget.disk] +disk="Disk" +mount="Mount" +used="Used" +free="Free" +rs="R/s" +ws="W/s" + + +[widget.proc] +filter=" Filter: " +label=" Processes " +[widget.proc.header] +count="Count" +command="Command" +cpu="CPU%" +mem="Mem%" +pid="PID" +[widget.proc.err] +count="failed to get CPU count from gopsutil: {0}" +retrieve="failed to retrieve processes: {0}" +ps="failed to execute 'ps' command: {0}" +gopsutil="failed to get processes from gopsutil: {0}" +pidconv="failed to convert PID to int: {0}. line: {1}" +cpuconv="failed to convert CPU usage to float: {0}. line: {1}" +memconv="failed to convert Mem usage to float: {0}. line: {1}" +getcmd="failed to get process command from gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" +cpupercent="failed to get process cpu usage from gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" +mempercent="failed to get process memeory usage from gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" diff --git a/translations/en_US.toml b/translations/en_US.toml index bd66458..4b56c84 100644 --- a/translations/en_US.toml +++ b/translations/en_US.toml @@ -1,5 +1,6 @@ configfile="Config file" usage="Usage: {0} [options]\n\nOptions:\n" +total="Total" [help] @@ -36,26 +37,30 @@ write="Write out a default config file." [error] -configparse="0: failed to parse config file: {0}" -cliparse="1: parsing CLI args: {0}" -logsetup="2: failed to setup log file: {0}" -unknownopt="3: Unknown option \"{0}\"; try layouts, colorschemes, keys, paths, or devices\n" -writefail="4: Failed to write configuration file: {0}" -checklog="5: errors encountered; from {0}:" -metricsetup="6: error setting up {0} metrics: {1}" -nometrics="7: no metrics for {0} {0}" -fatalfetch="8: fatal error fetching {0} info: {1}" -recovfetch="9: recoverable error fetching {0} info; skipping {0}: {0}" -nodevfound="10: no usable {0} found" -setuperr="11: error setting up {0}: {1}" - - -[widget] +configparse="failed to parse config file: {0}" +cliparse="parsing CLI args: {0}" +logsetup="failed to setup log file: {0}" +unknownopt="Unknown option \"{0}\"; try layouts, colorschemes, keys, paths, or devices\n" +writefail="Failed to write configuration file: {0}" +checklog="errors encountered; from {0}:" +metricsetup="error setting up {0} metrics: {1}" +nometrics="no metrics for {0} {0}" +fatalfetch="fatal error fetching {0} info: {1}" +recovfetch="recoverable error fetching {0} info; skipping {0}: {0}" +nodevfound="no usable {0} found" +setuperr="error setting up {0}: {1}" + + +[widget.label] disk=" Disk Usage " cpu=" CPU Usage " gauge=" Power Level " battery=" Battery Status " -batt= +batt=" Battery " +temp=" Temperatures " +net=" Network Usage " +netint=" Network Usage: {0} " +mem=" Memory Usage " help=""" Quit: q or @@ -95,6 +100,12 @@ Network: """ +[widget.net.err] +netactivity="failed to get network activity from gopsutil: {0}" +negvalrecv="error: negative value for recently received network data from gopsutil. recentBytesRecv: {0}" +negvalsent="error: negative value for recently sent network data from gopsutil. recentBytesSent: {0}" + + [widget.disk] disk="Disk" mount="Mount" @@ -102,3 +113,25 @@ used="Used" free="Free" rs="R/s" ws="W/s" + + +[widget.proc] +filter=" Filter: " +label=" Processes " +[widget.proc.header] +count="Count" +command="Command" +cpu="CPU%" +mem="Mem%" +pid="PID" +[widget.proc.err] +count="failed to get CPU count from gopsutil: {0}" +retrieve="failed to retrieve processes: {0}" +ps="failed to execute 'ps' command: {0}" +gopsutil="failed to get processes from gopsutil: {0}" +pidconv="failed to convert PID to int: {0}. line: {1}" +cpuconv="failed to convert CPU usage to float: {0}. line: {1}" +memconv="failed to convert Mem usage to float: {0}. line: {1}" +getcmd="failed to get process command from gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" +cpupercent="failed to get process cpu usage from gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" +mempercent="failed to get process memeory usage from gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" diff --git a/translations/tt_TT.toml b/translations/tt_TT.toml new file mode 100644 index 0000000..dc5c737 --- /dev/null +++ b/translations/tt_TT.toml @@ -0,0 +1,137 @@ +configfile="CFG FLE" +usage="egasU: {0} [snoitpo]\n\nsnoitpO:\n" +total="latoT" + + +[help] +paths="redro ni ,rof dehcraes era ,elif gifnoc eht dna ,stuoyal & semehcsroloc elbadaoL:" +log="ni si elif gol ehT {0}" +written="ot nettirw gifnoC {0}" + + +[args] +help=".neercs siht wohS" +color=".emehcsroloc a teS" +scale="0> ,rotcaf elacs hparG" +version=".tixe dna noisrev tnirP" +percpu=".tegdiw UPC eht ni UPC hcae wohS" +cpuavg=".tegdiw UPC eht ni UPC egareva wohS" +temp=".tiehnerhaf ni serutarepmet wohS.tiehnerhaf ni serutarepmet wohS" +statusbar=".emit eht htiw rabsutats a wohS" +rate=".sm001 yreve hserfer = \"sm001\" .etunim yreve hserfer = \"m1\" .detpecca stinu emit tsoM .ycneuqerf hserfeR" +layout="Name of layout spec file for the UI. Use \"-\" to pipe." +net="gnisu derongi eb osla nac secafretnI .seulav detarapes ammoc gnisu denifed eb nac secafretni lareveS .ecafretni krowten tceleS \"!\"" +export=".trop deificeps eht no tropxe rof scirtem elbanE" +mbps=".spbm sa etar krowten wohS" +test=".edoc eruliaf/sseccus htiw stixe dna stset snuR" +conffile=")TNEMUGRA TSRIF EB TSUM( tluafed fo daetsni esu ot elif gifnoC" +list=""" +>syek|shtap|semehcsroloc|stuoyal|secived< tsiL +stegdiw elbaretlif rof seman ecived tuo stnirP :secived +stuoyal ni-dliub stsiL :stuoyal +semehcsroloc ni-tliub stsiL :semehcsroloc +shtap hcraes elif noitarugifnoc tuo tsiL :shtap +tuoyal a ni desu eb nac taht stegdiW :stegdiw +.sgnidnib draobyek eht wohS :syek """ +write=".elif gifnoc tluafed a tuo etirW" + + +[error] +configparse="elif gifnoc esrap ot deliaf: {0}" +cliparse="sgra ILC gnisrap: {0}" +logsetup="elif gol putes ot deliaf: {0}" +unknownopt="noitpo nwonknU \"{0}\"; secived ro ,shtap ,syek ,semehcsroloc ,stuoyal yrt\n" +writefail="elif noitarugifnoc etirw ot deliaF: {0}" +checklog="morf ;deretnuocne srorre {0}:" +metricsetup="pu gnittes rorre {0} scirtem: {1}" +nometrics="rof scirtem on {0} {0}" +fatalfetch="gnihctef rorre lataf {0} ofni: {1}" +recovfetch="gnihctef rorre elbarevocer {0} gnippiks ;ofni {0}: {0}" +nodevfound="elbasu on {0} dnuof" +setuperr="pu gnittes rorre {0}: {1}" + + +[widget.label] +disk=" egasU ksiD " +cpu=" egasU UPC " +gauge=" leveL rewoP " +battery=" sutatS yrettaB " +batt=" yrettaB " +temp=" serutarepmeT " +net=" egasU krowteN " +netint=" egasU krowteN: {0} " +mem=" egasU yromeM " +help=""" +>c-C< ro q :tiuQ + +:noitagivan ssecorP +pu :>pU< dna k - +nwod :>nwoD< dna j - +pu egap flah :>u-C< - +nwod egap flah :>d-C< - +pu egap lluf :>b-C< - +nwod egap lluf :>f-C< - +pot ot pmuj :>emoH< dna gg - +mottob ot pmuj :>dnE< dna G - + +:snoitca ssecorP +gnipuorg ssecorp elggot :>baT< - +)51( MRETGIS htiw sessecorp fo puorg ro ssecorp detceles llik :dd - +)3( TIUQGIS htiw sessecorp fo puorg ro ssecorp detceles llik :3d - +)9( LLIKGIS htiw sessecorp fo puorg ro ssecorp detceles llik :9d - + +:gnitros ssecorP +UPC :c - +meM :m - +DIP :p - + +:gniretlif ssecorP +retlif gnitide trats :/ - +:)gnitide elihw( - +retlif tpecca :>retnE< - +retlif raelc :>epacsE< dna >c-C< - + +:gnilacs hparg meM dna UPC +ni elacs :h - +tuo elacs :l - + +:krowteN +dnoces rep setyb delacs dna spbm neewteb elggot :b - +""" + + +[widget.net.err] +netactivity="lituspog morf ytivitca krowten teg ot deliaf: {0}" +negvalrecv=":vceRsetyBtnecer .lituspog morf atad krowten deviecer yltnecer rof eulav evitagen :rorre {0}" +negvalsent=":tneSsetyBtnecer .lituspog morf atad krowten tnes yltnecer rof eulav evitagen :rorre {0}" + + +[widget.disk] +disk="ksiD" +mount="tnuoM" +used="desU" +free="eerF" +rs="s/R" +ws="s/W" + + +[widget.proc] +filter=" :retliF " +label=" sessecorP " +[widget.proc.header] +count="tnuoC" +command="dnammoC" +cpu="%UPC" +mem="%meM" +pid="DIP" +[widget.proc.err] +count=":lituspog morf tnuoc UPC teg ot deliaf {0}" +retrieve=":sessecorp eveirter ot deliaf {0}" +ps=":dnammoc 'sp' etucexe ot deliaf {0}" +gopsutil=":lituspog morf sessecorp teg ot deliaf {0}" +pidconv=":tni ot DIP trevnoc ot deliaf {0}. enil: {1}" +cpuconv=":taolf ot egasu UPC trevnoc ot deliaf {0}. :enil {1}" +memconv=":taolf ot egasu meM trevnoc ot deliaf {0}. :enil {1}" +getcmd=":lituspog morf dnammoc ssecorp teg ot deliaf {0}. corPsp: {1}. i: {2}. dip: {3}" +cpupercent="lituspog morf egasu upc ssecorp teg ot deliaf: {0}. corPsp: {1}. i: {2}. dip: {3}" +mempercent="spog morf egasu yroemem ssecorp teg ot deliafutil: {0}. corPsp: {1}. i: {2}. dip: {3}" diff --git a/translations/zh_CN.toml b/translations/zh_CN.toml index 141df26..aa20367 100644 --- a/translations/zh_CN.toml +++ b/translations/zh_CN.toml @@ -1,5 +1,6 @@ configfile="配置文件" usage="使用方法: {0} [选项]\n\n选项:\n" +total="Total" [help] @@ -26,19 +27,111 @@ test="执行测试并返回成功或失败码。" conffile="用于替代缺省参数的配置文件(必须是第一个参数)" list=""" List - devices: 显示可用于过滤的设备名 - layouts: 列出所有内置布局方案 - colorschemes: 列出所有内置配色方案 - paths: 列出配置文件的搜索路径 - widgets: 所有可被用于布局的组件 - keys: 显示所有热键。""" -write="将当前配置写入缺省配置文件。" - - -[errors] -configparse="无法解析配置文件: {0}" -cliparse="解析命令行参数: {0}" -logsetup="无法创建日志文件: {0}" -unknownopt="不认识 \"{0}\"; 请使用 layouts, colorschemes, keys, paths, 或 devices\n" -writefail="无法写入配置文件: {0}" -checklog="出错了; 位于 {0}:" + devices: Prints out device names for filterable widgets + layouts: Lists build-in layouts + colorschemes: Lists built-in colorschemes + paths: List out configuration file search paths + widgets: Widgets that can be used in a layout + keys: Show the keyboard bindings.""" +write="Write out a default config file." + + +[error] +configparse="failed to parse config file: {0}" +cliparse="parsing CLI args: {0}" +logsetup="failed to setup log file: {0}" +unknownopt="Unknown option \"{0}\"; try layouts, colorschemes, keys, paths, or devices\n" +writefail="Failed to write configuration file: {0}" +checklog="errors encountered; from {0}:" +metricsetup="error setting up {0} metrics: {1}" +nometrics="no metrics for {0} {0}" +fatalfetch="fatal error fetching {0} info: {1}" +recovfetch="recoverable error fetching {0} info; skipping {0}: {0}" +nodevfound="no usable {0} found" +setuperr="error setting up {0}: {1}" + + +[widget.label] +disk=" Disk Usage " +cpu=" CPU Usage " +gauge=" Power Level " +battery=" Battery Status " +batt=" Battery " +temp=" Temperatures " +net=" Network Usage " +netint=" Network Usage: {0} " +mem=" Memory Usage " +help=""" +Quit: q or + +Process navigation: + - k and : up + - j and : down + - : half page up + - : half page down + - : full page up + - : full page down + - gg and : jump to top + - G and : jump to bottom + +Process actions: + - : toggle process grouping + - dd: kill selected process or group of processes with SIGTERM (15) + - d3: kill selected process or group of processes with SIGQUIT (3) + - d9: kill selected process or group of processes with SIGKILL (9) + +Process sorting: + - c: CPU + - m: Mem + - p: PID + +Process filtering: + - /: start editing filter + - (while editing): + - : accept filter + - and : clear filter + +CPU and Mem graph scaling: + - h: scale in + - l: scale out + +Network: + - b: toggle between mbps and scaled bytes per second +""" + + +[widget.net.err] +netactivity="failed to get network activity from gopsutil: {0}" +negvalrecv="error: negative value for recently received network data from gopsutil. recentBytesRecv: {0}" +negvalsent="error: negative value for recently sent network data from gopsutil. recentBytesSent: {0}" + + +[widget.disk] +disk="Disk" +mount="Mount" +used="Used" +free="Free" +rs="R/s" +ws="W/s" + + +[widget.proc] +filter=" Filter: " +label=" Processes " +[widget.proc.header] +count="Count" +command="Command" +cpu="CPU%" +mem="Mem%" +pid="PID" +[widget.proc.err] +count="failed to get CPU count from gopsutil: {0}" +retrieve="failed to retrieve processes: {0}" +ps="failed to execute 'ps' command: {0}" +gopsutil="failed to get processes from gopsutil: {0}" +pidconv="failed to convert PID to int: {0}. line: {1}" +cpuconv="failed to convert CPU usage to float: {0}. line: {1}" +memconv="failed to convert Mem usage to float: {0}. line: {1}" +getcmd="failed to get process command from gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" +cpupercent="failed to get process cpu usage from gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" +mempercent="failed to get process memeory usage from gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" diff --git a/widgets/battery.go b/widgets/battery.go index 7bc9ca6..d8334bb 100644 --- a/widgets/battery.go +++ b/widgets/battery.go @@ -23,7 +23,7 @@ func NewBatteryWidget(horizontalScale int) *BatteryWidget { LineGraph: ui.NewLineGraph(), updateInterval: time.Minute, } - self.Title = tr.Value("widget.battery") + self.Title = tr.Value("widget.label.battery") self.HorizontalScale = horizontalScale // intentional duplicate @@ -60,7 +60,7 @@ func (b *BatteryWidget) EnableMetric() { } func makeID(i int) string { - return tr.Value("widget.batt") + strconv.Itoa(i) + return tr.Value("widget.label.batt") + strconv.Itoa(i) } func (b *BatteryWidget) Scale(i int) { diff --git a/widgets/batterygauge.go b/widgets/batterygauge.go index bec3c43..8dd681e 100644 --- a/widgets/batterygauge.go +++ b/widgets/batterygauge.go @@ -18,7 +18,7 @@ type BatteryGauge struct { func NewBatteryGauge() *BatteryGauge { self := &BatteryGauge{Gauge: termui.NewGauge()} - self.Title = tr.Value("widget.gauge") + self.Title = tr.Value("widget.label.gauge") self.update() diff --git a/widgets/cpu.go b/widgets/cpu.go index 207b231..4d2bc89 100644 --- a/widgets/cpu.go +++ b/widgets/cpu.go @@ -32,7 +32,7 @@ func NewCPUWidget(updateInterval time.Duration, horizontalScale int, showAverage ShowPerCPULoad: showPerCPULoad, cpuLoads: make(map[string]float64), } - self.Title = tr.Value("cpu") + self.Title = tr.Value("widget.label.cpu") self.HorizontalScale = horizontalScale if !(self.ShowAverageLoad || self.ShowPerCPULoad) { diff --git a/widgets/disk.go b/widgets/disk.go index 716e631..67f3bb6 100644 --- a/widgets/disk.go +++ b/widgets/disk.go @@ -37,7 +37,7 @@ func NewDiskWidget() *DiskWidget { updateInterval: time.Second, Partitions: make(map[string]*Partition), } - self.Title = tr.Value("widget.disk") + self.Title = tr.Value("widget.label.disk") self.Header = []string{tr.Value("disk.disk"), tr.Value("disk.mount"), tr.Value("disk.used"), tr.Value("disk.free"), tr.Value("disk.rs"), tr.Value("disk.ws")} self.ColGap = 2 self.ColResizer = func() { diff --git a/widgets/mem.go b/widgets/mem.go index b994276..19656bb 100644 --- a/widgets/mem.go +++ b/widgets/mem.go @@ -21,7 +21,7 @@ func NewMemWidget(updateInterval time.Duration, horizontalScale int) *MemWidget LineGraph: ui.NewLineGraph(), updateInterval: updateInterval, } - widg.Title = " Memory Usage " + widg.Title = tr.Value("widget.label.mem") widg.HorizontalScale = horizontalScale mems := make(map[string]devices.MemoryInfo) devices.UpdateMem(mems) diff --git a/widgets/net.go b/widgets/net.go index b76d6b4..f25f106 100644 --- a/widgets/net.go +++ b/widgets/net.go @@ -47,9 +47,9 @@ func NewNetWidget(netInterface string) *NetWidget { updateInterval: time.Second, NetInterface: strings.Split(netInterface, ","), } - self.Title = " Network Usage " + self.Title = tr.Value("widget.label.net") if netInterface != "all" { - self.Title = fmt.Sprintf(" Network Usage: %s ", netInterface) + self.Title = tr.Value("widget.label.netint", netInterface) } self.update() @@ -73,7 +73,7 @@ func (net *NetWidget) EnableMetric() { func (net *NetWidget) update() { interfaces, err := psNet.IOCounters(true) if err != nil { - log.Printf("failed to get network activity from gopsutil: %v", err) + log.Println(tr.Value("widget.net.err.netactivity", err.Error())) return } @@ -114,12 +114,14 @@ func (net *NetWidget) update() { recentBytesSent = totalBytesSent - net.totalBytesSent if int(recentBytesRecv) < 0 { - log.Printf("error: negative value for recently received network data from gopsutil. recentBytesRecv: %v", recentBytesRecv) + v := fmt.Sprintf("%d", recentBytesRecv) + log.Println(tr.Value("widget.net.err.negvalrecv", v)) // recover from error recentBytesRecv = 0 } if int(recentBytesSent) < 0 { - log.Printf("error: negative value for recently sent network data from gopsutil. recentBytesSent: %v", recentBytesSent) + v := fmt.Sprintf("%d", recentBytesSent) + log.Printf(tr.Value("widget.net.err.negvalsent", v)) // recover from error recentBytesSent = 0 } @@ -160,7 +162,7 @@ func (net *NetWidget) update() { recentConverted, unitRecent = utils.ConvertBytes(recent) } - net.Lines[i].Title1 = fmt.Sprintf(" Total %s: %5.1f %s", label, totalConverted, unitTotal) + net.Lines[i].Title1 = fmt.Sprintf(" %s %s: %5.1f %s", tr.Value("total"), label, totalConverted, unitTotal) net.Lines[i].Title2 = fmt.Sprintf(format, rate, recentConverted, unitRecent) } } diff --git a/widgets/proc.go b/widgets/proc.go index f47f646..ee94825 100644 --- a/widgets/proc.go +++ b/widgets/proc.go @@ -51,7 +51,7 @@ type ProcWidget struct { func NewProcWidget() *ProcWidget { cpuCount, err := psCPU.Counts(false) if err != nil { - log.Printf("failed to get CPU count from gopsutil: %v", err) + log.Println(tr.Value("error.proc.err.count", err.Error())) } self := &ProcWidget{ Table: ui.NewTable(), @@ -63,14 +63,14 @@ func NewProcWidget() *ProcWidget { } self.entry = &ui.Entry{ Style: self.TitleStyle, - Label: " Filter: ", + Label: tr.Value("widget.proc.filter"), Value: "", UpdateCallback: func(val string) { self.filter = val self.update() }, } - self.Title = " Processes " + self.Title = tr.Value("widget.proc.label") self.ShowCursor = true self.ShowLocation = true self.ColGap = 3 @@ -137,7 +137,7 @@ func (proc *ProcWidget) filterProcs(procs []Proc) []Proc { func (proc *ProcWidget) update() { procs, err := getProcs() if err != nil { - log.Printf("failed to retrieve processes: %v", err) + log.Printf(tr.Value("widget.proc.error.retrieve", err.Error())) return } @@ -157,10 +157,15 @@ func (proc *ProcWidget) update() { // sortProcs sorts either the grouped or ungrouped []Process based on the sortMethod. // Called with every update, when the sort method is changed, and when processes are grouped and ungrouped. func (proc *ProcWidget) sortProcs() { - proc.Header = []string{"Count", "Command", "CPU%", "Mem%"} + proc.Header = []string{ + tr.Value("widget.proc.header.count"), + tr.Value("widget.proc.header.command"), + tr.Value("widget.proc.header.cpu"), + tr.Value("widget.proc.header.mem"), + } if !proc.showGroupedProcs { - proc.Header[0] = "PID" + proc.Header[0] = tr.Value("widget.proc.header.pid") } var procs *[]Proc diff --git a/widgets/proc_linux.go b/widgets/proc_linux.go index 164319d..938e5c2 100644 --- a/widgets/proc_linux.go +++ b/widgets/proc_linux.go @@ -11,7 +11,7 @@ import ( func getProcs() ([]Proc, error) { output, err := exec.Command("ps", "-axo", "pid:10,comm:50,pcpu:5,pmem:5,args").Output() if err != nil { - return nil, fmt.Errorf("failed to execute 'ps' command: %v", err) + return nil, fmt.Errorf(tr.Value("widget.proc.err.ps", err.Error())) } // converts to []string, removing trailing newline and header @@ -21,15 +21,15 @@ func getProcs() ([]Proc, error) { for _, line := range linesOfProcStrings { pid, err := strconv.Atoi(strings.TrimSpace(line[0:10])) if err != nil { - log.Printf("failed to convert PID to int: %v. line: %v", err, line) + log.Println(tr.Value("widget.proc.err.pidconv", err.Error(), line)) } cpu, err := strconv.ParseFloat(strings.TrimSpace(line[63:68]), 64) if err != nil { - log.Printf("failed to convert CPU usage to float: %v. line: %v", err, line) + log.Println(tr.Value("widget.proc.err.cpuconv", err.Error(), line)) } mem, err := strconv.ParseFloat(strings.TrimSpace(line[69:74]), 64) if err != nil { - log.Printf("failed to convert Mem usage to float: %v. line: %v", err, line) + log.Println(tr.Value("widget.proc.err.memconv", err.Error(), line)) } proc := Proc{ Pid: pid, diff --git a/widgets/proc_other.go b/widgets/proc_other.go index b761431..a485c4f 100644 --- a/widgets/proc_other.go +++ b/widgets/proc_other.go @@ -23,7 +23,7 @@ func getProcs() ([]Proc, error) { keywords := fmt.Sprintf("pid=%s,comm=%s,pcpu=%s,pmem=%s,args", ten, fifty, five, five) output, err := exec.Command("ps", "-caxo", keywords).Output() if err != nil { - return nil, fmt.Errorf("failed to execute 'ps' command: %v", err) + return nil, fmt.Errorf(tr.Value("widget.proc.err.ps", err.Error())) } // converts to []string and removes the header @@ -33,15 +33,15 @@ func getProcs() ([]Proc, error) { for _, line := range linesOfProcStrings { pid, err := strconv.Atoi(strings.TrimSpace(line[0:10])) if err != nil { - log.Printf("failed to convert first field to int: %v. split: %v", err, line) + log.Println(tr.Value("widget.proc.err.pidconv", err.Error(), line)) } cpu, err := strconv.ParseFloat(utils.ConvertLocalizedString(strings.TrimSpace(line[63:68])), 64) if err != nil { - log.Printf("failed to convert third field to float: %v. split: %v", err, line) + log.Println(tr.Value("widget.proc.err.cpuconv", err.Error(), line)) } mem, err := strconv.ParseFloat(utils.ConvertLocalizedString(strings.TrimSpace(line[69:74])), 64) if err != nil { - log.Printf("failed to convert fourth field to float: %v. split: %v", err, line) + log.Println(tr.Value("widget.proc.err.memconv", err.Error(), line)) } proc := Proc{ Pid: pid, diff --git a/widgets/proc_windows.go b/widgets/proc_windows.go index 56590c7..d34ef5e 100644 --- a/widgets/proc_windows.go +++ b/widgets/proc_windows.go @@ -10,7 +10,7 @@ import ( func getProcs() ([]Proc, error) { psProcs, err := psProc.Processes() if err != nil { - return nil, fmt.Errorf("failed to get processes from gopsutil: %v", err) + return nil, fmt.Errorf(tr.Value("widget.proc.err.gopsutil", err.Error())) } procs := make([]Proc, len(psProcs)) @@ -18,15 +18,15 @@ func getProcs() ([]Proc, error) { pid := psProc.Pid command, err := psProc.Name() if err != nil { - log.Printf("failed to get process command from gopsutil: %v. psProc: %v. i: %v. pid: %v", err, psProc, i, pid) + log.Println(tr.Value("widget.proc.err.getcmd", err, psProc, i, pid)) } cpu, err := psProc.CPUPercent() if err != nil { - log.Printf("failed to get process cpu usage from gopsutil: %v. psProc: %v. i: %v. pid: %v", err, psProc, i, pid) + log.Println(tr.Value("widget.proc.err.cpupercent", err, psProc, i, pid)) } mem, err := psProc.MemoryPercent() if err != nil { - log.Printf("failed to get process memeory usage from gopsutil: %v. psProc: %v. i: %v. pid: %v", err, psProc, i, pid) + log.Println(tr.Value("widget.proc.err.mempercent", err, psProc, i, pid)) } procs[i] = Proc{ diff --git a/widgets/temp.go b/widgets/temp.go index 5a22897..f5632df 100644 --- a/widgets/temp.go +++ b/widgets/temp.go @@ -39,7 +39,7 @@ func NewTempWidget(tempScale TempScale, filter []string) *TempWidget { TempThreshold: 80, TempScale: tempScale, } - self.Title = " Temperatures " + self.Title = tr.Value("widget.label.temp") if len(filter) > 0 { for _, t := range filter { self.Data[t] = 0 -- cgit v1.2.3 From de187a89ae890c219e9baf376d74bc971f43ed28 Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Thu, 18 Jun 2020 20:03:42 -0500 Subject: Added a dummy temperature widget label for testing --- translations/zh_CN.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/translations/zh_CN.toml b/translations/zh_CN.toml index aa20367..4a98186 100644 --- a/translations/zh_CN.toml +++ b/translations/zh_CN.toml @@ -57,7 +57,8 @@ cpu=" CPU Usage " gauge=" Power Level " battery=" Battery Status " batt=" Battery " -temp=" Temperatures " +# INSERTED JUST FOR TEST +temp=" 显示华氏温度。 " net=" Network Usage " netint=" Network Usage: {0} " mem=" Memory Usage " -- cgit v1.2.3 From aa828c579029a707b2cad77c77afa5ee8ebb0648 Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Fri, 19 Jun 2020 10:01:26 -0500 Subject: Translation files are now bundled. --- README.md | 4 + cmd/gotop/main.go | 3 +- config.go | 3 + devices/smc.go | 28 ++- devices/temp.go | 2 - go.mod | 2 +- go.sum | 2 + translations/de_DE.toml | 137 -------------- translations/dicts.go | 404 ++++++++++++++++++++++++++++++++++++++++++ translations/dicts/de_DE.toml | 137 ++++++++++++++ translations/dicts/en_US.toml | 137 ++++++++++++++ translations/dicts/tt_TT.toml | 137 ++++++++++++++ translations/dicts/zh_CN.toml | 138 +++++++++++++++ translations/en_US.toml | 137 -------------- translations/tt_TT.toml | 137 -------------- translations/zh_CN.toml | 138 --------------- 16 files changed, 984 insertions(+), 562 deletions(-) delete mode 100644 translations/de_DE.toml create mode 100644 translations/dicts.go create mode 100644 translations/dicts/de_DE.toml create mode 100644 translations/dicts/en_US.toml create mode 100644 translations/dicts/tt_TT.toml create mode 100644 translations/dicts/zh_CN.toml delete mode 100644 translations/en_US.toml delete mode 100644 translations/tt_TT.toml delete mode 100644 translations/zh_CN.toml diff --git a/README.md b/README.md index b8be2df..fd4a361 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,10 @@ Move `gotop` to somewhere in your `$PATH`. If Go is not installed or is the wrong version, and you don't have root access or don't want to upgrade Go, a script is provided to download Go and the gotop sources, compile gotop, and then clean up. See `scripts/install_without_root.sh`. +#### go generate + +Apple SMC tags are embedded in a text file that is compiled into the executable; the same happens with the language translations. When the file `devices/data/sm.tsv` or any translations in `translations/dicts/` change, `go generate` should be re-run. + ## Usage Run with `-h` to get an extensive list of command line arguments. Many of these can be configured by creating a configuration file; see the next section for more information. Key bindings can be viewed while gotop is running by pressing the `?` key, or they can be printed out by using the `--list keys` command. diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go index 5feb075..5e1cd09 100644 --- a/cmd/gotop/main.go +++ b/cmd/gotop/main.go @@ -30,6 +30,7 @@ import ( "github.com/xxxserxxx/gotop/v4/devices" "github.com/xxxserxxx/gotop/v4/layout" "github.com/xxxserxxx/gotop/v4/logging" + "github.com/xxxserxxx/gotop/v4/translations" w "github.com/xxxserxxx/gotop/v4/widgets" ) @@ -354,7 +355,7 @@ func main() { } func run() int { - ling, err := lingo.New("en_US", "translations", nil) + ling, err := lingo.New("en_US", "translations", translations.AssetFile()) if err != nil { fmt.Printf("failed to load language files: %s\n", err) return 2 diff --git a/config.go b/config.go index 5da6f32..16f053c 100644 --- a/config.go +++ b/config.go @@ -1,5 +1,8 @@ package gotop +//go:generate go-bindata -fs -pkg translations -prefix translations -o translations/dicts.go translations/dicts +//go:generate go-bindata -pkg devices -prefix devices/data -o devices/smc.go devices/data + import ( "bufio" "bytes" diff --git a/devices/smc.go b/devices/smc.go index 4701a07..21931c4 100644 --- a/devices/smc.go +++ b/devices/smc.go @@ -1,8 +1,7 @@ -// Code generated by go-bindata. -// sources: -// data/smc.tsv -// DO NOT EDIT! +// Code generated by go-bindata. (@generated) DO NOT EDIT. + //Package devices generated by go-bindata.// sources: +// devices/data/smc.tsv package devices import ( @@ -20,7 +19,7 @@ import ( func bindataRead(data []byte, name string) ([]byte, error) { gz, err := gzip.NewReader(bytes.NewBuffer(data)) if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) + return nil, fmt.Errorf("read %q: %v", name, err) } var buf bytes.Buffer @@ -28,7 +27,7 @@ func bindataRead(data []byte, name string) ([]byte, error) { clErr := gz.Close() if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) + return nil, fmt.Errorf("read %q: %v", name, err) } if clErr != nil { return nil, err @@ -49,21 +48,32 @@ type bindataFileInfo struct { modTime time.Time } +// Name return file name func (fi bindataFileInfo) Name() string { return fi.name } + +// Size return file size func (fi bindataFileInfo) Size() int64 { return fi.size } + +// Mode return file mode func (fi bindataFileInfo) Mode() os.FileMode { return fi.mode } + +// ModTime return file modify time func (fi bindataFileInfo) ModTime() time.Time { return fi.modTime } + +// IsDir return file whether a directory func (fi bindataFileInfo) IsDir() bool { - return false + return fi.mode&os.ModeDir != 0 } + +// Sys return file is sys mode func (fi bindataFileInfo) Sys() interface{} { return nil } @@ -83,7 +93,7 @@ func smcTsv() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "smc.tsv", size: 3398, mode: os.FileMode(420), modTime: time.Unix(1591711965, 0)} + info := bindataFileInfo{name: "smc.tsv", size: 3398, mode: os.FileMode(420), modTime: time.Unix(1592515411, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1