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
1 change: 1 addition & 0 deletions src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"core:webview:allow-create-webview-window",
"core:window:allow-show",
"core:window:allow-start-dragging",
"core:window:allow-set-title",
"deep-link:default",
"dialog:default",
"log:default",
Expand Down
6 changes: 6 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2527,6 +2527,12 @@
},
"helper": "Enter the token generated by the device to import from"
},
"Tauri": {
"windowTitle": {
"gameLog": "Game Logs",
"gameError": "Oops! The Game Crashed."
}
},
Comment on lines +2530 to +2535
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

These translation keys are missing from the French (fr.json), Japanese (ja.json), and Traditional Chinese (zh-Hant.json) locale files. The project supports five locales (en, zh-Hans, zh-Hant, fr, ja), and all translations should be added to maintain language consistency. These keys should be inserted in the same position (after "SyncConfigImportModal" and before "Utils") in each missing locale file.

Copilot uses AI. Check for mistakes.
"Utils": {
"datetime": {
"formatRelativeTime": {
Expand Down
6 changes: 6 additions & 0 deletions src/locales/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -2527,6 +2527,12 @@
},
"helper": "请输入需同步设备生成的令牌"
},
"Tauri": {
"windowTitle": {
"gameLog": "游戏日志",
"gameError": "哎呀!游戏崩溃了"
}
},
"Utils": {
"datetime": {
"formatRelativeTime": {
Expand Down
20 changes: 16 additions & 4 deletions src/pages/standalone/game-error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
Tooltip,
VStack,
} from "@chakra-ui/react";
import { getCurrentWebview } from "@tauri-apps/api/webview";
import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow";
import { save } from "@tauri-apps/plugin-dialog";
import { openPath, revealItemInDir } from "@tauri-apps/plugin-opener";
import { useCallback, useEffect, useState } from "react";
Expand Down Expand Up @@ -72,8 +72,18 @@ const GameErrorPage: React.FC = () => {
setBasicInfoParams(infoList);
}, [config.basicInfo, platformName]);

// set window title with i18n
useEffect(() => {
let launchingId = parseIdFromWindowLabel(getCurrentWebview().label);
(async () => {
await getCurrentWebviewWindow().setTitle(
t("Tauri.windowTitle.gameError")
);
})();
}, [t]);

// retrieve states and logs (for crash analysis)
useEffect(() => {
let launchingId = parseIdFromWindowLabel(getCurrentWebviewWindow().label);

LaunchService.retrieveGameLaunchingState(launchingId).then((response) => {
if (response.status === "success") {
Expand Down Expand Up @@ -122,7 +132,9 @@ const GameErrorPage: React.FC = () => {
};

const handleOpenLogWindow = async () => {
let launchingId = parseIdFromWindowLabel(getCurrentWebview()?.label || "");
let launchingId = parseIdFromWindowLabel(
getCurrentWebviewWindow()?.label || ""
);
if (launchingId) {
await LaunchService.openGameLogWindow(launchingId);
}
Expand All @@ -137,7 +149,7 @@ const GameErrorPage: React.FC = () => {
const savePath = await save({
defaultPath: `minecraft-exported-crash-info-${timestamp}.zip`,
});
let launchingId = parseIdFromWindowLabel(getCurrentWebview().label);
let launchingId = parseIdFromWindowLabel(getCurrentWebviewWindow().label);
if (!savePath || !launchingId) return;
setIsLoading(true);
const res = await LaunchService.exportGameCrashInfo(launchingId, savePath);
Expand Down
11 changes: 9 additions & 2 deletions src/pages/standalone/game-log.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Tooltip,
} from "@chakra-ui/react";
import { appLogDir, join } from "@tauri-apps/api/path";
import { getCurrentWebview } from "@tauri-apps/api/webview";
import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow";
import { revealItemInDir } from "@tauri-apps/plugin-opener";
import { useEffect, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
Expand Down Expand Up @@ -41,11 +41,18 @@ const GameLogPage: React.FC = () => {

const clearLogs = () => setLogs([]);

// set window title with i18n
useEffect(() => {
(async () => {
await getCurrentWebviewWindow().setTitle(t("Tauri.windowTitle.gameLog"));
})();
}, [t]);

// invoke retrieve on first load
useEffect(() => {
(async () => {
launchingIdRef.current = parseIdFromWindowLabel(
getCurrentWebview().label
getCurrentWebviewWindow().label
);
const launchingId = launchingIdRef.current;
if (launchingId) {
Expand Down
Loading