fix: support ValidArgs translation
All checks were successful
continuous-integration/drone/push Build is passing

See #632
This commit is contained in:
2025-08-30 12:02:13 +02:00
parent e25ce5d1a0
commit 83ca2a63d1
3 changed files with 59 additions and 38 deletions

View File

@ -57,12 +57,19 @@ func Run(version, commit string) {
Short: i18n.G("The Co-op Cloud command-line utility belt 🎩🐇"), Short: i18n.G("The Co-op Cloud command-line utility belt 🎩🐇"),
Version: fmt.Sprintf("%s-%s", version, commit[:7]), Version: fmt.Sprintf("%s-%s", version, commit[:7]),
ValidArgs: []string{ ValidArgs: []string{
// translators: `abra app` command for autocompletion
i18n.G("app"), i18n.G("app"),
// translators: `abra autocomplete` command for autocompletion
i18n.G("autocomplete"), i18n.G("autocomplete"),
// translators: `abra catalogue` command for autocompletion
i18n.G("catalogue"), i18n.G("catalogue"),
// translators: `abra man` command for autocompletion
i18n.G("man"), i18n.G("man"),
// translators: `abra recipe` command for autocompletion
i18n.G("recipe"), i18n.G("recipe"),
// translators: `abra server` command for autocompletion
i18n.G("server"), i18n.G("server"),
// translators: `abra upgrade` command for autocompletion
i18n.G("upgrade"), i18n.G("upgrade"),
}, },
PersistentPreRunE: func(cmd *cobra.Command, args []string) error { PersistentPreRunE: func(cmd *cobra.Command, args []string) error {

View File

@ -7,7 +7,7 @@
msgid "" msgid ""
msgstr "Project-Id-Version: \n" msgstr "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n" "Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2025-08-30 11:46+0200\n" "POT-Creation-Date: 2025-08-30 12:02+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -43,7 +43,7 @@ msgid " # fetch from recipe catalogue\n"
" abra recipe fetch gitea --ssh" " abra recipe fetch gitea --ssh"
msgstr "" msgstr ""
#: ./cli/run.go:122 #: ./cli/run.go:129
msgid " # generate the man pages into /usr/local/share/man/man1\n" msgid " # generate the man pages into /usr/local/share/man/man1\n"
" abra_path=$(which abra) # pass abra absolute path to sudo below\n" " abra_path=$(which abra) # pass abra absolute path to sudo below\n"
" sudo $abra_path man\n" " sudo $abra_path man\n"
@ -827,7 +827,7 @@ msgid "Generate labels for the main recipe service.\n"
msgstr "" msgstr ""
#. translators: Short description for `man` command #. translators: Short description for `man` command
#: ./cli/run.go:121 #: ./cli/run.go:128
msgid "Generate manpage" msgid "Generate manpage"
msgstr "" msgstr ""
@ -1559,7 +1559,7 @@ msgstr ""
msgid "abra app labels 1312.net" msgid "abra app labels 1312.net"
msgstr "" msgstr ""
#: ./cli/run.go:100 #: ./cli/run.go:107
#, c-format #, c-format
msgid "abra version: %s, commit: %s, lang: %s" msgid "abra version: %s, commit: %s, lang: %s"
msgstr "" msgstr ""
@ -1634,7 +1634,8 @@ msgstr ""
msgid "ambiguous service list received, prompting for input" msgid "ambiguous service list received, prompting for input"
msgstr "" msgstr ""
#: ./cli/run.go:60 #. translators: `abra app` command for autocompletion
#: ./cli/run.go:61
msgid "app" msgid "app"
msgstr "" msgstr ""
@ -1691,7 +1692,8 @@ msgstr ""
msgid "attempting to scale %s to 1" msgid "attempting to scale %s to 1"
msgstr "" msgstr ""
#: ./cli/run.go:61 #. translators: `abra autocomplete` command for autocompletion
#: ./cli/run.go:63
msgid "autocomplete" msgid "autocomplete"
msgstr "" msgstr ""
@ -1857,7 +1859,8 @@ msgstr ""
msgid "cannot use [version] and --latest together" msgid "cannot use [version] and --latest together"
msgstr "" msgstr ""
#: ./cli/run.go:62 #. translators: `abra catalogue` command for autocompletion
#: ./cli/run.go:65
msgid "catalogue" msgid "catalogue"
msgstr "" msgstr ""
@ -2325,7 +2328,7 @@ msgstr ""
msgid "domain name for app" msgid "domain name for app"
msgstr "" msgstr ""
#: ./cli/run.go:146 #: ./cli/run.go:153
msgid "don't forget to run 'sudo mandb'" msgid "don't forget to run 'sudo mandb'"
msgstr "" msgstr ""
@ -3242,7 +3245,7 @@ msgstr ""
#. translators: `abra man` aliases. use a comma separated list of aliases #. translators: `abra man` aliases. use a comma separated list of aliases
#. with no spaces in between #. with no spaces in between
#: ./cli/app/list.go:318 ./cli/app/ps.go:205 ./cli/app/secret.go:553 ./cli/app/secret.go:649 ./cli/recipe/list.go:104 ./cli/recipe/upgrade.go:376 ./cli/recipe/version.go:139 ./cli/run.go:114 ./cli/server/list.go:106 ./cli/updater/updater.go:560 #: ./cli/app/list.go:318 ./cli/app/ps.go:205 ./cli/app/secret.go:553 ./cli/app/secret.go:649 ./cli/recipe/list.go:104 ./cli/recipe/upgrade.go:376 ./cli/recipe/version.go:139 ./cli/run.go:121 ./cli/server/list.go:106 ./cli/updater/updater.go:560
msgid "m" msgid "m"
msgstr "" msgstr ""
@ -3264,12 +3267,13 @@ msgstr ""
msgid "malformed version pin specification: %s" msgid "malformed version pin specification: %s"
msgstr "" msgstr ""
#: ./cli/run.go:63 #. translators: `abra man` command for autocompletion
#: ./cli/run.go:67
msgid "man" msgid "man"
msgstr "" msgstr ""
#. translators: `man` command #. translators: `man` command
#: ./cli/run.go:118 #: ./cli/run.go:125
msgid "man [flags]" msgid "man [flags]"
msgstr "" msgstr ""
@ -3729,7 +3733,7 @@ msgstr ""
msgid "polling undeploy status" msgid "polling undeploy status"
msgstr "" msgstr ""
#: ./cli/run.go:171 #: ./cli/run.go:178
msgid "prefer offline & filesystem access" msgid "prefer offline & filesystem access"
msgstr "" msgstr ""
@ -3860,7 +3864,8 @@ msgstr ""
msgid "readme: %s, " msgid "readme: %s, "
msgstr "" msgstr ""
#: ./cli/app/list.go:302 ./cli/app/list.go:309 ./cli/run.go:64 #. translators: `abra recipe` command for autocompletion
#: ./cli/app/list.go:302 ./cli/app/list.go:309 ./cli/run.go:69
msgid "recipe" msgid "recipe"
msgstr "" msgstr ""
@ -4281,7 +4286,8 @@ msgstr ""
msgid "secrets are %s shown again, please save them %s" msgid "secrets are %s shown again, please save them %s"
msgstr "" msgstr ""
#: ./cli/app/list.go:325 ./cli/app/list.go:332 ./cli/app/new.go:333 ./cli/app/new.go:340 ./cli/run.go:65 #. translators: `abra server` command for autocompletion
#: ./cli/app/list.go:325 ./cli/app/list.go:332 ./cli/app/new.go:333 ./cli/app/new.go:340 ./cli/run.go:71
msgid "server" msgid "server"
msgstr "" msgstr ""
@ -4397,7 +4403,7 @@ msgstr ""
msgid "show apps of a specific server" msgid "show apps of a specific server"
msgstr "" msgstr ""
#: ./cli/run.go:155 ./cli/updater/updater.go:507 #: ./cli/run.go:162 ./cli/updater/updater.go:507
msgid "show debug messages" msgid "show debug messages"
msgstr "" msgstr ""
@ -4673,7 +4679,7 @@ msgstr ""
msgid "tmpfs options are incompatible with type volume" msgid "tmpfs options are incompatible with type volume"
msgstr "" msgstr ""
#: ./cli/run.go:163 ./cli/updater/updater.go:515 #: ./cli/run.go:170 ./cli/updater/updater.go:515
msgid "toggle non-interactive mode" msgid "toggle non-interactive mode"
msgstr "" msgstr ""
@ -4757,7 +4763,7 @@ msgstr ""
msgid "unable to convert to JSON: %s" msgid "unable to convert to JSON: %s"
msgstr "" msgstr ""
#: ./cli/run.go:80 #: ./cli/run.go:87
#, c-format #, c-format
msgid "unable to create %s: %s" msgid "unable to create %s: %s"
msgstr "" msgstr ""
@ -4846,7 +4852,7 @@ msgstr ""
msgid "unable to parse '%s' value as bool: %s" msgid "unable to parse '%s' value as bool: %s"
msgstr "" msgstr ""
#: ./cli/run.go:138 #: ./cli/run.go:145
#, c-format #, c-format
msgid "unable to proceed, %s does not exist?" msgid "unable to proceed, %s does not exist?"
msgstr "" msgstr ""
@ -5027,7 +5033,8 @@ msgstr ""
msgid "updating %s to %s in %s" msgid "updating %s to %s in %s"
msgstr "" msgstr ""
#: ./cli/run.go:66 #. translators: `abra upgrade` command for autocompletion
#: ./cli/run.go:73
msgid "upgrade" msgid "upgrade"
msgstr "" msgstr ""

View File

@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n" "Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2025-08-30 11:46+0200\n" "POT-Creation-Date: 2025-08-30 12:02+0200\n"
"PO-Revision-Date: 2025-08-29 21:45+0000\n" "PO-Revision-Date: 2025-08-29 21:45+0000\n"
"Last-Translator: chasqui <chasqui@cryptolab.net>\n" "Last-Translator: chasqui <chasqui@cryptolab.net>\n"
"Language-Team: Spanish <https://translate.coopcloud.tech/projects/co-op-" "Language-Team: Spanish <https://translate.coopcloud.tech/projects/co-op-"
@ -44,7 +44,7 @@ msgid ""
" abra recipe fetch gitea --ssh" " abra recipe fetch gitea --ssh"
msgstr "" msgstr ""
#: cli/run.go:122 #: cli/run.go:129
msgid "" msgid ""
" # generate the man pages into /usr/local/share/man/man1\n" " # generate the man pages into /usr/local/share/man/man1\n"
" abra_path=$(which abra) # pass abra absolute path to sudo below\n" " abra_path=$(which abra) # pass abra absolute path to sudo below\n"
@ -893,7 +893,7 @@ msgid ""
msgstr "" msgstr ""
#. translators: Short description for `man` command #. translators: Short description for `man` command
#: cli/run.go:121 #: cli/run.go:128
msgid "Generate manpage" msgid "Generate manpage"
msgstr "📒 Manual de uso" msgstr "📒 Manual de uso"
@ -1712,7 +1712,7 @@ msgstr ""
msgid "abra app labels 1312.net" msgid "abra app labels 1312.net"
msgstr "" msgstr ""
#: cli/run.go:100 #: cli/run.go:107
#, c-format #, c-format
msgid "abra version: %s, commit: %s, lang: %s" msgid "abra version: %s, commit: %s, lang: %s"
msgstr "" msgstr ""
@ -1788,7 +1788,8 @@ msgstr ""
msgid "ambiguous service list received, prompting for input" msgid "ambiguous service list received, prompting for input"
msgstr "" msgstr ""
#: cli/run.go:60 #. translators: `abra app` command for autocompletion
#: cli/run.go:61
msgid "app" msgid "app"
msgstr "plataforma" msgstr "plataforma"
@ -1845,7 +1846,8 @@ msgstr ""
msgid "attempting to scale %s to 1" msgid "attempting to scale %s to 1"
msgstr "" msgstr ""
#: cli/run.go:61 #. translators: `abra autocomplete` command for autocompletion
#: cli/run.go:63
msgid "autocomplete" msgid "autocomplete"
msgstr "" msgstr ""
@ -2018,7 +2020,8 @@ msgstr ""
msgid "cannot use [version] and --latest together" msgid "cannot use [version] and --latest together"
msgstr "" msgstr ""
#: cli/run.go:62 #. translators: `abra catalogue` command for autocompletion
#: cli/run.go:65
msgid "catalogue" msgid "catalogue"
msgstr "" msgstr ""
@ -2500,7 +2503,7 @@ msgstr ""
msgid "domain name for app" msgid "domain name for app"
msgstr "" msgstr ""
#: cli/run.go:146 #: cli/run.go:153
msgid "don't forget to run 'sudo mandb'" msgid "don't forget to run 'sudo mandb'"
msgstr "" msgstr ""
@ -3440,7 +3443,7 @@ msgstr "plataformas"
#. with no spaces in between #. with no spaces in between
#: cli/app/list.go:318 cli/app/ps.go:205 cli/app/secret.go:553 #: cli/app/list.go:318 cli/app/ps.go:205 cli/app/secret.go:553
#: cli/app/secret.go:649 cli/recipe/list.go:104 cli/recipe/upgrade.go:376 #: cli/app/secret.go:649 cli/recipe/list.go:104 cli/recipe/upgrade.go:376
#: cli/recipe/version.go:139 cli/run.go:114 cli/server/list.go:106 #: cli/recipe/version.go:139 cli/run.go:121 cli/server/list.go:106
#: cli/updater/updater.go:560 #: cli/updater/updater.go:560
msgid "m" msgid "m"
msgstr "" msgstr ""
@ -3467,12 +3470,13 @@ msgstr ""
msgid "malformed version pin specification: %s" msgid "malformed version pin specification: %s"
msgstr "" msgstr ""
#: cli/run.go:63 #. translators: `abra man` command for autocompletion
#: cli/run.go:67
msgid "man" msgid "man"
msgstr "" msgstr ""
#. translators: `man` command #. translators: `man` command
#: cli/run.go:118 #: cli/run.go:125
msgid "man [flags]" msgid "man [flags]"
msgstr "manual [flags]" msgstr "manual [flags]"
@ -3953,7 +3957,7 @@ msgstr ""
msgid "polling undeploy status" msgid "polling undeploy status"
msgstr "" msgstr ""
#: cli/run.go:171 #: cli/run.go:178
msgid "prefer offline & filesystem access" msgid "prefer offline & filesystem access"
msgstr "" msgstr ""
@ -4089,7 +4093,8 @@ msgstr ""
msgid "readme: %s, " msgid "readme: %s, "
msgstr "" msgstr ""
#: cli/app/list.go:302 cli/app/list.go:309 cli/run.go:64 #. translators: `abra recipe` command for autocompletion
#: cli/app/list.go:302 cli/app/list.go:309 cli/run.go:69
msgid "recipe" msgid "recipe"
msgstr "" msgstr ""
@ -4517,8 +4522,9 @@ msgstr ""
msgid "secrets are %s shown again, please save them %s" msgid "secrets are %s shown again, please save them %s"
msgstr "" msgstr ""
#. translators: `abra server` command for autocompletion
#: cli/app/list.go:325 cli/app/list.go:332 cli/app/new.go:333 #: cli/app/list.go:325 cli/app/list.go:332 cli/app/new.go:333
#: cli/app/new.go:340 cli/run.go:65 #: cli/app/new.go:340 cli/run.go:71
msgid "server" msgid "server"
msgstr "" msgstr ""
@ -4636,7 +4642,7 @@ msgstr ""
msgid "show apps of a specific server" msgid "show apps of a specific server"
msgstr "" msgstr ""
#: cli/run.go:155 cli/updater/updater.go:507 #: cli/run.go:162 cli/updater/updater.go:507
msgid "show debug messages" msgid "show debug messages"
msgstr "" msgstr ""
@ -4915,7 +4921,7 @@ msgstr ""
msgid "tmpfs options are incompatible with type volume" msgid "tmpfs options are incompatible with type volume"
msgstr "" msgstr ""
#: cli/run.go:163 cli/updater/updater.go:515 #: cli/run.go:170 cli/updater/updater.go:515
msgid "toggle non-interactive mode" msgid "toggle non-interactive mode"
msgstr "" msgstr ""
@ -5000,7 +5006,7 @@ msgstr ""
msgid "unable to convert to JSON: %s" msgid "unable to convert to JSON: %s"
msgstr "" msgstr ""
#: cli/run.go:80 #: cli/run.go:87
#, c-format #, c-format
msgid "unable to create %s: %s" msgid "unable to create %s: %s"
msgstr "" msgstr ""
@ -5090,7 +5096,7 @@ msgstr ""
msgid "unable to parse '%s' value as bool: %s" msgid "unable to parse '%s' value as bool: %s"
msgstr "" msgstr ""
#: cli/run.go:138 #: cli/run.go:145
#, c-format #, c-format
msgid "unable to proceed, %s does not exist?" msgid "unable to proceed, %s does not exist?"
msgstr "" msgstr ""
@ -5278,7 +5284,8 @@ msgstr ""
msgid "updating %s to %s in %s" msgid "updating %s to %s in %s"
msgstr "" msgstr ""
#: cli/run.go:66 #. translators: `abra upgrade` command for autocompletion
#: cli/run.go:73
msgid "upgrade" msgid "upgrade"
msgstr "" msgstr ""