Skip to content

feat(i18n): add Korean (ko) translation#1592

Merged
MODSetter merged 1 commit into
MODSetter:devfrom
moduvoice:feat/ko-i18n-translation
Jul 11, 2026
Merged

feat(i18n): add Korean (ko) translation#1592
MODSetter merged 1 commit into
MODSetter:devfrom
moduvoice:feat/ko-i18n-translation

Conversation

@moduvoice

@moduvoice moduvoice commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Motivation

This adds Korean (ko) translation support — to help Korean-speaking users use this
open-source project more comfortably in their own language.
(한국 사람들의 오픈소스 이용에 도움이 되게 하기 위해서 한글화 작업을 하였습니다.)

Changes

  • Added surfsense_web/messages/ko.json — a full Korean translation with 1:1 key parity against en.json (761 leaf keys), preserving all ICU placeholders ({count}, {name}, {provider}, etc.).
  • Registered ko in surfsense_web/i18n/routing.ts's locales array (next-intl routing config).
  • Registered ko in surfsense_web/contexts/LocaleContext.tsx (the client-side locale loader that actually feeds NextIntlClientProvider inside the app) — added to the Locale type, the dynamic loadMessages switch, and the stored-locale validation list.
  • Added a Korean (한국어 / 🇰🇷) option to both language-switcher UIs: surfsense_web/components/LanguageSwitcher.tsx and surfsense_web/components/layout/ui/sidebar/SidebarUserProfile.tsx, so the new locale is actually selectable, not just present in the JSON.

Testing

  • Wrote a script asserting key-for-key parity between en.json and ko.json (0 missing, 0 extra keys) and that every ICU placeholder variable name ({count}, {provider}, etc.) matches between the two files.
  • Ran biome check on all changed/added files — no issues.
  • Ran tsc --noEmit before and after the change: identical pre-existing error count (37, all unrelated to i18n — e.g. a zh.json key gap and unrelated type issues elsewhere in the codebase).
  • Ran next build (production build) successfully with the new locale wired in.
  • Manually reviewed the full translation for naturalness and consistency of terminology (e.g. 워크스페이스, 커넥터, 대시보드) across all sections.

High-level PR Summary

This PR adds complete Korean (ko) language support to the SurfSense web application. It introduces a comprehensive Korean translation file with 761 keys matching the English version, registers the new locale across the i18n routing configuration and locale context, and adds Korean as a selectable option in both language switcher components. The translation maintains 1:1 key parity with en.json and preserves all ICU placeholder variables for dynamic content.

⏱️ Estimated Review Time: 30-90 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/messages/ko.json
2 surfsense_web/i18n/routing.ts
3 surfsense_web/contexts/LocaleContext.tsx
4 surfsense_web/components/LanguageSwitcher.tsx
5 surfsense_web/components/layout/ui/sidebar/SidebarUserProfile.tsx

Need help? Join our Discord

Summary by CodeRabbit

  • New Features
    • Added Korean as a supported application language.
    • Added Korean translations across navigation, authentication, settings, workspace management, integrations, messaging, and other major app areas.
    • Korean selection is now preserved across sessions and reflected in the application language settings.

Adds a complete Korean locale (surfsense_web/messages/ko.json) with full
key parity with en.json, and wires ko into every place locales are
currently enumerated: next-intl routing config, the client-side locale
context/loader, and the two language-switcher UIs (main app + sidebar
user profile).
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

@moduvoice is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Korean (ko) is added to locale routing, runtime message loading, persisted-locale validation, language selectors, and a new 821-line Korean translation catalog.

Changes

Korean locale support

Layer / File(s) Summary
Locale routing and runtime loading
surfsense_web/i18n/routing.ts, surfsense_web/contexts/LocaleContext.tsx
Adds ko to supported locales, dynamically loads Korean messages, and accepts stored Korean locale values.
Language selector wiring
surfsense_web/components/LanguageSwitcher.tsx, surfsense_web/components/layout/ui/sidebar/SidebarUserProfile.tsx
Adds Korean to both language selectors and extends locale change types to accept ko.
Korean translation catalog
surfsense_web/messages/ko.json
Adds Korean translations for shared UI, navigation, workspace features, settings, onboarding, marketing, and public chat content.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant LanguageSwitcher
  participant LocaleContext
  participant KoreanMessages
  User->>LanguageSwitcher: Select Korean
  LanguageSwitcher->>LocaleContext: Set locale to ko
  LocaleContext->>KoreanMessages: Load ko.json
  KoreanMessages-->>LocaleContext: Return Korean translations
  LocaleContext-->>User: Render Korean interface
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding Korean translation support.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
surfsense_web/components/LanguageSwitcher.tsx (1)

28-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider importing the Locale type instead of duplicating the union.

The handleLanguageChange function casts newLocale to "en" | "es" | "pt" | "hi" | "zh" | "ko", which duplicates the Locale type defined in LocaleContext.tsx. If a new locale is added in the future, both places must be updated independently. Importing and using the Locale type directly would eliminate this maintenance risk.

This same pattern appears in SidebarUserProfile.tsx line 161.

♻️ Proposed refactor
-	const handleLanguageChange = (newLocale: string) => {
-		setLocale(newLocale as "en" | "es" | "pt" | "hi" | "zh" | "ko");
-	};
+	const handleLanguageChange = (newLocale: string) => {
+		setLocale(newLocale as Locale);
+	};

This requires exporting Locale from LocaleContext.tsx (if not already exported) and importing it here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@surfsense_web/components/LanguageSwitcher.tsx` around lines 28 - 37, Export
the Locale type from LocaleContext.tsx if necessary, then import and use it in
LanguageSwitcher’s handleLanguageChange instead of duplicating the locale union.
Apply the same refactor to SidebarUserProfile’s corresponding locale cast so
both components share the centralized type.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@surfsense_web/components/LanguageSwitcher.tsx`:
- Around line 28-37: Export the Locale type from LocaleContext.tsx if necessary,
then import and use it in LanguageSwitcher’s handleLanguageChange instead of
duplicating the locale union. Apply the same refactor to SidebarUserProfile’s
corresponding locale cast so both components share the centralized type.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 386bf124-9ba8-411e-b028-99254d761f88

📥 Commits

Reviewing files that changed from the base of the PR and between 1ae927a and d3d8f10.

📒 Files selected for processing (5)
  • surfsense_web/components/LanguageSwitcher.tsx
  • surfsense_web/components/layout/ui/sidebar/SidebarUserProfile.tsx
  • surfsense_web/contexts/LocaleContext.tsx
  • surfsense_web/i18n/routing.ts
  • surfsense_web/messages/ko.json

@MODSetter

Copy link
Copy Markdown
Owner

@moduvoice Thanks appreciate it but can you reraise this PR on dev branch

@moduvoice moduvoice changed the base branch from main to dev July 11, 2026 03:14
@moduvoice

Copy link
Copy Markdown
Contributor Author

Done — retargeted this PR to dev as requested. Thanks!

@MODSetter MODSetter merged commit e324135 into MODSetter:dev Jul 11, 2026
1 of 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