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

Unlocalized command line options #656

Open
EduardGomezEscandell opened this issue Mar 29, 2023 · 4 comments
Open

Unlocalized command line options #656

EduardGomezEscandell opened this issue Mar 29, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@EduardGomezEscandell
Copy link
Contributor

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.

EduardGomezEscandell added a commit to canonical/ubuntu-pro-for-wsl that referenced this issue Mar 29, 2023
@denisonbarbosa
Copy link
Member

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.

@EduardGomezEscandell
Copy link
Contributor Author

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.

EduardGomezEscandell added a commit to canonical/ubuntu-pro-for-wsl that referenced this issue Mar 30, 2023
@jibel
Copy link
Collaborator

jibel commented Nov 30, 2023

Is it still an issue in ADSys?

@jibel jibel added the bug Something isn't working label Nov 30, 2023
@EduardGomezEscandell
Copy link
Contributor Author

Haven't manually checked. From reading the code, it would appear it still is an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants