Skip to content
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
49 changes: 45 additions & 4 deletions src/enums/service-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,44 @@ export enum AccountServiceError {
Invalid = "INVALID",
NotFound = "NOT_FOUND",
TextureError = "TEXTURE_ERROR",
AuthServerError = "AUTH_SERVER_ERROR",
NetworkError = "NETWORK_ERROR",
ParseError = "PARSE_ERROR",
Cancelled = "CANCELLED",
NoDownloadApi = "NO_DOWNLOAD_API",
SaveError = "SAVE_ERROR",
NoMinecraftProfile = "NO_MINECRAFT_PROFILE",
}

export enum InstanceError {
InstanceNotFoundById = "INSTANCE_NOT_FOUND_BY_ID",
ConflictNameError = "CONFLICT_NAME_ERROR",
ServerNbtReadError = "SERVER_NBT_READ_ERROR",
FileNotFoundError = "FILE_NOT_FOUND_ERROR",
InvalidSourcePath = "INVALID_SOURCE_PATH",
FileCreationFailed = "FILE_CREATION_FAILED",
FileCopyFailed = "FILE_COPY_FAILED",
FileMoveFailed = "FILE_MOVE_FAILED",
FolderCreationFailed = "FOLDER_CREATION_FAILED",
WorldNotExistError = "WORLD_NOT_EXSIT_ERROR",
LevelNotExistError = "LEVEL_NOT_EXSIT_ERROR",
ShortcutCreationFailed = "SHORTCUT_CREATION_FAILED",
ZipFileProcessFailed = "ZIP_FILE_PROCESS_FAILED",
WorldNotExistError = "WORLD_NOT_EXIST_ERROR",
LevelParseError = "LEVEL_PARSE_ERROR",
LevelNotExistError = "LEVEL_NOT_EXIST_ERROR",
ConflictNameError = "CONFLICT_NAME_ERROR",
InvalidNameError = "INVALID_NAME_ERROR",
ClientJsonParseError = "CLIENT_JSON_PARSE_ERROR",
AssetIndexParseError = "ASSET_INDEX_PARSE_ERROR",
InstallProfileParseError = "INSTALL_PROFILE_PARSE_ERROR",
ModLoaderVersionParseError = "MOD_LOADER_VERSION_PARSE_ERROR",
ModpackManifestParseError = "MODPACK_MANIFEST_PARSE_ERROR",
CurseForgeFileManifestParseError = "CURSE_FORGE_FILE_MANIFEST_PARSE_ERROR",
NetworkError = "NETWORK_ERROR",
UnsupportedModLoader = "UNSUPPORTED_MOD_LOADER",
NotSupportChangeModLoader = "NOT_SUPPORT_CHANGE_MOD_LOADER",
MainClassNotFound = "MAIN_CLASS_NOT_FOUND",
InstallationDuplicated = "INSTALLATION_DUPLICATED",
ProcessorExecutionFailed = "PROCESSOR_EXECUTION_FAILED",
SemaphoreAcquireFailed = "SEMAPHORE_ACQUIRE_FAILED",
LoaderInstallerNotFound = "LOADER_INSTALLER_NOT_FOUND",
}

