From 931394b36bb59a77453630b0dd178996e93e2661 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 15 Jul 2024 10:15:05 +0800 Subject: [PATCH] feat: Add `yao sui trans` command for automatic translation support --- cmd/root.go | 1 + cmd/sui/build.go | 2 +- cmd/sui/sui.go | 4 + cmd/sui/trans.go | 168 +++++++++++++++++++++++++++++++ cmd/sui/watch.go | 2 +- sui/core/types.go | 1 + sui/storages/local/build.go | 16 ++- sui/storages/local/local_test.go | 2 +- 8 files changed, 190 insertions(+), 6 deletions(-) create mode 100644 cmd/sui/trans.go diff --git a/cmd/root.go b/cmd/root.go index f641a6093..8261f59c5 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -137,6 +137,7 @@ func init() { // Sui suiCmd.AddCommand(sui.WatchCmd) suiCmd.AddCommand(sui.BuildCmd) + suiCmd.AddCommand(sui.TransCmd) rootCmd.AddCommand( versionCmd, diff --git a/cmd/sui/build.go b/cmd/sui/build.go index 795e308de..4fb0fafee 100644 --- a/cmd/sui/build.go +++ b/cmd/sui/build.go @@ -24,7 +24,7 @@ var BuildCmd = &cobra.Command{ Long: L("Build the template"), Run: func(cmd *cobra.Command, args []string) { if len(args) < 2 { - fmt.Fprintln(os.Stderr, color.RedString(L("yao cui build