Unlocalized command line options
Description
i18n is initialized too late.
In adsysd/main.go and possibly all other main functions:
func main() {
var a app
switch filepath.Base(os.Args[0]) {
case daemon.CmdName:
a = daemon.New() // In here we use i18n
default:
a = client.New() // In here we use i18n
}
os.Exit(run(a)) // Here we initialize i18n
}
Nothing in the constructors is actually localized. So for instance --help will always show up in english.
Reproduction
I haven't tested it because I don't know how to build the project, I got this from static analysis when copying this project structure.
This sure does look like a problem. But the fix should be as simple as moving a line. I'll open a PR for it real quick.
Agreed, it's just moving the InitDomain to the main function.
We use this pattern in multiple repos (and even multiple places in some repose), so we should also consider where else this bug may exist.
Is it still an issue in ADSys?
Haven't manually checked. From reading the code, it would appear it still is an issue.