Add internationalization support for Japanese and English#5
Open
msakai wants to merge 1 commit into
Open
Conversation
Introduce js/i18n.js that detects locale from ?lang= query parameter or navigator.languages and provides a t() translation function. Replace all hardcoded Japanese strings in title.js, gameOver.js, player.js, and stage.js with t() calls. Dynamically set <html lang>, <title>, and manifest link based on detected language. Add English manifest (manifest.en.json). https://claude.ai/code/session_01QAYkCU7d7Yjvu753eDBMiB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive internationalization (i18n) support to the game, enabling it to display in both Japanese and English based on user language preferences or URL parameters.
Key Changes
js/i18n.js): Created a centralized translation system with message dictionaries for Japanese and English, automatic language detection based on browser language preferences or?lang=URL parameter, with Japanese as the fallback languaget()translation function instead of hardcoded stringsmanifest.en.jsonfor English localization and updatedmanifest.jsonto include language metadataindex.htmlto set document language, update page title, and dynamically load the appropriate manifest file based on detected languageImplementation Details
https://claude.ai/code/session_01QAYkCU7d7Yjvu753eDBMiB