Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help text for --bytes is not shown correctly in some translations #224

Open
andypiper opened this issue Jul 13, 2022 · 0 comments
Open

Help text for --bytes is not shown correctly in some translations #224

andypiper opened this issue Jul 13, 2022 · 0 comments

Comments

@andypiper
Copy link

gotop version:

gotop 4.1.3 (20220214T213516)

OS/Arch:
ProductName:	macOS
ProductVersion:	12.4
BuildVersion:	21F79
Terminal emulator:

iTerm 2

The output from gotop -h shows this (affected section only shown) - I'm running on a system where the language is set to English.

  -x, --export=         Enable metrics for export on the specified port.
  --mbps                Show network rate as mbps.
  --bytes               args.no-mbps <--- this is the issue
  --test                Runs tests and exits with success/failure code.
  --no-test             Disable tests.

As shown, the help text for the --bytes option shows the text args.no-mbps. This appears to be caused by this line of code:

mbps := goopt.Flag([]string{"--mbps"}, []string{"--bytes"}, tr.Value("args.mbps"), tr.Value("args.no-mbps"))

As shown, the parser attempts to print the translated text for the value of args.no-mbps which in some of the translations has been set, but in the English translation has instead been defined as the text for arg.bytes.

I'm not choosing to send a PR at this time as this affects several language translation files (most of which I'm not proficient with!) and also, the arg name has been set to no-mbps in some of the files, but left as bytes in other files. The fix itself should just be a case of choosing whether the arg name should be no-mbps or bytes; and then setting that arg name consistently across cmd/gotop/main.go and dict/*.toml.

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant