Conversation
I have created si.json to translate messages into Sinhala Language. Sinhala is the main language of Sri Lankan people and there are lots of people have AI contributions and usages. So this will help for Sinhala language usages.
📝 WalkthroughWalkthroughThis change adds Sinhala language support to the application by registering a new locale ( Changes
Poem
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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: 1
🧹 Nitpick comments (1)
src/components/prompts/language-switcher.tsx (1)
14-33: Consider deriving the dropdown list from a single locale source.The locale list is duplicated here and in config, which can drift over time. Pulling codes from a shared constant (then mapping to labels) would reduce sync bugs.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/prompts/language-switcher.tsx` around lines 14 - 33, The duplicated hardcoded languages array should be replaced by deriving entries from the shared locale source (e.g., a SUPPORTED_LOCALES or LOCALES constant exported from your config) instead of the local languages array; update language-switcher.tsx to import that constant and map each locale code to a display label (either via a shared labels map in config or using Intl.DisplayNames as a fallback) and use that mapped list wherever the current languages variable is referenced so there is a single source of truth.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@messages/si.json`:
- Around line 1-1896: The Sinhala locale file is missing many translation keys
(notably the book.chapterDescriptions.* and book.chapters.* ranges 00a–25 plus
other feature keys) and has 9 placeholder mismatches that will break runtime
interpolation; add the missing keys under book.chapterDescriptions and
book.chapters (00a–25) and any other missing feature keys, and fix the
placeholder tokens so they match the source keys exactly for
comments.showReplies, prompts.confirmGenerationDescription,
prompts.contentExistsError, prompts.requiresImage, prompts.requiresVideo,
prompts.requiresDocument, promptWritingGuide.variables.tip1,
promptWritingGuide.variables.tip4, and user.privatePromptsNote by restoring the
missing placeholders ({replies}, {reply}, {model}, {author}, {title}, {image},
{images}, {video}, {videos}, {document}, {documents}, {topic}, {x},
{target_audience}, {prompt}, {prompts}) to the Sinhala strings.
---
Nitpick comments:
In `@src/components/prompts/language-switcher.tsx`:
- Around line 14-33: The duplicated hardcoded languages array should be replaced
by deriving entries from the shared locale source (e.g., a SUPPORTED_LOCALES or
LOCALES constant exported from your config) instead of the local languages
array; update language-switcher.tsx to import that constant and map each locale
code to a display label (either via a shared labels map in config or using
Intl.DisplayNames as a fallback) and use that mapped list wherever the current
languages variable is referenced so there is a single source of truth.
🪄 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: CHILL
Plan: Pro
Run ID: f3ac8bd2-12d4-437a-b433-d04db94abe5f
📒 Files selected for processing (4)
messages/si.jsonprompts.config.tssrc/components/prompts/language-switcher.tsxsrc/lib/i18n/config.ts
|
Hi @f , can you check these changes |
Description
I have created si.json to translate messages into Sinhala Language. Sinhala is the main language of Sri Lankan people and there are lots of people have AI contributions and usages. So this will help for Sinhala language usages.
Type of Change
Summary by CodeRabbit
Release Notes