Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for non-localized Short and Long properties #259

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion check_localizable
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
#
# SPDX-License-Identifier: Apache-2.0

grep -r . --include '*.go' --exclude '*_test.go' -n -e 'fmt\.Errorf("[^"]\+"' -e 'errors.New("[^"]\+"' -e '\(Fatal\|Error\|Info\|Warn\)()\(\.Err(err)\)\?\.Msgf\?("' -e '\.Flags()\.\(String\|Int\|Bool\)\(Slice\)\?\(Var\)\?P\?([^)]\+, \+"[^"]\+")'
grep -r . --include '*.go' --exclude '*_test.go' -n \
-e 'fmt\.Errorf("[^"]\+"' \
-e 'errors.New("[^"]\+"' \
-e '\(Fatal\|Error\|Info\|Warn\)()\(\.Err(err)\)\?\.Msgf\?("' \
-e '\.Flags()\.\(String\|Int\|Bool\)\(Slice\)\?\(Var\)\?P\?([^)]\+, \+"[^"]\+")' \
-e '\(Short\|Long\): \+["`]'

if test $? -eq 0; then
echo "Fix the non localizable strings"
Expand Down
2 changes: 1 addition & 1 deletion mgradm/cmd/gpg/add/gpg.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type gpgAddFlags struct {
func NewCommand(globalFlags *types.GlobalFlags) *cobra.Command {
gpgAddKeyCmd := &cobra.Command{
Use: "add",
Short: "Add gpg keys for 3rd party repositories",
Short: L("Add gpg keys for 3rd party repositories"),
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
var flags gpgAddFlags
Expand Down
3 changes: 2 additions & 1 deletion mgradm/cmd/gpg/gpg.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ package gpg
import (
"github.com/spf13/cobra"
gpgadd "github.com/uyuni-project/uyuni-tools/mgradm/cmd/gpg/add"
. "github.com/uyuni-project/uyuni-tools/shared/l10n"
"github.com/uyuni-project/uyuni-tools/shared/types"
)

// NewCommand import gpg keys from 3rd party repository.
func NewCommand(globalFlags *types.GlobalFlags) *cobra.Command {
gpgKeyCmd := &cobra.Command{
Use: "gpg",
Short: "Manage gpg keys for 3rd party repositories",
Short: L("Manage gpg keys for 3rd party repositories"),
Args: cobra.ExactArgs(1),
}

Expand Down
2 changes: 1 addition & 1 deletion shared/utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Environment variables:

cmd := &cobra.Command{
Use: "config",
Short: "help on configuration file and environment variables",
Short: L("help on configuration file and environment variables"),
}
t := template.Must(template.New("help").Parse(configTemplate))
var helpBuilder strings.Builder
Expand Down