fix: use correct locale keys in TutorialHelp component (fixes #348)#358
fix: use correct locale keys in TutorialHelp component (fixes #348)#358colsonSung wants to merge 1 commit intosiddharthvaddem:mainfrom
Conversation
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.
📝 WalkthroughWalkthroughConsolidated 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
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)
✏️ 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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
src/components/video-editor/TutorialHelp.tsx
| {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")} |
There was a problem hiding this comment.
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.
|
@colsonSung @siddharthvaddem Inline styling regression: The original component intentionally splits the explanation into
3 of 5 locales break: en, es, and zh-CN already have the "correct" keys ( The root cause is that the fr and tr locale files were contributed with different key names. An alternative fix would be to update |
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:
tutorial.explanationBeforetutorial.explanationMiddletutorial.explanationAftertutorial.removetutorial.coveredtutorial.step1DescriptionBeforetutorial.step1DescriptionAfterThe i18n loader's fallback returns the key itself when no translation is found, so users see literal strings like
dialogs.tutorial.explanationBeforeinstead 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.explanationEndtutorial.step1Description(instead of split Before/After keys)Files Changed
src/components/video-editor/TutorialHelp.tsx— updatedt()callsVerification
npx tsc --noEmitpasses with no errors.Closes #348
Summary by CodeRabbit