Skip to content

Conversation

@UNIkeEN
Copy link
Owner

@UNIkeEN UNIkeEN commented Jan 7, 2026

Checklist

  • Changes have been tested locally and work as expected.
  • All tests in workflows pass successfully.
  • Documentation has been updated if necessary.
  • Code formatting and commit messages align with the project's conventions.
  • Comments have been added for any complex logic or functionality if possible.

This PR is a ..

  • 🆕 New feature
  • 🐞 Bug fix
  • 🛠 Refactoring
  • ⚡️ Performance improvement
  • 🌐 Internationalization
  • 📄 Documentation improvement
  • 🎨 Code style optimization
  • ❓ Other (Please specify below)

Related Issues

close #1280

Description

  • Please insert your description here and provide info about the "what" this PR is solving.

Additional Context

  • Add any other relevant information or screenshots here.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements dynamic internationalization for window titles of the game log and game error standalone windows. Previously, these windows displayed hard-coded English titles ("Game Log" and "Game Error"). The changes enable these titles to dynamically update based on the launcher's current language setting by using Tauri's setTitle API.

  • Migrates from deprecated getCurrentWebview() to getCurrentWebviewWindow() API
  • Adds i18n support for window titles using new translation keys under Tauri.windowTitle
  • Implements useEffect hooks to set window titles dynamically when components mount

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/pages/standalone/game-log.tsx Adds i18n window title setting with useEffect hook, updates API calls to use getCurrentWebviewWindow
src/pages/standalone/game-error.tsx Adds i18n window title setting with useEffect hook, updates all API references to getCurrentWebviewWindow
src/locales/zh-Hans.json Adds Chinese translations for game log ("游戏日志") and game error ("哎呀!游戏崩溃了") window titles
src/locales/en.json Adds English translations for game log ("Game Logs") and game error ("Oops! The Game Crashed.") window titles
src-tauri/capabilities/default.json Adds required Tauri permission core:window:allow-set-title to enable dynamic window title changes

Comment on lines +2530 to +2535
"Tauri": {
"windowTitle": {
"gameLog": "Game Logs",
"gameError": "Oops! The Game Crashed."
}
},
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.
Co-authored-by: Copilot <[email protected]>
@UNIkeEN UNIkeEN merged commit 702ef98 into main Jan 7, 2026
2 checks passed
@UNIkeEN UNIkeEN deleted the fix/issue-1280 branch January 17, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 游戏日志、游戏崩溃窗口标题没有本地化

2 participants