Skip to content

Commit

Permalink
Usage strings should not be localized
Browse files Browse the repository at this point in the history
  • Loading branch information
sibprogrammer committed May 15, 2021
1 parent db6e0fe commit 3f795d6
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 34 deletions.
2 changes: 1 addition & 1 deletion cmd/apps/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

var deployCmd = &cobra.Command{
Use: locales.L.Get("app.deploy.cmd"),
Use: "deploy [PATH]",
Short: locales.L.Get("app.deploy.description"),
RunE: func(cmd *cobra.Command, args []string) error {
path, err := filepath.Abs(".")
Expand Down
2 changes: 1 addition & 1 deletion cmd/apps/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

var registerCmd = &cobra.Command{
Use: locales.L.Get("app.register.cmd"),
Use: "register [SERVER] [DOMAIN] [PATH]",
Short: locales.L.Get("app.register.description"),
RunE: func(cmd *cobra.Command, args []string) error {
sPath, _ := cmd.Flags().GetString("target-path")
Expand Down
2 changes: 1 addition & 1 deletion cmd/databases/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

var createCmd = &cobra.Command{
Use: locales.L.Get("database.create.cmd"),
Use: "create [SERVER] [DOMAIN] [NAME]",
Short: locales.L.Get("database.create.description"),
RunE: func(cmd *cobra.Command, args []string) error {
var realdbt string = ""
Expand Down
2 changes: 1 addition & 1 deletion cmd/databases/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

var deleteCmd = &cobra.Command{
Use: locales.L.Get("database.delete.cmd"),
Use: "delete [SERVER] [NAME]",
Short: locales.L.Get("database.delete.description"),
RunE: func(cmd *cobra.Command, args []string) error {
server, err := config.GetServer(args[0])
Expand Down
2 changes: 1 addition & 1 deletion cmd/databases/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

var listCmd = &cobra.Command{
Use: locales.L.Get("database.list.cmd"),
Use: "list [SERVER] [DOMAIN]",
Short: locales.L.Get("database.list.description"),
RunE: func(cmd *cobra.Command, args []string) error {
server, err := config.GetServer(args[0])
Expand Down
2 changes: 1 addition & 1 deletion cmd/databases/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

var uploadCmd = &cobra.Command{
Use: locales.L.Get("database.deploy.cmd"),
Use: "upload [SERVER] [DOMAIN] [NAME] [FILE]",
Short: locales.L.Get("database.deploy.description"),
RunE: func(cmd *cobra.Command, args []string) error {
server, err := config.GetServer(args[0])
Expand Down
2 changes: 1 addition & 1 deletion cmd/domains/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

var createCmd = &cobra.Command{
Use: locales.L.Get("domain.create.cmd"),
Use: "create [SERVER] [DOMAIN] [IPv4] [IPv6]",
Short: locales.L.Get("domain.create.description"),
RunE: func(cmd *cobra.Command, args []string) error {
addr4 := []string{}
Expand Down
2 changes: 1 addition & 1 deletion cmd/domains/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

var listCmd = &cobra.Command{
Use: locales.L.Get("domain.list.cmd"),
Use: "list [SERVER]",
Short: locales.L.Get("domain.list.description"),
RunE: func(cmd *cobra.Command, args []string) error {
server, err := config.GetServer(args[0])
Expand Down
2 changes: 1 addition & 1 deletion cmd/domains/reload.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

var reloadCmd = &cobra.Command{
Use: locales.L.Get("domain.reload.cmd"),
Use: "reload [SERVER]",
Short: locales.L.Get("domain.reload.description"),
RunE: func(cmd *cobra.Command, args []string) error {
server, err := config.GetServer(args[0])
Expand Down
2 changes: 1 addition & 1 deletion cmd/domains/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

var deleteCmd = &cobra.Command{
Use: locales.L.Get("domain.delete.cmd"),
Use: "delete [SERVER] [DOMAIN...]",
Short: locales.L.Get("domain.delete.description"),
RunE: func(cmd *cobra.Command, args []string) error {
var lastErr error = nil
Expand Down
2 changes: 1 addition & 1 deletion cmd/servers/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

var deleteCmd = &cobra.Command{
Use: locales.L.Get("server.delete.cmd"),
Use: "delete [IP ADDRESS|HOSTNAME ...]",
Short: locales.L.Get("server.delete.description"),
Run: func(cmd *cobra.Command, args []string) {
for _, host := range args {
Expand Down
2 changes: 1 addition & 1 deletion cmd/servers/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

var listCmd = &cobra.Command{
Use: locales.L.Get("server.list.cmd"),
Use: "list",
Short: locales.L.Get("server.list.description"),
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
Expand Down
2 changes: 1 addition & 1 deletion cmd/servers/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

var loginCmd = &cobra.Command{
Use: locales.L.Get("server.login.cmd"),
Use: "login [SERVER]",
Short: locales.L.Get("server.login.description"),
RunE: func(cmd *cobra.Command, args []string) error {
generateOnly, _ := cmd.Flags().GetBool("generate")
Expand Down
2 changes: 1 addition & 1 deletion cmd/servers/reauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

var reauthCmd = &cobra.Command{
Use: locales.L.Get("server.reauth.cmd"),
Use: "reauth [IP ADDRESS|HOSTNAME]",
Short: locales.L.Get("server.reauth.description"),
RunE: func(cmd *cobra.Command, args []string) error {
server, err := config.GetServer(args[0])
Expand Down
2 changes: 1 addition & 1 deletion cmd/servers/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

var registerCmd = &cobra.Command{
Use: locales.L.Get("server.register.cmd"),
Use: "register [IP ADDRESS|HOSTNAME]",
Short: locales.L.Get("server.register.description"),
RunE: func(cmd *cobra.Command, args []string) error {
ignoreSsl, _ := cmd.Flags().GetBool("ignore-ssl")
Expand Down
2 changes: 1 addition & 1 deletion cmd/servers/reload.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

var reloadCmd = &cobra.Command{
Use: locales.L.Get("server.reload.cmd"),
Use: "reload [IP ADDRESS|HOSTNAME]",
Short: locales.L.Get("server.reload.description"),
RunE: func(cmd *cobra.Command, args []string) error {
server, err := config.GetServer(args[0])
Expand Down
2 changes: 1 addition & 1 deletion cmd/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

var SyncCmd = &cobra.Command{
Use: locales.L.Get("files.upload.cmd"),
Use: "sync [SERVER] [DOMAIN] [FILE ...]",
Short: locales.L.Get("files.upload.description"),
RunE: func(cmd *cobra.Command, args []string) error {
var lastErr error = nil
Expand Down
17 changes: 0 additions & 17 deletions locales/locales.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ func init() {
defs = map[string]map[string]string{
"en_US": {
"app.description": "Manage local applications",
"app.deploy.cmd": "deploy [PATH]",
"app.deploy.description": "Deploy application in set PATH to DOMAIN on SERVER",
"app.deploy.success": "Application in %s successfully deployed",
"app.register.cmd": "register [SERVER] [DOMAIN] [PATH]",
"app.register.description": "Register a new appliation in the specified path",
"app.register.success": "New app registered in %s",
"app.register.features.flag": "Features necessary for the application",
Expand All @@ -53,55 +51,40 @@ func init() {
"app.register.flag.feature.unknown": "Unknown feature %s, skipping",

"database.description": "Manage databases on the server",
"database.create.cmd": "create [SERVER] [DOMAIN] [NAME]",
"database.create.description": "Create a database of specified type on the server",
"database.create.flag.type": "Type of the database server: mysql (default), mssql, or postgresql",
"database.create.success": "Database %s successfully created",
"database.delete.cmd": "delete [SERVER] [NAME]",
"database.delete.description": "Delete database from the server",
"database.delete.success": "Database %s successfully deleted",
"database.list.cmd": "list [SERVER] [DOMAIN]",
"database.list.description": "List databases on server, optionally filtered by domain",
"database.deploy.cmd": "upload [SERVER] [DOMAIN] [NAME] [FILE]",
"database.deploy.description": "Upload an SQL dump file to the server and deploy it",
"database.deploy.success": "Database %s successfully deployed from dump %s",

"domain.description": "Manage domains on the server",
"domain.create.cmd": "create [SERVER] [DOMAIN] [IPv4] [IPv6]",
"domain.create.description": "Create a new domain on the server with specific IPv4 & IPv6 addresses",
"domain.create.success": "Domain %s successfully created",
"domain.list.cmd": "list [SERVER]",
"domain.list.description": "List domains on the specific server",
"domain.delete.cmd": "delete [SERVER] [DOMAIN...]",
"domain.delete.description": "Delete domain(s) from the specified server",
"domain.delete.success": "Domain successfully deleted",
"domain.reload.cmd": "reload [SERVER]",
"domain.reload.description": "Reload cached domains for the specified server",
"domain.reload.success": "Domains successfully reloaded",

"files.upload.cmd": "sync [SERVER] [DOMAIN] [FILE ...]",
"files.upload.description": "Upload files to the target domain",
"files.upload.flag.overwrite": "Overwrite existing files",
"files.upload.flag.dry-run": "Do not upload files, only show actions",
"files.upload.success": "Files successfully uploaded",

"server.description": "Manage known servers",
"server.delete.cmd": "delete [IP ADDRESS|HOSTNAME ...]",
"server.delete.description": "Remove registered server(s) and flush API key(s)",
"server.delete.success": "Server %s removed",
"server.list.cmd": "list",
"server.list.description": "List registered servers",
"server.register.cmd": "register [IP ADDRESS|HOSTNAME]",
"server.register.description": "Register a new server on this device",
"server.register.ignore.ssl.flag": "Ignore SSL certificate mismatch",
"server.register.success": "Server successfully registered",
"server.reload.cmd": "reload [IP ADDRESS|HOSTNAME]",
"server.reload.description": "Reload cached server data",
"server.reload.success": "Server data successfully reloaded",
"server.reauth.cmd": "reauth [IP ADDRESS|HOSTNAME]",
"server.reauth.description": "Update server API key",
"server.reauth.success": "Server successfully re-authenticated",
"server.login.cmd": "login [SERVER]",
"server.login.description": "Automatic login to the specified server",
"server.login.success": "Generated login link: %s",
"server.login.generate.flag": "Only generate the link (without autologin attempt)",
Expand Down

0 comments on commit 3f795d6

Please sign in to comment.