Semi-automated mass string commenting

This commit is contained in:
3wc
2025-08-27 12:42:50 -04:00
parent 5b6254a243
commit db5da1656a
45 changed files with 61 additions and 0 deletions

View File

@ -80,6 +80,7 @@ update-pot:
-o pkg/i18n/locales/$(DOMAIN).pot \
--keyword=i18n.G \
--sort-output \
--add-comments-tag="translators" \
$$(find . -name "*.go" -not -path "*vendor*")
.PHONY: update-pot-po-metadata

View File

@ -6,6 +6,7 @@ import (
)
var AppCommand = &cobra.Command{
// translators: `app` command group
Use: i18n.G("app [cmd] [args] [flags]"),
Aliases: []string{i18n.G("a")},
Short: i18n.G("Manage apps"),

View File

@ -12,6 +12,7 @@ import (
)
var AppBackupListCommand = &cobra.Command{
// translators: `app backup list` command
Use: i18n.G("list <domain> [flags]"),
Aliases: []string{i18n.G("ls")},
Short: i18n.G("List the contents of a snapshot"),
@ -62,6 +63,7 @@ var AppBackupListCommand = &cobra.Command{
}
var AppBackupDownloadCommand = &cobra.Command{
// translators: `app backup download` command
Use: i18n.G("download <domain> [flags]"),
Aliases: []string{i18n.G("d")},
Short: i18n.G("Download a snapshot"),
@ -131,6 +133,7 @@ var AppBackupDownloadCommand = &cobra.Command{
}
var AppBackupCreateCommand = &cobra.Command{
// translators: `app backup create` command
Use: i18n.G("create <domain> [flags]"),
Aliases: []string{i18n.G("c")},
Short: i18n.G("Create a new snapshot"),
@ -175,6 +178,7 @@ var AppBackupCreateCommand = &cobra.Command{
}
var AppBackupSnapshotsCommand = &cobra.Command{
// translators: `app backup snapshots` command
Use: i18n.G("snapshots <domain> [flags]"),
Aliases: []string{i18n.G("s")},
Short: i18n.G("List all snapshots"),
@ -210,6 +214,7 @@ var AppBackupSnapshotsCommand = &cobra.Command{
}
var AppBackupCommand = &cobra.Command{
// translators: `app backup` command group
Use: i18n.G("backup [cmd] [args] [flags]"),
Aliases: []string{i18n.G("b")},
Short: i18n.G("Manage app backups"),

View File

@ -14,6 +14,7 @@ import (
)
var AppCheckCommand = &cobra.Command{
// translators: `app check` command
Use: i18n.G("check <domain> [flags]"),
Aliases: []string{i18n.G("chk")},
Short: i18n.G("Ensure an app is well configured"),

View File

@ -19,6 +19,7 @@ import (
)
var AppCmdCommand = &cobra.Command{
// translators: `app command` command
Use: i18n.G("command <domain> [service | --local] <cmd> [[args] [flags] | [flags] -- [args]]"),
Aliases: []string{i18n.G("cmd")},
Short: i18n.G("Run app commands"),
@ -193,6 +194,7 @@ does not).`),
}
var AppCmdListCommand = &cobra.Command{
// translators: `app list` command
Use: i18n.G("list <domain> [flags]"),
Aliases: []string{i18n.G("ls")},
Short: i18n.G("List all available commands"),

View File

@ -13,6 +13,7 @@ import (
)
var AppConfigCommand = &cobra.Command{
// translators: `app config` command
Use: i18n.G("config <domain> [flags]"),
Aliases: []string{i18n.G("cfg")},
Short: i18n.G("Edit app config"),

View File

@ -26,6 +26,7 @@ import (
)
var AppCpCommand = &cobra.Command{
// translators: `app cp` command
Use: i18n.G("cp <domain> <src> <dst> [flags]"),
Aliases: []string{i18n.G("c")},
Short: i18n.G("Copy files to/from a deployed app service"),

View File

@ -25,6 +25,7 @@ import (
)
var AppDeployCommand = &cobra.Command{
// translators: `app deploy` command
Use: i18n.G("deploy <domain> [version] [flags]"),
Aliases: []string{i18n.G("d")},
Short: i18n.G("Deploy an app"),

View File

@ -12,6 +12,7 @@ import (
)
var AppEnvCommand = &cobra.Command{
// translators: `app env` command
Use: i18n.G("env <domain> [flags]"),
Aliases: []string{i18n.G("e")},
Short: i18n.G("Show app .env values"),

View File

@ -20,6 +20,7 @@ import (
)
var AppLabelsCommand = &cobra.Command{
// translators: `app labels` command
Use: i18n.G("labels <domain> [flags]"),
Aliases: []string{i18n.G("lb")},
Short: i18n.G("Show deployment labels"),

View File

@ -40,6 +40,7 @@ type serverStatus struct {
}
var AppListCommand = &cobra.Command{
// translators: `app list` command
Use: i18n.G("list [flags]"),
Aliases: []string{i18n.G("ls")},
Short: i18n.G("List all managed apps"),

View File

@ -15,6 +15,7 @@ import (
)
var AppLogsCommand = &cobra.Command{
// translators: `app logs` command
Use: i18n.G("logs <domain> [service] [flags]"),
Aliases: []string{i18n.G("l")},
Short: i18n.G("Tail app logs"),

View File

@ -43,6 +43,7 @@ pass store (see passwordstore.org for more). The pass command must be available
on your $PATH.`)
var AppNewCommand = &cobra.Command{
// translators: `app new` command
Use: i18n.G("new [recipe] [version] [flags]"),
Aliases: []string{i18n.G("n")},
Short: i18n.G("Create a new app"),

View File

@ -25,6 +25,7 @@ import (
)
var AppPsCommand = &cobra.Command{
// translators: `app ps` command
Use: i18n.G("ps <domain> [flags]"),
Aliases: []string{i18n.G("p")},
Short: i18n.G("Check app deployment status"),

View File

@ -16,6 +16,7 @@ import (
)
var AppRemoveCommand = &cobra.Command{
// translators: `app remove` command
Use: i18n.G("remove <domain> [flags]"),
Aliases: []string{i18n.G("rm")},
Short: i18n.G("Remove all app data, locally and remotely"),

View File

@ -18,6 +18,7 @@ import (
)
var AppRestartCommand = &cobra.Command{
// translators: `app restart` command
Use: i18n.G("restart <domain> [[service] | --all-services] [flags]"),
Aliases: []string{i18n.G("re")},
Short: i18n.G("Restart an app"),

View File

@ -13,6 +13,7 @@ import (
)
var AppRestoreCommand = &cobra.Command{
// translators: `app restore` command
Use: i18n.G("restore <domain> [flags]"),
Aliases: []string{i18n.G("rs")},
Short: i18n.G("Restore a snapshot"),

View File

@ -22,6 +22,7 @@ import (
)
var AppRollbackCommand = &cobra.Command{
// translators: `app rollback` command
Use: i18n.G("rollback <domain> [version] [flags]"),
Aliases: []string{i18n.G("rl")},
Short: i18n.G("Roll an app back to a previous version"),

View File

@ -18,6 +18,7 @@ import (
)
var AppRunCommand = &cobra.Command{
// translators: `app run` command
Use: i18n.G("run <domain> <service> <cmd> [[args] [flags] | [flags] -- [args]]"),
Aliases: []string{i18n.G("r")},
Short: i18n.G("Run a command inside a service container"),

View File

@ -25,6 +25,7 @@ import (
)
var AppSecretGenerateCommand = &cobra.Command{
// translators: `app secret generate` command
Use: i18n.G("generate <domain> [[secret] [version] | --all] [flags]"),
Aliases: []string{i18n.G("g")},
Short: i18n.G("Generate secrets"),
@ -145,6 +146,7 @@ var AppSecretGenerateCommand = &cobra.Command{
}
var AppSecretInsertCommand = &cobra.Command{
// translators: `app secret insert` command
Use: i18n.G("insert <domain> <secret> <version> [<data>] [flags]"),
Aliases: []string{i18n.G("i")},
Short: i18n.G("Insert secret"),
@ -318,6 +320,7 @@ func secretRm(cl *dockerClient.Client, app appPkg.App, secretName, parsed string
}
var AppSecretRmCommand = &cobra.Command{
// translators: `app secret remove` command
Use: i18n.G("remove <domain> [[secret] | --all] [flags]"),
Aliases: []string{i18n.G("rm")},
Short: i18n.G("Remove a secret"),
@ -431,6 +434,7 @@ match those configured in the recipe beforehand.`),
}
var AppSecretLsCommand = &cobra.Command{
// translators: `app secret list` command
Use: i18n.G("list <domain>"),
Aliases: []string{i18n.G("ls")},
Short: i18n.G("List all secrets"),
@ -506,6 +510,7 @@ var AppSecretLsCommand = &cobra.Command{
}
var AppSecretCommand = &cobra.Command{
// translators: `app secret` command group
Use: i18n.G("secret [cmd] [args] [flags]"),
Aliases: []string{i18n.G("s")},
Short: i18n.G("Manage app secrets"),

View File

@ -18,6 +18,7 @@ import (
)
var AppServicesCommand = &cobra.Command{
// translators: `app services` command
Use: i18n.G("services <domain> [flags]"),
Aliases: []string{i18n.G("sr")},
Short: i18n.G("Display all services of an app"),

View File

@ -19,6 +19,7 @@ import (
)
var AppUndeployCommand = &cobra.Command{
// translators: `app undeploy` command
Use: i18n.G("undeploy <domain> [flags]"),
Aliases: []string{i18n.G("un")},
Short: i18n.G("Undeploy an app"),

View File

@ -26,6 +26,7 @@ import (
)
var AppUpgradeCommand = &cobra.Command{
// translators: `app upgrade` command
Use: i18n.G("upgrade <domain> [version] [flags]"),
Aliases: []string{i18n.G("up")},
Short: i18n.G("Upgrade an app"),

View File

@ -16,6 +16,7 @@ import (
)
var AppVolumeListCommand = &cobra.Command{
// translators: `app volume list` command
Use: i18n.G("list <domain> [flags]"),
Aliases: []string{i18n.G("ls")},
Short: i18n.G("List volumes associated with an app"),
@ -73,6 +74,7 @@ var AppVolumeListCommand = &cobra.Command{
}
var AppVolumeRemoveCommand = &cobra.Command{
// translators: `app volume remove` command
Use: i18n.G("remove <domain> [volume] [flags]"),
Short: i18n.G("Remove volume(s) associated with an app"),
Long: i18n.G(`Remove volumes associated with an app.
@ -187,6 +189,7 @@ Passing "--force/-f" will select all volumes for removal. Be careful.`),
}
var AppVolumeCommand = &cobra.Command{
// translators: `app volume` command group
Use: i18n.G("volume [cmd] [args] [flags]"),
Aliases: []string{i18n.G("vl")},
Short: i18n.G("Manage app volumes"),

View File

@ -22,6 +22,7 @@ import (
)
var CatalogueSyncCommand = &cobra.Command{
// translators: `catalogue sync` command
Use: i18n.G("sync [flags]"),
Aliases: []string{i18n.G("g")},
Short: i18n.G("Sync recipe catalogue for latest changes"),
@ -40,6 +41,7 @@ var CatalogueSyncCommand = &cobra.Command{
}
var CatalogueGenerateCommand = &cobra.Command{
// translators: `catalogue generate` command
Use: i18n.G("generate [recipe] [flags]"),
Aliases: []string{i18n.G("g")},
Short: i18n.G("Generate the recipe catalogue"),
@ -262,6 +264,7 @@ your private key and enter your passphrase beforehand.
// CatalogueCommand defines the `abra catalogue` command and sub-commands.
var CatalogueCommand = &cobra.Command{
// translators: `catalogue` command group
Use: i18n.G("catalogue [cmd] [args] [flags]"),
Short: i18n.G("Manage the recipe catalogue"),
Aliases: []string{"c"},

View File

@ -8,6 +8,7 @@ import (
)
var AutocompleteCommand = &cobra.Command{
// translators: `autocomplete` command
Use: i18n.G("autocomplete [bash|zsh|fish|powershell]"),
Short: i18n.G("Generate autocompletion script"),
Long: i18n.G(`To load completions:

View File

@ -10,6 +10,7 @@ import (
)
var RecipeDiffCommand = &cobra.Command{
// translators: `recipe diff` command
Use: i18n.G("diff <recipe> [flags]"),
Aliases: []string{i18n.G("d")},
Short: i18n.G("Show unstaged changes in recipe config"),

View File

@ -15,6 +15,7 @@ import (
)
var RecipeFetchCommand = &cobra.Command{
// translators: `recipe fetch` command
Use: i18n.G("fetch [recipe | --all] [flags]"),
Aliases: []string{i18n.G("f")},
Short: i18n.G("Clone recipe(s) locally"),

View File

@ -11,6 +11,7 @@ import (
)
var RecipeLintCommand = &cobra.Command{
// translators: `recipe lint` command
Use: i18n.G("lint <recipe> [flags]"),
Short: i18n.G("Lint a recipe"),
Aliases: []string{i18n.G("l")},

View File

@ -15,6 +15,7 @@ import (
)
var RecipeListCommand = &cobra.Command{
// translators: `recipe list` command
Use: i18n.G("list"),
Short: i18n.G("List recipes"),
Aliases: []string{i18n.G("ls")},

View File

@ -31,6 +31,7 @@ type recipeMetadata struct {
}
var RecipeNewCommand = &cobra.Command{
// translators: `recipe new` command
Use: i18n.G("new <recipe> [flags]"),
Aliases: []string{i18n.G("n")},
Short: i18n.G("Create a new recipe"),

View File

@ -7,6 +7,7 @@ import (
// RecipeCommand defines all recipe related sub-commands.
var RecipeCommand = &cobra.Command{
// translators: `recipe` command group
Use: i18n.G("recipe [cmd] [args] [flags]"),
Aliases: []string{i18n.G("r")},
Short: i18n.G("Manage recipes"),

View File

@ -24,6 +24,7 @@ import (
)
var RecipeReleaseCommand = &cobra.Command{
// translators: `recipe release` command
Use: i18n.G("release <recipe> [version] [flags]"),
Aliases: []string{i18n.G("rl")},
Short: i18n.G("Release a new recipe version"),

View File

@ -10,6 +10,7 @@ import (
)
var RecipeResetCommand = &cobra.Command{
// translators: `recipe reset` command
Use: i18n.G("reset <recipe> [flags]"),
Aliases: []string{i18n.G("rs")},
Short: i18n.G("Remove all unstaged changes from recipe config"),

View File

@ -19,6 +19,7 @@ import (
)
var RecipeSyncCommand = &cobra.Command{
// translators: `recipe sync` command
Use: i18n.G("sync <recipe> [version] [flags]"),
Aliases: []string{i18n.G("s")},
Short: i18n.G("Sync recipe version label"),

View File

@ -38,6 +38,7 @@ type anUpgrade struct {
}
var RecipeUpgradeCommand = &cobra.Command{
// translators: `recipe upgrade` command
Use: i18n.G("upgrade <recipe> [flags]"),
Aliases: []string{i18n.G("u")},
Short: i18n.G("Upgrade recipe image tags"),

View File

@ -14,6 +14,7 @@ import (
)
var RecipeVersionCommand = &cobra.Command{
// translators: `recipe versions` command
Use: i18n.G("versions <recipe> [flags]"),
Aliases: []string{i18n.G("v")},
Short: i18n.G("List recipe versions"),

View File

@ -21,6 +21,7 @@ import (
func Run(version, commit string) {
rootCmd := &cobra.Command{
// translators: `abra` binary name
Use: i18n.G("abra [cmd] [args] [flags]"),
Short: i18n.G("The Co-op Cloud command-line utility belt 🎩🐇"),
Version: fmt.Sprintf("%s-%s", version, commit[:7]),
@ -78,6 +79,7 @@ func Run(version, commit string) {
rootCmd.CompletionOptions.DisableDefaultCmd = true
manCommand := &cobra.Command{
// translators: `man` command
Use: i18n.G("man [flags]"),
Aliases: []string{"m"},
Short: i18n.G("Generate manpage"),

View File

@ -18,6 +18,7 @@ import (
)
var ServerAddCommand = &cobra.Command{
// translators: `server add` command
Use: i18n.G("add [[server] | --local] [flags]"),
Aliases: []string{i18n.G("a")},
Short: i18n.G("Add a new server"),

View File

@ -15,6 +15,7 @@ import (
)
var ServerListCommand = &cobra.Command{
// translators: `server list` command
Use: i18n.G("list [flags]"),
Aliases: []string{i18n.G("ls")},
Short: i18n.G("List managed servers"),

View File

@ -12,6 +12,7 @@ import (
)
var ServerPruneCommand = &cobra.Command{
// translators: `server prune` command
Use: i18n.G("prune <server> [flags]"),
Aliases: []string{i18n.G("p")},
Short: i18n.G("Prune resources on a server"),

View File

@ -14,6 +14,7 @@ import (
)
var ServerRemoveCommand = &cobra.Command{
// translators: `server remove` command
Use: i18n.G("remove <server> [flags]"),
Aliases: []string{i18n.G("rm")},
Short: i18n.G("Remove a managed server"),

View File

@ -7,6 +7,7 @@ import (
// ServerCommand defines the `abra server` command and its subcommands
var ServerCommand = &cobra.Command{
// translators: `server` command group
Use: i18n.G("server [cmd] [args] [flags]"),
Aliases: []string{i18n.G("s")},
Short: i18n.G("Manage servers"),

View File

@ -32,6 +32,7 @@ const SERVER = "localhost"
// NotifyCommand checks for available upgrades.
var NotifyCommand = &cobra.Command{
// translators: `notify` command
Use: i18n.G("notify [flags]"),
Aliases: []string{i18n.G("n")},
Short: i18n.G("Check for available upgrades"),
@ -71,6 +72,7 @@ Use "--major/-m" to include new major versions.`),
// UpgradeCommand upgrades apps.
var UpgradeCommand = &cobra.Command{
// translators: `app upgrade` command
Use: i18n.G("upgrade [[stack] [recipe] | --all] [flags]"),
Aliases: []string{i18n.G("u")},
Short: i18n.G("Upgrade apps"),
@ -468,6 +470,7 @@ func upgrade(cl *dockerclient.Client, stackName, recipeName, upgradeVersion stri
func newKadabraApp(version, commit string) *cobra.Command {
rootCmd := &cobra.Command{
// translators: `kadabra` binary name
Use: i18n.G("kadabra [cmd] [flags]"),
Version: fmt.Sprintf("%s-%s", version, commit[:7]),
Short: i18n.G("The Co-op Cloud auto-updater 🤖 🚀"),

View File

@ -13,6 +13,7 @@ import (
// UpgradeCommand upgrades abra in-place.
var UpgradeCommand = &cobra.Command{
// translators: `upgrade` command
Use: i18n.G("upgrade [flags]"),
Aliases: []string{"u"},
Short: i18n.G("Upgrade abra"),