feat: msgctxt support

See toolshed/abra#647
See toolshed/xgettext-go#1
This commit is contained in:
2025-09-30 19:07:31 +02:00
parent 0db1ee87fc
commit 033c9bfc13
14 changed files with 125 additions and 28 deletions

View File

@ -20,6 +20,7 @@ var (
Locale = DefaultLocale
_, Mo = LoadLocale()
G = Mo.Get
GC = Mo.GetC
)
func LoadLocale() (string, *gotext.Mo) {

View File

@ -7,7 +7,7 @@
msgid ""
msgstr "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2025-09-29 10:31+0200\n"
"POT-Creation-Date: 2025-09-30 19:08+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -1673,9 +1673,55 @@ msgstr ""
#. translators: `abra app` aliases. use a comma separated list of aliases with
#. no spaces in between
#: ./cli/app/app.go:12
msgctxt "abra app"
msgid "a"
msgstr ""
#: ./cli/app/backup.go:271
msgctxt "app backup list"
msgid "a"
msgstr ""
#: ./cli/app/restart.go:169
msgctxt "app restart"
msgid "a"
msgstr ""
#: ./cli/app/secret.go:577
msgctxt "app secret generate"
msgid "a"
msgstr ""
#: ./cli/app/secret.go:617
msgctxt "app secret rm"
msgid "a"
msgstr ""
#: ./cli/recipe/fetch.go:122
msgctxt "recipe fetch"
msgid "a"
msgstr ""
#: ./cli/recipe/upgrade.go:384
msgctxt "recipe upgrade"
msgid "a"
msgstr ""
#. translators: `abra server add` aliases. use a comma separated list of
#. aliases with no spaces in between
#: ./cli/app/app.go:12 ./cli/app/backup.go:271 ./cli/app/restart.go:169 ./cli/app/secret.go:577 ./cli/app/secret.go:617 ./cli/recipe/fetch.go:122 ./cli/recipe/upgrade.go:384 ./cli/server/add.go:23 ./cli/server/prune.go:99 ./cli/updater/updater.go:554
#: ./cli/server/add.go:23
msgctxt "server add"
msgid "a"
msgstr ""
#: ./cli/server/prune.go:99
msgctxt "server prune"
msgid "a"
msgstr ""
#: ./cli/updater/updater.go:554
msgctxt "abra upgrade"
msgid "a"
msgstr ""

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2025-09-29 10:31+0200\n"
"POT-Creation-Date: 2025-09-30 19:08+0200\n"
"PO-Revision-Date: 2025-09-04 08:14+0000\n"
"Last-Translator: chasqui <chasqui@cryptolab.net>\n"
"Language-Team: Spanish <https://translate.coopcloud.tech/projects/co-op-"
@ -1701,19 +1701,19 @@ msgid ""
"\n"
"Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "
"\"help\"))}}\n"
" {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}"
"{{if .HasAvailableLocalFlags}}\n"
" {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if ."
"HasAvailableLocalFlags}}\n"
"\n"
"Flags:\n"
"{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}"
"{{if .HasAvailableInheritedFlags}}\n"
"{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if ."
"HasAvailableInheritedFlags}}\n"
"\n"
"Global Flags:\n"
"{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}"
"{{if .HasHelpSubCommands}}\n"
"{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if ."
"HasHelpSubCommands}}\n"
"\n"
"Additional help topics:{{range .Commands}}"
"{{if .IsAdditionalHelpTopicCommand}}\n"
"Additional help topics:{{range .Commands}}{{if ."
"IsAdditionalHelpTopicCommand}}\n"
" {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}"
"{{if .HasAvailableSubCommands}}\n"
"\n"
@ -1835,12 +1835,55 @@ msgstr ""
#. translators: `abra app` aliases. use a comma separated list of aliases with
#. no spaces in between
#: cli/app/app.go:12
msgctxt "abra app"
msgid "a"
msgstr ""
#: cli/app/backup.go:271
msgctxt "app backup list"
msgid "a"
msgstr ""
#: cli/app/restart.go:169
msgctxt "app restart"
msgid "a"
msgstr ""
#: cli/app/secret.go:577
msgctxt "app secret generate"
msgid "a"
msgstr ""
#: cli/app/secret.go:617
msgctxt "app secret rm"
msgid "a"
msgstr ""
#: cli/recipe/fetch.go:122
msgctxt "recipe fetch"
msgid "a"
msgstr ""
#: cli/recipe/upgrade.go:384
msgctxt "recipe upgrade"
msgid "a"
msgstr ""
#. translators: `abra server add` aliases. use a comma separated list of
#. aliases with no spaces in between
#: cli/app/app.go:12 cli/app/backup.go:271 cli/app/restart.go:169
#: cli/app/secret.go:577 cli/app/secret.go:617 cli/recipe/fetch.go:122
#: cli/recipe/upgrade.go:384 cli/server/add.go:23 cli/server/prune.go:99
#: cli/server/add.go:23
msgctxt "server add"
msgid "a"
msgstr ""
#: cli/server/prune.go:99
msgctxt "server prune"
msgid "a"
msgstr ""
#: cli/updater/updater.go:554
msgctxt "abra upgrade"
msgid "a"
msgstr ""
@ -4921,8 +4964,8 @@ msgstr ""
#: cli/recipe/upgrade.go:228
#, c-format
msgid ""
"service %s is at version %s, but pinned to %s, please correct your "
"compose.yml file manually!"
"service %s is at version %s, but pinned to %s, please correct your compose."
"yml file manually!"
msgstr ""
#: cli/recipe/upgrade.go:224