i18n: extract booting splash tips into translatable string resources#1350
Conversation
Move 24 hardcoded English tips from BootingSplash.kt into translatable string resources (game_launch_tip_1..24) across all 14 supported languages. Tips referencing menu items use format specifiers tied to option_open_container and option_test_graphics so the displayed name always matches the actual menu label.
📝 WalkthroughWalkthroughReplaced BootingSplash's hardcoded tips with localized Android string resources ( ChangesGame Launch Tips Localization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/src/main/res/values-es/strings.xml`:
- Line 1454: The string resource game_launch_tip_5 contains redundant wording
"Prueba la prueba de Direct3D"; update the value for the string name
"game_launch_tip_5" to use a less repetitive verb (e.g., "Ejecuta la prueba de
Direct3D" or "Realiza la prueba de Direct3D") while preserving the rest of the
sentence and the \"%s\" placeholder so the message reads naturally in Spanish.
In `@app/src/main/res/values-it/strings.xml`:
- Line 1451: The Italian string game_launch_tip_12 contains an unrecognized
escape sequence "A:\_CommonRedist"; fix it the same way as the English tip_12 by
escaping the backslash so the path is emitted correctly (use a double backslash
before the underscore, i.e., change the value of game_launch_tip_12 to use
A:\\_CommonRedist).
In `@app/src/main/res/values-ru/strings.xml`:
- Line 1388: The string resource game_launch_tip_12 uses "\_" which is
inconsistent and may drop the backslash; update the value so the literal
backslash is escaped with a second backslash (use "\\_" in the resource text) so
the rendered path is "A:\_CommonRedist" as intended; modify the string named
game_launch_tip_12 to replace the single backslash escape with a
double-backslash escape.
In `@app/src/main/res/values/strings.xml`:
- Line 1505: The string resource game_launch_tip_12 contains an invalid escape
sequence `\_`; update its value so literal backslashes are escaped (e.g., use
`\\_` in the path) so the path appears as A:\_CommonRedist at runtime; locate
the string named "game_launch_tip_12" and replace the single backslash before
the underscore with a double backslash following the established `\\` path
convention used elsewhere.
- Line 1495: In BootingSplash.kt the format argument for the tip string is
wrong: locate the use of context.getString(R.string.game_launch_tip_5,
context.getString(R.string.option_open_container)) and replace the second
parameter so it uses context.getString(R.string.option_test_graphics) instead
(i.e., call context.getString(R.string.game_launch_tip_5,
context.getString(R.string.option_test_graphics))) to match the intended
placeholder in game_launch_tip_5.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 12afa55d-1dd4-4060-b2b5-f046156fa9bd
📒 Files selected for processing (15)
app/src/main/java/app/gamenative/ui/components/BootingSplash.ktapp/src/main/res/values-da/strings.xmlapp/src/main/res/values-de/strings.xmlapp/src/main/res/values-es/strings.xmlapp/src/main/res/values-fr/strings.xmlapp/src/main/res/values-it/strings.xmlapp/src/main/res/values-ko/strings.xmlapp/src/main/res/values-pl/strings.xmlapp/src/main/res/values-pt-rBR/strings.xmlapp/src/main/res/values-ro/strings.xmlapp/src/main/res/values-ru/strings.xmlapp/src/main/res/values-uk/strings.xmlapp/src/main/res/values-zh-rCN/strings.xmlapp/src/main/res/values-zh-rTW/strings.xmlapp/src/main/res/values/strings.xml
There was a problem hiding this comment.
3 issues found across 15 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/src/main/res/values-fr/strings.xml">
<violation number="1" location="app/src/main/res/values-fr/strings.xml:1455">
P3: The `A:\_CommonRedist` path is mis-escaped; Android will drop the backslash and render the instruction incorrectly.</violation>
</file>
<file name="app/src/main/res/values-zh-rCN/strings.xml">
<violation number="1" location="app/src/main/res/values-zh-rCN/strings.xml:1528">
P3: The Windows-style path is not escaped correctly for Android string resources, so the backslash will be dropped and the displayed path will be wrong.</violation>
</file>
<file name="app/src/main/res/values/strings.xml">
<violation number="1" location="app/src/main/res/values/strings.xml:1505">
P2: `\_` is not a recognized Android string escape sequence. Only `\'`, `\"`, `\@`, `\?`, `\n`, `\t`, `\uXXXX`, and `\\` are documented escapes. AAPT2 may silently drop the backslash, rendering the path as `A:_CommonRedist` instead of `A:\_CommonRedist`. Use `A:\\_CommonRedist` to produce a literal backslash.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
Thank you |
Move 24 hardcoded English tips from BootingSplash.kt into translatable string resources (game_launch_tip_1..24) across all 14 supported languages.
Tips referencing menu items use format specifiers tied to option_open_container and option_test_graphics so the displayed name always matches the actual menu label.
Description
Extract 24 hardcoded booting splash tips from BootingSplash.kt into translatable string resources (game_launch_tip_1..24) across all 14 supported languages (da, de, en, es, fr, it, ko, pl, pt-BR, ro, ru, uk, zh-CN, zh-TW).
Previously these tips were inline English strings in Kotlin code with no translation support, so users of non-English locales always saw English tips during game startup. Now each locale can provide its own translated tips.
Tips referencing menu items (Open Container, Test Graphics) use %s format specifiers tied to option_open_container and option_test_graphics, so the displayed name always matches the actual UI label regardless of locale. Apostrophes and double quotes use ' / " backslash escaping, consistent with the existing codebase convention.
Recording
14a96620b7c1632ebd959f077d48b083_raw.mp4
1514939969f40050d045d48acf470a36_raw.mp4
To demonstrate the internationalization of tips, the rotation speed of tips in the video has been accelerated, while the actual rotation speed remains 8 seconds.
Type of Change
Checklist
#code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.CONTRIBUTING.md.Summary by cubic
Localized the booting splash tips by moving 24 hardcoded strings into translatable resources, so users see tips in their language. Tips referencing menu items now use format strings tied to
option_open_containerandoption_test_graphicsto match UI labels.New Features
game_launch_tip_1..24across 14 locales; updated ES translations.Refactors
BootingSplashnow reads tips viacontext.getString; usesremember(context)so tips update with locale changes; removed inline English strings; fixed tip 12 path to use double backslashes (A:\\_CommonRedist) across all locales.Written for commit f0614ff. Summary will update on new commits.
Summary by CodeRabbit