Mark "help" subcommand and "--help" flag for translation #628

Closed
opened 2025-08-29 20:25:57 +00:00 by 3wordchant · 1 comment
Owner

Currently:

➜ docker run -it -e LANG=es -v $HOME/.abra:/root/.abra:z git.coopcloud.tech/toolshed/abra:latest 
La varita de mágica de Co-op Cloud 🪄🎩🐇

...

  actualizar    Actualizar abra
  autocompletar Genera un script de autocompletado
  catalogo      Administrar la catálogo de recetas
  help          Help about any command
  manual        Manual de uso

Note that "help", and the explanation "Help about any command" are not translated.

This is because they don't appear in the Gettext catalogue.

Pending merge of https://github.com/spf13/cobra/pull/2090, it's possible that we can work around this by defining our own helpCommand and helpFlag – but how to do this without huge repetition is not immediately obvious to me.

Currently: ``` ➜ docker run -it -e LANG=es -v $HOME/.abra:/root/.abra:z git.coopcloud.tech/toolshed/abra:latest La varita de mágica de Co-op Cloud 🪄🎩🐇 ... actualizar Actualizar abra autocompletar Genera un script de autocompletado catalogo Administrar la catálogo de recetas help Help about any command manual Manual de uso ``` Note that "help", and the explanation "Help about any command" are not translated. This is because they don't appear in the Gettext catalogue. Pending merge of https://github.com/spf13/cobra/pull/2090, it's possible that we can work around this by defining our own `helpCommand` and `helpFlag` – but how to do this without huge repetition is not immediately obvious to me.
3wordchant added the
i18n
label 2025-08-29 20:25:57 +00:00
3wordchant added this to the Language translation project 2025-08-29 20:25:57 +00:00
Owner

If you set it once on the rootCmd the implementation in cobra will walk back up the command tree to run it 🎉

If you set it once on the `rootCmd` the implementation in `cobra` will walk back up the command tree to run it 🎉
decentral1se moved this to Done in Language translation on 2025-08-30 08:48:27 +00:00
decentral1se added the
red abya yala
label 2025-08-30 09:40:47 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: toolshed/abra#628
No description provided.