From eecfcfb3765aca1eeb5dae8fca80686f827f0779 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Wed, 25 Jan 2017 22:21:28 -0800 Subject: [PATCH] Extract strings for the 'kubectl set' family of commands. --- pkg/kubectl/cmd/set/BUILD | 1 + pkg/kubectl/cmd/set/set.go | 3 ++- pkg/kubectl/cmd/set/set_image.go | 3 ++- pkg/kubectl/cmd/set/set_resources.go | 3 ++- pkg/kubectl/cmd/set/set_selector.go | 3 ++- .../kubectl/default/LC_MESSAGES/k8s.mo | Bin 3193 -> 3752 bytes .../kubectl/default/LC_MESSAGES/k8s.po | 22 +++++++++++++++++- translations/kubectl/en_US/LC_MESSAGES/k8s.mo | Bin 3193 -> 3752 bytes translations/kubectl/en_US/LC_MESSAGES/k8s.po | 22 +++++++++++++++++- 9 files changed, 51 insertions(+), 6 deletions(-) diff --git a/pkg/kubectl/cmd/set/BUILD b/pkg/kubectl/cmd/set/BUILD index f7d49bfc252..fe0fee4dda5 100644 --- a/pkg/kubectl/cmd/set/BUILD +++ b/pkg/kubectl/cmd/set/BUILD @@ -24,6 +24,7 @@ go_library( "//pkg/kubectl/cmd/templates:go_default_library", "//pkg/kubectl/cmd/util:go_default_library", "//pkg/kubectl/resource:go_default_library", + "//pkg/util/i18n:go_default_library", "//vendor:github.com/spf13/cobra", "//vendor:k8s.io/apimachinery/pkg/api/errors", "//vendor:k8s.io/apimachinery/pkg/api/meta", diff --git a/pkg/kubectl/cmd/set/set.go b/pkg/kubectl/cmd/set/set.go index bb2fb28ddeb..544c69ecbf1 100644 --- a/pkg/kubectl/cmd/set/set.go +++ b/pkg/kubectl/cmd/set/set.go @@ -22,6 +22,7 @@ import ( "github.com/spf13/cobra" "k8s.io/kubernetes/pkg/kubectl/cmd/templates" cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" + "k8s.io/kubernetes/pkg/util/i18n" ) var ( @@ -34,7 +35,7 @@ var ( func NewCmdSet(f cmdutil.Factory, out, err io.Writer) *cobra.Command { cmd := &cobra.Command{ Use: "set SUBCOMMAND", - Short: "Set specific features on objects", + Short: i18n.T("Set specific features on objects"), Long: set_long, Run: cmdutil.DefaultSubCommandRun(err), } diff --git a/pkg/kubectl/cmd/set/set_image.go b/pkg/kubectl/cmd/set/set_image.go index 8b43902353c..f4cdd75c413 100644 --- a/pkg/kubectl/cmd/set/set_image.go +++ b/pkg/kubectl/cmd/set/set_image.go @@ -29,6 +29,7 @@ import ( "k8s.io/kubernetes/pkg/kubectl/cmd/templates" cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" "k8s.io/kubernetes/pkg/kubectl/resource" + "k8s.io/kubernetes/pkg/util/i18n" ) // ImageOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of @@ -91,7 +92,7 @@ func NewCmdImage(f cmdutil.Factory, out, err io.Writer) *cobra.Command { cmd := &cobra.Command{ Use: "image (-f FILENAME | TYPE NAME) CONTAINER_NAME_1=CONTAINER_IMAGE_1 ... CONTAINER_NAME_N=CONTAINER_IMAGE_N", - Short: "Update image of a pod template", + Short: i18n.T("Update image of a pod template"), Long: image_long, Example: image_example, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/kubectl/cmd/set/set_resources.go b/pkg/kubectl/cmd/set/set_resources.go index 85e595009b0..4edb588c06c 100644 --- a/pkg/kubectl/cmd/set/set_resources.go +++ b/pkg/kubectl/cmd/set/set_resources.go @@ -32,6 +32,7 @@ import ( "k8s.io/kubernetes/pkg/kubectl/cmd/templates" cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" "k8s.io/kubernetes/pkg/kubectl/resource" + "k8s.io/kubernetes/pkg/util/i18n" ) var ( @@ -98,7 +99,7 @@ func NewCmdResources(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra. cmd := &cobra.Command{ Use: "resources (-f FILENAME | TYPE NAME) ([--limits=LIMITS & --requests=REQUESTS]", - Short: "Update resource requests/limits on objects with pod templates", + Short: i18n.T("Update resource requests/limits on objects with pod templates"), Long: fmt.Sprintf(resources_long, strings.Join(resourceTypesWithPodTemplate, ", ")), Example: resources_example, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/kubectl/cmd/set/set_selector.go b/pkg/kubectl/cmd/set/set_selector.go index 2d2f339addb..ea486b87128 100644 --- a/pkg/kubectl/cmd/set/set_selector.go +++ b/pkg/kubectl/cmd/set/set_selector.go @@ -31,6 +31,7 @@ import ( "k8s.io/kubernetes/pkg/kubectl/cmd/templates" cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" "k8s.io/kubernetes/pkg/kubectl/resource" + "k8s.io/kubernetes/pkg/util/i18n" ) // SelectorOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of @@ -78,7 +79,7 @@ func NewCmdSelector(f cmdutil.Factory, out io.Writer) *cobra.Command { cmd := &cobra.Command{ Use: "selector (-f FILENAME | TYPE NAME) EXPRESSIONS [--resource-version=version]", - Short: "Set the selector on a resource", + Short: i18n.T("Set the selector on a resource"), Long: fmt.Sprintf(selectorLong, validation.LabelValueMaxLength), Example: selectorExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/translations/kubectl/default/LC_MESSAGES/k8s.mo b/translations/kubectl/default/LC_MESSAGES/k8s.mo index 90d9d4ec222776f76a422f1d8bdb487e9441c296..c25434f58f3c6c584247ef3a4859dd88e5d49557 100644 GIT binary patch delta 984 zcmcK0!AlfT9KiA4Zj+jtl@;qj>!B7)uxO>wnz?ug@hGw{8%uG4K!x_Aium5u+~oABYG0&h9FCFc9&u(@GQU|z-@k=6)SpV86(u*xkRZ|!irV&rZK$mE9}P4xQV}! zdkPJb>%ts|`+oo91zH(nEclx=`7~dM#=D#0E_<@XYhz-#}k~`EJ8PbnqQ}IXG~d zl#8S-7iY!69^`LO;^6(=nWvub>-%eFo@cIupPs1EWuJ>Ek-g*<*-egG48#fU;wf(8 zZ{}J~nq~cnD`p>SxZEO5<13D1(Uummnt6m()-Sj!ManzPiMDW^gE}tZK&v#&$9C`r zFI;Jg{RK}7@i6li1J(^3!9SeGq4u<)Z8QxXV?SPIK4F>f>x;=42X;QSf~N8f9KAoSGFs7lP#7eY4!jzDhVV5hnNEfw}h0$>%>R0X04V diff --git a/translations/kubectl/default/LC_MESSAGES/k8s.po b/translations/kubectl/default/LC_MESSAGES/k8s.po index da2228eb70b..27c8e31c0f8 100644 --- a/translations/kubectl/default/LC_MESSAGES/k8s.po +++ b/translations/kubectl/default/LC_MESSAGES/k8s.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: gettext-go-examples-hello\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-12 20:03+0000\n" -"PO-Revision-Date: 2017-01-27 20:30-0800\n" +"PO-Revision-Date: 2017-01-29 14:45-0800\n" "Last-Translator: Brendan Burns \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -108,3 +108,23 @@ msgstr "Sets the current-context in a kubeconfig file" msgctxt "Display merged kubeconfig settings or a specified kubeconfig file" msgid "Display merged kubeconfig settings or a specified kubeconfig file" msgstr "Display merged kubeconfig settings or a specified kubeconfig file" + +# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/set/set.go#L37 +msgctxt "Set specific features on objects" +msgid "Set specific features on objects" +msgstr "Set specific features on objects" + +# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/set/set_image.go#L94 +msgctxt "Update image of a pod template" +msgid "Update image of a pod template" +msgstr "Update image of a pod template" + +# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/set/set_resources.go#L101 +msgctxt "Update resource requests/limits on objects with pod templates" +msgid "Update resource requests/limits on objects with pod templates" +msgstr "Update resource requests/limits on objects with pod templates" + +# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/set/set_selector.go#L81 +msgctxt "Set the selector on a resource" +msgid "Set the selector on a resource" +msgstr "Set the selector on a resource" diff --git a/translations/kubectl/en_US/LC_MESSAGES/k8s.mo b/translations/kubectl/en_US/LC_MESSAGES/k8s.mo index 90d9d4ec222776f76a422f1d8bdb487e9441c296..c25434f58f3c6c584247ef3a4859dd88e5d49557 100644 GIT binary patch delta 984 zcmcK0!AlfT9KiA4Zj+jtl@;qj>!B7)uxO>wnz?ug@hGw{8%uG4K!x_Aium5u+~oABYG0&h9FCFc9&u(@GQU|z-@k=6)SpV86(u*xkRZ|!irV&rZK$mE9}P4xQV}! zdkPJb>%ts|`+oo91zH(nEclx=`7~dM#=D#0E_<@XYhz-#}k~`EJ8PbnqQ}IXG~d zl#8S-7iY!69^`LO;^6(=nWvub>-%eFo@cIupPs1EWuJ>Ek-g*<*-egG48#fU;wf(8 zZ{}J~nq~cnD`p>SxZEO5<13D1(Uummnt6m()-Sj!ManzPiMDW^gE}tZK&v#&$9C`r zFI;Jg{RK}7@i6li1J(^3!9SeGq4u<)Z8QxXV?SPIK4F>f>x;=42X;QSf~N8f9KAoSGFs7lP#7eY4!jzDhVV5hnNEfw}h0$>%>R0X04V diff --git a/translations/kubectl/en_US/LC_MESSAGES/k8s.po b/translations/kubectl/en_US/LC_MESSAGES/k8s.po index da2228eb70b..27c8e31c0f8 100644 --- a/translations/kubectl/en_US/LC_MESSAGES/k8s.po +++ b/translations/kubectl/en_US/LC_MESSAGES/k8s.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: gettext-go-examples-hello\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-12 20:03+0000\n" -"PO-Revision-Date: 2017-01-27 20:30-0800\n" +"PO-Revision-Date: 2017-01-29 14:45-0800\n" "Last-Translator: Brendan Burns \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -108,3 +108,23 @@ msgstr "Sets the current-context in a kubeconfig file" msgctxt "Display merged kubeconfig settings or a specified kubeconfig file" msgid "Display merged kubeconfig settings or a specified kubeconfig file" msgstr "Display merged kubeconfig settings or a specified kubeconfig file" + +# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/set/set.go#L37 +msgctxt "Set specific features on objects" +msgid "Set specific features on objects" +msgstr "Set specific features on objects" + +# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/set/set_image.go#L94 +msgctxt "Update image of a pod template" +msgid "Update image of a pod template" +msgstr "Update image of a pod template" + +# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/set/set_resources.go#L101 +msgctxt "Update resource requests/limits on objects with pod templates" +msgid "Update resource requests/limits on objects with pod templates" +msgstr "Update resource requests/limits on objects with pod templates" + +# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/set/set_selector.go#L81 +msgctxt "Set the selector on a resource" +msgid "Set the selector on a resource" +msgstr "Set the selector on a resource"