瀏覽代碼

chore: prepare v2.0.1

Jacky 2 月之前
父節點
當前提交
fe51a8b4d1
共有 4 個文件被更改,包括 50 次插入42 次删除
  1. 1 1
      app/package.json
  2. 39 39
      app/src/language/generate.ts
  3. 1 1
      app/src/version.json
  4. 9 1
      cmd/translation/gettext.go

+ 1 - 1
app/package.json

@@ -1,7 +1,7 @@
 {
   "name": "nginx-ui-app-next",
   "type": "module",
-  "version": "2.0.0",
+  "version": "2.0.1",
   "packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977",
   "scripts": {
     "dev": "vite --host",

+ 39 - 39
app/src/language/generate.ts

@@ -1,52 +1,52 @@
 // This file is auto-generated. DO NOT EDIT MANUALLY.
 
 export const msg = [
-  $gettext('[Nginx UI] Issued certificate successfully'),
-  $gettext('[Nginx UI] Preparing lego configurations'),
-  $gettext('[Nginx UI] Writing certificate private key to disk'),
+  $gettext('Certificate not found: %{error}'),
+  $gettext('Certificate revoked successfully'),
+  $gettext('Check if /var/run/docker.sock exists. If you are using Nginx UI Official Docker Image, please make sure the docker socket is mounted like this: `-v /var/run/docker.sock:/var/run/docker.sock`. Nginx UI official image uses /var/run/docker.sock to communicate with the host Docker Engine via Docker Client API. This feature is used to control Nginx in another container and perform container replacement rather than binary replacement during OTA upgrades of Nginx UI to ensure container dependencies are also upgraded. If you don\'t need this feature, please add the environment variable NGINX_UI_IGNORE_DOCKER_SOCKET=true to the container.'),
+  $gettext('Check if the nginx PID path exists. By default, this path is obtained from \'nginx -V\'. If it cannot be obtained, an error will be reported. In this case, you need to modify the configuration file to specify the Nginx PID path.Refer to the docs for more details: https://nginxui.com/zh_CN/guide/config-nginx.html#pidpath'),
+  $gettext('Check if the nginx access log path exists. By default, this path is obtained from \'nginx -V\'. If it cannot be obtained or the obtained path does not point to a valid, existing file, an error will be reported. In this case, you need to modify the configuration file to specify the access log path.Refer to the docs for more details: https://nginxui.com/zh_CN/guide/config-nginx.html#accesslogpath'),
+  $gettext('Check if the nginx configuration directory exists'),
   $gettext('Check if the nginx configuration entry file exists'),
+  $gettext('Check if the nginx error log path exists. By default, this path is obtained from \'nginx -V\'. If it cannot be obtained or the obtained path does not point to a valid, existing file, an error will be reported. In this case, you need to modify the configuration file to specify the error log path.Refer to the docs for more details: https://nginxui.com/zh_CN/guide/config-nginx.html#errorlogpath'),
+  $gettext('Check if the nginx.conf includes the conf.d directory'),
+  $gettext('Check if the nginx.conf includes the sites-enabled directory'),
+  $gettext('Check if the nginx.conf includes the streams-enabled directory'),
+  $gettext('Check if the sites-available and sites-enabled directories are under the nginx configuration directory'),
   $gettext('Check if the streams-available and streams-enabled directories are under the nginx configuration directory'),
   $gettext('Docker socket exists'),
-  $gettext('Check if /var/run/docker.sock exists. If you are using Nginx UI Official Docker Image, please make sure the docker socket is mounted like this: `-v /var/run/docker.sock:/var/run/docker.sock`. Nginx UI official image uses /var/run/docker.sock to communicate with the host Docker Engine via Docker Client API. This feature is used to control Nginx in another container and perform container replacement rather than binary replacement during OTA upgrades of Nginx UI to ensure container dependencies are also upgraded. If you don\'t need this feature, please add the environment variable NGINX_UI_IGNORE_DOCKER_SOCKET=true to the container.'),
-  $gettext('[Nginx UI] Obtaining certificate'),
-  $gettext('[Nginx UI] Writing certificate to disk'),
-  $gettext('Sites directory exists'),
-  $gettext('Nginx.conf includes conf.d directory'),
-  $gettext('Log file %{log_path} is not a regular file. If you are using nginx-ui in docker container, please refer to https://nginxui.com/zh_CN/guide/config-nginx-log.html for more information.'),
-  $gettext('[Nginx UI] Creating client facilitates communication with the CA server'),
-  $gettext('[Nginx UI] Reloading nginx'),
-  $gettext('Streams directory exists'),
-  $gettext('Nginx.conf includes streams-enabled directory'),
+  $gettext('Failed to delete certificate from database: %{error}'),
   $gettext('Failed to revoke certificate: %{error}'),
-  $gettext('[Nginx UI] Setting DNS01 challenge provider'),
-  $gettext('[Nginx UI] Environment variables cleaned'),
-  $gettext('[Nginx UI] Backing up current certificate for later revocation'),
-  $gettext('[Nginx UI] Finished'),
-  $gettext('Check if the sites-available and sites-enabled directories are under the nginx configuration directory'),
-  $gettext('Nginx configuration directory exists'),
-  $gettext('Check if the nginx configuration directory exists'),
-  $gettext('[Nginx UI] ACME User: %{name}, Email: %{email}, CA Dir: %{caDir}'),
-  $gettext('[Nginx UI] Setting environment variables'),
-  $gettext('[Nginx UI] Certificate was used for server, reloading server TLS certificate'),
+  $gettext('Log file %{log_path} is not a regular file. If you are using nginx-ui in docker container, please refer to https://nginxui.com/zh_CN/guide/config-nginx-log.html for more information.'),
+  $gettext('Nginx PID path exists'),
   $gettext('Nginx access log path exists'),
-  $gettext('Check if the nginx access log path exists. By default, this path is obtained from \'nginx -V\'. If it cannot be obtained or the obtained path does not point to a valid, existing file, an error will be reported. In this case, you need to modify the configuration file to specify the access log path.Refer to the docs for more details: https://nginxui.com/zh_CN/guide/config-nginx.html#accesslogpath'),
+  $gettext('Nginx configuration directory exists'),
+  $gettext('Nginx configuration entry file exists'),
   $gettext('Nginx error log path exists'),
-  $gettext('Check if the nginx.conf includes the streams-enabled directory'),
-  $gettext('Failed to delete certificate from database: %{error}'),
-  $gettext('[Nginx UI] Setting HTTP01 challenge provider'),
-  $gettext('[Nginx UI] Revoking old certificate'),
-  $gettext('[Nginx UI] Preparing for certificate revocation'),
-  $gettext('[Nginx UI] Revoking certificate'),
-  $gettext('[Nginx UI] Certificate successfully revoked'),
+  $gettext('Nginx.conf includes conf.d directory'),
   $gettext('Nginx.conf includes sites-enabled directory'),
-  $gettext('Check if the nginx.conf includes the conf.d directory'),
-  $gettext('Certificate not found: %{error}'),
-  $gettext('Certificate revoked successfully'),
+  $gettext('Nginx.conf includes streams-enabled directory'),
+  $gettext('Sites directory exists'),
+  $gettext('Streams directory exists'),
+  $gettext('[Nginx UI] ACME User: %{name}, Email: %{email}, CA Dir: %{caDir}'),
+  $gettext('[Nginx UI] Backing up current certificate for later revocation'),
   $gettext('[Nginx UI] Certificate renewed successfully'),
+  $gettext('[Nginx UI] Certificate successfully revoked'),
+  $gettext('[Nginx UI] Certificate was used for server, reloading server TLS certificate'),
+  $gettext('[Nginx UI] Creating client facilitates communication with the CA server'),
+  $gettext('[Nginx UI] Environment variables cleaned'),
+  $gettext('[Nginx UI] Finished'),
+  $gettext('[Nginx UI] Issued certificate successfully'),
+  $gettext('[Nginx UI] Obtaining certificate'),
+  $gettext('[Nginx UI] Preparing for certificate revocation'),
+  $gettext('[Nginx UI] Preparing lego configurations'),
+  $gettext('[Nginx UI] Reloading nginx'),
   $gettext('[Nginx UI] Revocation completed'),
-  $gettext('Nginx configuration entry file exists'),
-  $gettext('Nginx PID path exists'),
-  $gettext('Check if the nginx PID path exists. By default, this path is obtained from \'nginx -V\'. If it cannot be obtained, an error will be reported. In this case, you need to modify the configuration file to specify the Nginx PID path.Refer to the docs for more details: https://nginxui.com/zh_CN/guide/config-nginx.html#pidpath'),
-  $gettext('Check if the nginx error log path exists. By default, this path is obtained from \'nginx -V\'. If it cannot be obtained or the obtained path does not point to a valid, existing file, an error will be reported. In this case, you need to modify the configuration file to specify the error log path.Refer to the docs for more details: https://nginxui.com/zh_CN/guide/config-nginx.html#errorlogpath'),
-  $gettext('Check if the nginx.conf includes the sites-enabled directory'),
+  $gettext('[Nginx UI] Revoking certificate'),
+  $gettext('[Nginx UI] Revoking old certificate'),
+  $gettext('[Nginx UI] Setting DNS01 challenge provider'),
+  $gettext('[Nginx UI] Setting HTTP01 challenge provider'),
+  $gettext('[Nginx UI] Setting environment variables'),
+  $gettext('[Nginx UI] Writing certificate private key to disk'),
+  $gettext('[Nginx UI] Writing certificate to disk'),
 ]

+ 1 - 1
app/src/version.json

@@ -1 +1 @@
-{"version":"2.0.0","build_id":1,"total_build":421}
+{"version":"2.0.1","build_id":1,"total_build":422}

+ 9 - 1
cmd/translation/gettext.go

@@ -8,6 +8,7 @@ import (
 	"path/filepath"
 	"regexp"
 	"runtime"
+	"sort"
 	"strings"
 
 	"github.com/uozi-tech/cosy/logger"
@@ -241,8 +242,15 @@ func generateSingleTSFile(root string, calls map[string]bool) {
 	writer.WriteString("// This file is auto-generated. DO NOT EDIT MANUALLY.\n\n")
 	writer.WriteString("export const msg = [\n")
 
-	// Write each translation message
+	// Extract and sort the translation messages to ensure stable output
+	var messages []string
 	for message := range calls {
+		messages = append(messages, message)
+	}
+	sort.Strings(messages)
+
+	// Write each translation message in sorted order
+	for _, message := range messages {
 		// Escape single quotes and handle newlines in the message for JavaScript
 		escapedMessage := strings.ReplaceAll(message, "'", "\\'")
 		// Replace newlines with space to ensure proper formatting in the generated TS file