export enum ConfigServiceError {
Expand All @@ -29,9 +51,28 @@ export enum ConfigServiceError {
VersionMismatch = "VERSION_MISMATCH",
GameDirAlreadyAdded = "GAME_DIR_ALREADY_ADDED",
GameDirNotExist = "GAME_DIR_NOT_EXIST",
JavaExecInvalid = "JAVA_EXEC_INVALID",
HasActiveDownloadTasks = "HAS_ACTIVE_DOWNLOAD_TASKS",
FileDeletionFailed = "FILE_DELETION_FAILED",
}

export enum ResourceServiceError {
ParseError = "PARSE_ERROR",
NoDownloadApi = "NO_DOWNLOAD_API",
NetworkError = "NETWORK_ERROR",
FileOperationError = "FILE_OPERATION_ERROR",
ClientVersionNotFound = "CLIENT_VERSION_NOT_FOUND",
}

export enum LaunchServiceError {
ModLoaderNotInstalled = "MOD_LOADER_NOT_INSTALLED",
NoSuitableJava = "NO_SUITABLE_JAVA",
SelectedJavaUnavailable = "SELECTED_JAVA_UNAVAILABLE",
GameFilesIncomplete = "GAME_FILES_INCOMPLETE",
SetProcessPriorityFailed = "SET_PROCESS_PRIORITY_FAILED",
ChangeWindowTitleFailed = "CHANGE_WINDOW_TITLE_FAILED",
KillProcessFailed = "KILL_PROCESS_FAILED",
LaunchingStateNotFound = "LAUNCHING_STATE_NOT_FOUND",
AuthlibInjectorNotReady = "AUTHLIB_INJECTOR_NOT_READY",
AuthServerNotFound = "AUTH_SERVER_NOT_FOUND",
}
5 changes: 2 additions & 3 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2090,7 +2090,6 @@
"title": "Failed to validate game files",
"description": {
"MOD_LOADER_NOT_INSTALLED": "Mod loader installation not completed",
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removal makes en.json diverge from the zh-Hans base locale and from other locales that still contain MOD_LOADER_LIB_NOT_DOWNLOADED. Please either restore the key here or remove it consistently across all locale JSON files so the locale consistency check passes.

Suggested change
"MOD_LOADER_NOT_INSTALLED": "Mod loader installation not completed",
"MOD_LOADER_NOT_INSTALLED": "Mod loader installation not completed",
"MOD_LOADER_LIB_NOT_DOWNLOADED": "Required libraries for the mod loader have not been downloaded",

Copilot uses AI. Check for mistakes.
"MOD_LOADER_LIB_NOT_DOWNLOADED": "Mod loader library files not downloaded",
"INSTANCE_NOT_FOUND_BY_ID": "Instance ID does not exist",
"GAME_FILES_INCOMPLETE": "Game files are incomplete",
"LAUNCHING_STATE_NOT_FOUND": "Launching state not found"
Expand Down Expand Up @@ -2365,8 +2364,8 @@
"error": {
"title": "Failed to retrieve world details list",
"description": {
"WORLD_NOT_EXSIT_ERROR": "World not exist",
"LEVEL_NOT_EXSIT_ERROR": "Level data not exist",
"WORLD_NOT_EXIST_ERROR": "World not exist",
"LEVEL_NOT_EXIST_ERROR": "Level data not exist",
Comment on lines +2367 to +2368
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The English copy here is grammatically incorrect. Consider changing to “World does not exist” and “Level data does not exist” (or similar) so the user-facing error reads naturally.

Suggested change
"WORLD_NOT_EXIST_ERROR": "World not exist",
"LEVEL_NOT_EXIST_ERROR": "Level data not exist",
"WORLD_NOT_EXIST_ERROR": "World does not exist",
"LEVEL_NOT_EXIST_ERROR": "Level data does not exist",

Copilot uses AI. Check for mistakes.
"LEVEL_PARSE_ERROR": "Level data parse error"
Comment on lines 2366 to 2369
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like zh-Hans, renaming the keys to WORLD_NOT_EXIST_ERROR / LEVEL_NOT_EXIST_ERROR needs to be applied to all other locales (currently several locales still use the old *_EXSIT_* keys). Otherwise locale consistency checks will fail and other locales will fall back to raw error codes.

Copilot uses AI. Check for mistakes.
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/locales/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -2090,7 +2090,6 @@
"title": "验证游戏文件失败",
"description": {
"MOD_LOADER_NOT_INSTALLED": "模组加载器未完成安装",
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing MOD_LOADER_LIB_NOT_DOWNLOADED from the zh-Hans base locale will make the locale consistency check fail because other locale files still contain this key (they will be treated as “extra keys”). Either keep the key in zh-Hans (and en) or remove it from all other locale JSONs as well (see scripts/locale/diff.js which enforces identical flattened keys).

Suggested change
"MOD_LOADER_NOT_INSTALLED": "模组加载器未完成安装",
"MOD_LOADER_NOT_INSTALLED": "模组加载器未完成安装",
"MOD_LOADER_LIB_NOT_DOWNLOADED": "模组加载器所需库未下载",

Copilot uses AI. Check for mistakes.
"MOD_LOADER_LIB_NOT_DOWNLOADED": "模组加载器库文件未下载",
"INSTANCE_NOT_FOUND_BY_ID": "实例 ID 不存在",
"GAME_FILES_INCOMPLETE": "游戏文件不完整或缺失",
"LAUNCHING_STATE_NOT_FOUND": "启动状态丢失"
Expand Down Expand Up @@ -2365,8 +2364,8 @@
"error": {
"title": "获取世界详细信息失败",
"description": {
"WORLD_NOT_EXSIT_ERROR": "世界不存在",
"LEVEL_NOT_EXSIT_ERROR": "存档数据文件不存在",
"WORLD_NOT_EXIST_ERROR": "世界不存在",
"LEVEL_NOT_EXIST_ERROR": "存档数据文件不存在",
"LEVEL_PARSE_ERROR": "存档数据文件解析错误"
Comment on lines +2367 to 2369
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming the error keys to WORLD_NOT_EXIST_ERROR / LEVEL_NOT_EXIST_ERROR in the zh-Hans base locale requires updating the same keys in all other locales; otherwise the locale diff script will report missing/extra keys and translations for non-zh-Hans locales will fall back to the raw error code.

Suggested change
"WORLD_NOT_EXIST_ERROR": "世界不存在",
"LEVEL_NOT_EXIST_ERROR": "存档数据文件不存在",
"LEVEL_PARSE_ERROR": "存档数据文件解析错误"
"WORLD_NOT_EXIST": "世界不存在",
"LEVEL_NOT_EXIST": "存档数据文件不存在",
"LEVEL_PARSE": "存档数据文件解析错误"

Copilot uses AI. Check for mistakes.
}
}
Expand Down
Loading