Skip to content

i18n: add Korean (ko) locale support#9210

Open
moduvoice wants to merge 2 commits into
AstrBotDevs:masterfrom
moduvoice:i18n/add-korean
Open

i18n: add Korean (ko) locale support#9210
moduvoice wants to merge 2 commits into
AstrBotDevs:masterfrom
moduvoice:i18n/add-korean

Conversation

@moduvoice

@moduvoice moduvoice commented Jul 11, 2026

Copy link
Copy Markdown

Motivation

This adds Korean (ko) translation support — to help Korean-speaking users use this
open-source project more comfortably in their own language.

한국 사람들의 오픈소스 이용에 도움이 되게 하기 위해서 한글화 작업을 하였습니다.

Changes

  • Adds a full Korean (ko-KR) locale for the dashboard: 37 new JSON files under dashboard/src/i18n/locales/ko-KR/ covering all core/, features/, and messages/ modules (chat, auth, platform, provider, persona, knowledge-base, extension, session-management, config-metadata, stats, subagent, welcome, errors/success/validation, etc.) — 3,636 leaf keys total.
  • Registers the new locale by mirroring the existing ru-RU pattern exactly:
    • dashboard/src/i18n/composables.ts: adds 'ko-KR' to availableLocales and adds the 한국어 / 🇰🇷 entry to languageOptions.
    • dashboard/src/i18n/translations.ts: imports all 37 ko-KR JSON files and assembles the 'ko-KR' block under translations, with the same nested shape (core/features/messages) as ru-RU.
  • dashboard/src/i18n/validator.ts was intentionally left untouched — it's a stale, unused dev-only checker (only exported via dashboard/src/i18n/tools/index.ts, not referenced anywhere else) whose hardcoded supportedLocales list doesn't even include ru-RU, so it's out of scope for this change.

Testing

  • Wrote a script to recursively diff leaf-key paths between every one of the 37 new ko-KR files and its corresponding en-US file: 37/37 files match exactly (3,636 leaf keys on both sides, same key paths, same value types).
  • Verified {placeholder} interpolation variables match exactly (same set, sorted) between en-US and ko-KR across all 37 files: 0 mismatches.
  • Spot-checked translation quality/naturalness and terminology consistency across 25+ of the 37 files, covering chat, auth, platform, persona, provider, knowledge-base, settings, config-metadata, stats, subagent, welcome, and error/success/validation messages. Key terms are used consistently: Persona → 페르소나, Provider → 공급자, Platform → 플랫폼, Knowledge Base → 지식 베이스, Session → 세션, Tool → 도구, SubAgent → 서브 에이전트, Config → 구성, Dashboard → 대시보드. Found and fixed one minor spacing inconsistency ("서브에이전트" vs "서브 에이전트") in config-metadata.json for consistency with subagent.json.
  • Confirmed the composables.ts/translations.ts diff contains no unrelated changes and structurally mirrors the existing ru-RU registration line-for-line.
  • Ran pnpm install successfully and a TypeScript check on the two modified .ts files — no errors attributable to the i18n change (the pre-existing .vue module-resolution errors from running bare tsc outside the Vue toolchain are present identically on master and are unrelated to this change).

Summary by Sourcery

Add full Korean (ko-KR) locale support to the dashboard and expose it in the language selector.

New Features:

  • Introduce comprehensive ko-KR translation JSON files for core UI, feature modules, and message texts.
  • Register the ko-KR translation bundle in the central i18n translations map.
  • Add ko-KR to the list of available locales and language options in the dashboard i18n composables.

Adds a complete Korean locale for the WebUI dashboard's i18n system,
mirroring the existing en-US/zh-CN/ru-RU structure across all core,
feature, and message modules (37 JSON files, ~3,600 translated strings).

Registers ko-KR in the central translation map (translations.ts) and
the language switcher / available-locales list (composables.ts).
Use "서브 에이전트" (with space) consistently, matching the term used
throughout ko-KR/features/subagent.json, instead of "서브에이전트".
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. area:webui The bug / feature is about webui(dashboard) of astrbot. labels Jul 11, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Given that validator.ts is already out of sync with ru-RU, consider either updating its supportedLocales to include ko-KR or removing/clearly deprecating it to avoid future confusion for contributors adding locales.
  • The large block of manual ko-KR imports and mapping in translations.ts mirrors ru-RU but is quite verbose; consider extracting a small helper or using a consistent factory pattern for locale registration to reduce duplication and make future locale additions less error-prone.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Given that `validator.ts` is already out of sync with `ru-RU`, consider either updating its `supportedLocales` to include `ko-KR` or removing/clearly deprecating it to avoid future confusion for contributors adding locales.
- The large block of manual `ko-KR` imports and mapping in `translations.ts` mirrors `ru-RU` but is quite verbose; consider extracting a small helper or using a consistent factory pattern for locale registration to reduce duplication and make future locale additions less error-prone.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces comprehensive Korean (ko-KR) localization support to the dashboard by adding translation files and registering them in the i18n configuration. The reviewer identified a critical issue where the allowed locales list in the setupI18n function was not updated, which would cause the application to fall back to 'zh-CN' on startup. Additionally, several translation strings in platform.json, extension.json, and settings.json were flagged for missing {count} placeholders.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.


// 获取可用语言列表
const availableLocales: Locale[] = ['zh-CN', 'en-US', 'ru-RU'];
const availableLocales: Locale[] = ['zh-CN', 'en-US', 'ru-RU', 'ko-KR'];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

When adding 'ko-KR' to availableLocales, please also update the setupI18n function (around line 225) to include 'ko-KR' in its allowed list of locales. Currently, it only checks ['zh-CN', 'en-US', 'ru-RU'], which will cause the application to fall back to 'zh-CN' on startup if 'ko-KR' is stored in localStorage.

"pending": "대기 중",
"stopped": "중지됨",
"unknown": "알 수 없음",
"errors": "개 오류"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The "errors" translation is missing the {count} placeholder. It should be updated to "{count}개 오류" to correctly display the number of errors.

Suggested change
"errors": "개 오류"
"errors": "{count}개 오류"

"status": {
"hasUpdate": "새 버전 있음",
"disabled": "이 플러그인은 사용 안 함 상태입니다",
"handlersCount": " 개 핸들러",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The "handlersCount" translation is missing the {count} placeholder. It should be updated to "{count}개 핸들러" to correctly display the number of handlers.

Suggested change
"handlersCount": " 개 핸들러",
"handlersCount": "{count}개 핸들러",

"checking": "백업 파일을 확인하는 중...",
"invalidBackup": "유효하지 않은 백업 파일입니다",
"backupContents": "백업 내용",
"tables": "개 테이블",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The "tables" translation is missing the {count} placeholder. It should be updated to "{count}개 테이블" to correctly display the number of tables.

Suggested change
"tables": "개 테이블",
"tables": "{count}개 테이블",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webui The bug / feature is about webui(dashboard) of astrbot. size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant