Skip to content

fix: use correct locale keys in TutorialHelp component (fixes #348)#358

Open
colsonSung wants to merge 1 commit intosiddharthvaddem:mainfrom
colsonSung:fix/tutorial-help-i18n-missing-keys
Open

fix: use correct locale keys in TutorialHelp component (fixes #348)#358
colsonSung wants to merge 1 commit intosiddharthvaddem:mainfrom
colsonSung:fix/tutorial-help-i18n-missing-keys

Conversation

@colsonSung
Copy link
Copy Markdown

@colsonSung colsonSung commented Apr 6, 2026

Summary

Fixes #348 — i18n keys displayed instead of translated text in the 'How Trimming Works' modal on Windows 11.

Root Cause

called translation keys that do not exist in any locale file:

Broken key Used in component
tutorial.explanationBefore Explanation paragraph
tutorial.explanationMiddle Explanation paragraph
tutorial.explanationAfter Explanation paragraph
tutorial.remove Explanation paragraph
tutorial.covered Explanation paragraph
tutorial.step1DescriptionBefore Step 1 description
tutorial.step1DescriptionAfter Step 1 description

The i18n loader's fallback returns the key itself when no translation is found, so users see literal strings like dialogs.tutorial.explanationBefore instead of readable text.

Fix

Replace the non-existent key chain with keys that already exist in all locale files (en, zh-CN, es):

  • tutorial.explanation + tutorial.explanationRemove + tutorial.explanationCovered + tutorial.explanationEnd
  • tutorial.step1Description (instead of split Before/After keys)

Files Changed

  • src/components/video-editor/TutorialHelp.tsx — updated t() calls
  • No locale file changes needed — all required keys already exist

Verification

npx tsc --noEmit passes with no errors.

Closes #348

Summary by CodeRabbit

  • Chores
    • Streamlined translation string organization in the tutorial help component for improved maintainability.

Fixes siddharthvaddem#348 - i18n keys were displayed instead of translated text
in the 'How Trimming Works' modal on Windows 11.

Root cause: TutorialHelp.tsx used translation keys that did not
exist in any locale file (explanationBefore, explanationMiddle,
explanationAfter, remove, covered, step1DescriptionBefore,
step1DescriptionAfter). The fallback in loader.ts returns the
key itself when no translation is found.

Changes:
- Replace broken key chain with existing keys:
  tutorial.explanation + tutorial.explanationRemove +
  tutorial.explanationCovered + tutorial.explanationEnd
- Simplify step1Description to use the existing key
  tutorial.step1Description instead of missing split keys

All existing locale files (en, zh-CN, es) already contain
the correct keys used by this fix.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 6, 2026

📝 Walkthrough

Walkthrough

Consolidated fragmented translation keys in the TutorialHelp component by replacing multi-key text composition with single unified translation keys. The "Explanation" and "Steps" sections now use consolidated keys instead of before/middle/after patterns, reducing key sprawl and simplifying i18n string management.

Changes

Cohort / File(s) Summary
Translation Key Consolidation
src/components/video-editor/TutorialHelp.tsx
Replaced fragmented translation keys (tutorial.explanationBefore, tutorial.step1DescriptionBefore, etc.) with consolidated single keys (tutorial.explanation, tutorial.step1Description). Emphasized segments now use dedicated keys (tutorial.explanationRemove, tutorial.explanationCovered) instead of inline composition.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🔑✨ Keys once scattered, now they gleam,
Fragmented pieces form a dream,
No more broken strings in sight,
Translation flows, clean and right! 🌟


lowkey looks like a solid fix for that windows 11 bug—the i18n keys showing up instead of actual text. consolidating these makes sense from a maintenance perspective too; less surface area for things to go sideways. nit: just make sure the new translation keys are actually defined in your i18n files, otherwise you've just moved the problem around 😄

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly and concisely describes the main change: fixing incorrect locale keys in TutorialHelp component to resolve a real bug (issue #348).
Description check ✅ Passed PR description covers root cause, fix details, and verification. Follows template with clear summary, motivation, files changed, and verification steps provided.
Linked Issues check ✅ Passed Changes directly address issue #348 by replacing non-existent i18n keys (tutorial.explanationBefore, tutorial.explanationMiddle, etc.) with existing ones across all locale files.
Out of Scope Changes check ✅ Passed All changes in TutorialHelp.tsx are scoped to fixing the i18n key references. No unrelated modifications, logic changes, or side effects introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


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

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/video-editor/TutorialHelp.tsx`:
- Around line 40-43: In the TutorialHelp component update the JSX that renders
t("tutorial.explanationCovered") and t("tutorial.explanationEnd") so there is an
explicit separator between them (e.g., add a space or punctuation) to avoid
words joining; modify the JSX around the translation keys
t("tutorial.explanationCovered") and t("tutorial.explanationEnd") (or adjust the
translation value) to include the missing separator so the UI copy reads
correctly.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5e8a961f-428c-4f50-b190-929b8e6d7993

📥 Commits

Reviewing files that changed from the base of the PR and between e571ecb and 252d611.

📒 Files selected for processing (1)
  • src/components/video-editor/TutorialHelp.tsx

Comment on lines +40 to +43
{t("tutorial.explanation")}
<span className="text-[#ef4444] font-bold"> {t("tutorial.explanationRemove")}</span>
<span className="text-[#ef4444] font-bold"> {t("tutorial.explanationCovered")}</span>
{t("tutorial.explanationEnd")}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Missing separator before tutorial.explanationEnd (renders like coveredby).

Line 43 concatenates directly after the highlighted tutorial.explanationCovered, so en/es text joins words. lowkey tiny but very visible in UI copy.

💡 Minimal fix
-							<span className="text-[`#ef4444`] font-bold"> {t("tutorial.explanationCovered")}</span>
-							{t("tutorial.explanationEnd")}
+							<span className="text-[`#ef4444`] font-bold"> {t("tutorial.explanationCovered")}</span>{" "}
+							{t("tutorial.explanationEnd")}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/video-editor/TutorialHelp.tsx` around lines 40 - 43, In the
TutorialHelp component update the JSX that renders
t("tutorial.explanationCovered") and t("tutorial.explanationEnd") so there is an
explicit separator between them (e.g., add a space or punctuation) to avoid
words joining; modify the JSX around the translation keys
t("tutorial.explanationCovered") and t("tutorial.explanationEnd") (or adjust the
translation value) to include the missing separator so the UI copy reads
correctly.

@abres33
Copy link
Copy Markdown
Contributor

abres33 commented Apr 9, 2026

@colsonSung @siddharthvaddem
Hey! I was looking at this issue too and noticed a couple things worth flagging.

Inline styling regression: The original component intentionally splits the explanation into explanationBefore / remove / explanationMiddle / covered / explanationAfter so it can wrap "remove" and "covered" in bold red <span> elements with connecting text between them. This PR drops the explanationMiddle segment, so the two bold spans render back-to-back without the linking sentence fragment.

<kbd> element lost: Similarly, the original splits step1DescriptionBefore / <kbd>T</kbd> / step1DescriptionAfter to render a styled keyboard shortcut. This PR replaces that with a single flat step1Description string, so the <kbd> styling is gone.

3 of 5 locales break: en, es, and zh-CN already have the "correct" keys (explanationBefore, remove, explanationMiddle, etc.). This PR changes the component to use the fr/tr key names, which means en/es/zh-CN would now show raw keys instead — flipping the bug to the other locales.

The root cause is that the fr and tr locale files were contributed with different key names. An alternative fix would be to update fr/dialogs.json and tr/dialogs.json to match the key structure that en/es/zh-CN already use, preserving the component's inline styling. Just wanted to flag this in case it's helpful!

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]: i18n keys displayed instead of translated text in “How Trimming Works” modal (Windows 11)

2 participants