Skip to content

i18n: extract booting splash tips into translatable string resources#1350

Merged
utkarshdalal merged 4 commits into
utkarshdalal:masterfrom
linkq:i18n/booting-splash-tips
May 12, 2026
Merged

i18n: extract booting splash tips into translatable string resources#1350
utkarshdalal merged 4 commits into
utkarshdalal:masterfrom
linkq:i18n/booting-splash-tips

Conversation

@linkq
Copy link
Copy Markdown
Contributor

@linkq linkq commented May 2, 2026

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

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #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.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in 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_container and option_test_graphics to match UI labels.

  • New Features

    • 24 tips added as game_launch_tip_1..24 across 14 locales; updated ES translations.
  • Refactors

    • BootingSplash now reads tips via context.getString; uses remember(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

  • New Features
    • Added a set of game launch tips shown during startup to help with setup, troubleshooting, and controls.
    • Localized the tips for many languages/regions (Danish, German, Spanish, French, Italian, Korean, Polish, Portuguese‑BR, Romanian, Russian, Ukrainian, Simplified and Traditional Chinese, and default).
    • Tips now come from the app’s localized resources for consistent translations.

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.
@linkq linkq requested a review from utkarshdalal as a code owner May 2, 2026 16:30
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 2, 2026

📝 Walkthrough

Walkthrough

Replaced BootingSplash's hardcoded tips with localized Android string resources (R.string.game_launch_tip_1game_launch_tip_24), switched tips memoization to remember(context), added matching localized strings across multiple res/values* files, and added BOM markers in several resource files.

Changes

Game Launch Tips Localization

Layer / File(s) Summary
String Resource Definitions
app/src/main/res/values/strings.xml, app/src/main/res/values-*/strings.xml
Added game_launch_tip_1game_launch_tip_24 to default and language-specific resource files (DA, DE, ES, FR, IT, KO, PL, PT-BR, RO, RU, UK, ZH-CN, ZH-TW). Some strings include %s placeholders and files show a leading UTF-8 BOM on the <resources> tag.
Component Implementation
app/src/main/java/app/gamenative/ui/components/BootingSplash.kt
Imported LocalContext and R. Replaced hardcoded tips with context.getString(R.string.game_launch_tip_*) lookups and changed memoization to remember(context). Tip index logic and function signature unchanged.
Minor / Metadata
app/src/main/res/...
Inserted <!-- Game Launch Tips --> comment blocks adjacent to the new strings. No public API or exported signatures altered.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

"I hopped in with a pocket of strings,
Twenty-four tongues tucked under my wings.
I remembered the Context, I kept each rhyme—
Tips now appear in the right place and time. 🐰✨"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: extracting hardcoded booting splash tips into translatable string resources for internationalization purposes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description provides comprehensive details about the changes, including purpose, implementation approach, and locale coverage. The description template sections are partially addressed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5cae2a3 and efb46b2.

📒 Files selected for processing (15)
  • app/src/main/java/app/gamenative/ui/components/BootingSplash.kt
  • app/src/main/res/values-da/strings.xml
  • app/src/main/res/values-de/strings.xml
  • app/src/main/res/values-es/strings.xml
  • app/src/main/res/values-fr/strings.xml
  • app/src/main/res/values-it/strings.xml
  • app/src/main/res/values-ko/strings.xml
  • app/src/main/res/values-pl/strings.xml
  • app/src/main/res/values-pt-rBR/strings.xml
  • app/src/main/res/values-ro/strings.xml
  • app/src/main/res/values-ru/strings.xml
  • app/src/main/res/values-uk/strings.xml
  • app/src/main/res/values-zh-rCN/strings.xml
  • app/src/main/res/values-zh-rTW/strings.xml
  • app/src/main/res/values/strings.xml

Comment thread app/src/main/res/values-es/strings.xml Outdated
Comment thread app/src/main/res/values-it/strings.xml Outdated
Comment thread app/src/main/res/values-ru/strings.xml Outdated
Comment thread app/src/main/res/values/strings.xml
Comment thread app/src/main/res/values/strings.xml Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment thread app/src/main/res/values/strings.xml Outdated
Comment thread app/src/main/res/values-fr/strings.xml Outdated
Comment thread app/src/main/res/values-zh-rCN/strings.xml Outdated
@utkarshdalal
Copy link
Copy Markdown
Owner

Thank you

@utkarshdalal utkarshdalal merged commit 63a3b54 into utkarshdalal:master May 12, 2026
3 checks passed
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.

2 participants