Skip to content

fix(i18n): fix missing i18n coverage and refine Korean translations - #16203

Merged
yingfeng merged 4 commits into
infiniflow:mainfrom
yooxdb:fix/i18n-apply-missing-keys
Jun 24, 2026
Merged

yingfeng merged 4 commits into
infiniflow:mainfrom
yooxdb:fix/i18n-apply-missing-keys

Conversation

@yooxdb

@yooxdb yooxdb commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

This PR follows up on #15863 (Korean i18n) with translation refinements and i18n coverage for hardcoded strings found in the UI.

  • Refine awkward Korean phrasing (e.g. 'Chunk 만들기' → 'Chunk 생성', '유형' → '타입', etc.)
  • Apply i18n to hardcoded strings in message-item, next-message-item, multi-select, chat-prompt-engine, and various filter hooks
  • Rename use-selelct-filters.ts → use-select-filters.ts (typo fix)

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 19, 2026
@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

New translation keys (owner, running, createChunk, editChunk, showChunkMetadata*, metadataFields*, tags, canvasCategory, selectLocalePlaceholder) are added to the English locale and propagated to 15 other locale files. UI components and hooks replace hardcoded English strings with t() calls, and buildOwnersFilter gains an optional label parameter.

Changes

i18n Coverage Expansion

Layer / File(s) Summary
English locale keys + buildOwnersFilter label param
web/src/locales/en.ts, web/src/utils/list-filter-util.ts
English locale adds common.owner, common.running, chunk.createChunk/editChunk, chat.showChunkMetadata*, chat.metadataFields*, flow.tags/canvasCategory, search.selectLocalePlaceholder, and relocates knowledgeDetails.metadata.type. buildOwnersFilter gains an optional label parameter defaulting to 'Owner'.
UI components and hooks: replace hardcoded strings
web/src/components/message-item/index.tsx, web/src/components/next-message-item/index.tsx, web/src/components/ui/multi-select.tsx, web/src/pages/chunk/..., web/src/pages/dataflow-result/..., web/src/pages/dataset/..., web/src/pages/datasets/..., web/src/pages/memories/..., web/src/pages/next-chats/..., web/src/pages/next-search/..., web/src/pages/agent/..., web/src/pages/agents/...
All listed components and hooks swap hardcoded English strings for t() calls using the newly defined keys. Chunk modals use dedicated editChunk/createChunk keys instead of concatenating edit/create + chunk. Filter hooks pass t('common.owner') through buildOwnersFilter. Agents index corrects a misspelled import path.
Non-English locale files: new and revised keys
web/src/locales/ar.ts, web/src/locales/bg.ts, web/src/locales/de.ts, web/src/locales/es.ts, web/src/locales/fr.ts, web/src/locales/id.ts, web/src/locales/it.ts, web/src/locales/ja.ts, web/src/locales/ko.ts, web/src/locales/pt-br.ts, web/src/locales/ru.ts, web/src/locales/tr.ts, web/src/locales/vi.ts, web/src/locales/zh-traditional.ts, web/src/locales/zh.ts
Each locale file adds the same set of new keys. The Korean locale additionally revises many existing tooltip and label strings across memory, dataset, chunk, chat, and workflow sections.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

size:S

Poem

🐰 Strings once hard-coded, now free to roam,
Each language a key in its very own home.
t('common.running') hops through the queue,
No more English alone — every locale gets new!
The rabbit translates, with a hop and a click,
Internationalized neatly, oh isn't that slick? 🌍

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: fixing missing i18n coverage and refining Korean translations, which aligns with the actual changeset.
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 The PR description covers the main objectives: Korean translation refinements, i18n coverage for hardcoded strings, and a typo fix. However, it lacks specific examples and details about the scope of changes.

✏️ 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.

@yooxdb yooxdb changed the title fix(i18n): fix missing i18n coverage and refine ko translations fix(i18n): fix missing i18n coverage and refine Korean translations Jun 19, 2026

@coderabbitai coderabbitai 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.

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/src/pages/next-search/search-setting.tsx (1)

397-410: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize the placeholder too.

This block still hardcodes "Please select", so the selector stays English for every non-English locale. Use the existing translation key here.

♻️ Proposed fix
-                        placeholder="Please select"
+                        placeholder={t('common.pleaseSelect')}
🤖 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 `@web/src/pages/next-search/search-setting.tsx` around lines 397 - 410, In the
MultiSelect component in the search-setting.tsx file, replace the hardcoded
placeholder string "Please select" with the appropriate existing translation key
used elsewhere in the codebase. This will ensure the placeholder text respects
the user's locale setting instead of always displaying in English.
🧹 Nitpick comments (1)
web/src/pages/next-search/embed-app-modal.tsx (1)

94-94: Migrate to useTranslation in this React component instead of the project wrapper hook.

The placeholder i18n change is good, but the component currently depends on useTranslate. Per coding guidelines, "Prefer useTranslation from react-i18next over project-wrapped utilities like useTranslate for i18n in React components." Migrate line 10's import and line 24's hook call:

- import { useTranslate } from '`@/hooks/common-hooks`';
+ import { useTranslation } from 'react-i18next';

- const { t } = useTranslate('search');
+ const { t } = useTranslation('translation', { keyPrefix: 'search' });
🤖 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 `@web/src/pages/next-search/embed-app-modal.tsx` at line 94, Replace the
project-wrapped useTranslate hook with the standard useTranslation from
react-i18next. Change the import statement that currently imports useTranslate
to instead import useTranslation from react-i18next, and update the hook
invocation where useTranslate() is called to useTranslation() instead. The t
function returned from useTranslation will work identically with the existing
placeholder usage at line 94 (t('selectLocalePlaceholder')).

Source: Coding guidelines

🤖 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.

Inline comments:
In `@web/src/locales/en.ts`:
- Around line 933-934: The locale labels createChunk and editChunk in the en.ts
file are using title case (each word capitalized) but should follow sentence
case per file guidelines. Change the values 'Create Chunk' to 'Create chunk' and
'Edit Chunk' to 'Edit chunk' by converting the second word to lowercase while
keeping the first word capitalized.

In `@web/src/locales/es.ts`:
- Around line 35-36: The Spanish locale file (es.ts) is missing the translation
key `common.running` which is now being used by the `message-item` and
`next-message-item` components. Add the `running` key to the `common` object in
the Spanish locale file with an appropriate Spanish translation for the
running/loading state. This will prevent untranslated fallback text from
appearing in Spanish UI loading states.

In `@web/src/locales/fr.ts`:
- Around line 83-84: The French locale file fr.ts is missing the
`common.running` key in the translation.common object, while the UI references
`t('common.running')` causing fallback to a default language. Add the
`common.running` key with its French translation value in the `common` object
within translation.common, placing it alongside the newly added `owner` key to
ensure full French localization for message item components.

In `@web/src/locales/id.ts`:
- Around line 39-40: The Indonesian locale file (id.ts) is missing two required
i18n keys that are now consumed by updated UI paths. Add the key `running` with
an Indonesian translation to the `common` object, and add the key
`selectLocalePlaceholder` with an Indonesian translation to the `search` object
to prevent fallback text from appearing in the user interface.

In `@web/src/locales/ko.ts`:
- Line 412: The knowledgeDetails.metadata.type field in the Korean locale file
uses '타입' but should be updated to use the refined Korean term '유형' for
consistency with the stated terminology guidelines. Locate the type property
definition in the ko.ts file and change its value from '타입' to '유형'.

In `@web/src/locales/zh-traditional.ts`:
- Around line 44-45: Add the missing `common.running` key to the Traditional
Chinese locale file in the `common` object where `owner` is currently defined.
Include an appropriate Traditional Chinese translation for the "running" state
to prevent the UI from displaying the key name as fallback text when
t('common.running') is called.

In `@web/src/locales/zh.ts`:
- Around line 69-70: The common.running locale key is missing from the Chinese
translations object. Add the running key with an appropriate Chinese translation
(such as '运行中' or '运行') to the common object in the zh.ts locale file, placing
it alongside other common keys like owner to ensure the UI components that
reference common.running display properly translated text instead of falling
back to untranslated content.

In `@web/src/pages/agent/version-dialog/index.tsx`:
- Line 119: The translation key used in the version dialog component is
incorrect. In the line displaying the creation date with
formatDate(agent?.create_date), change the translation key from
t('flow.created') to t('flow.version.created') to match the actual nested
translation key structure defined in the locale files, which will ensure proper
localization functionality.

In `@web/src/pages/next-chats/chat/app-settings/chat-prompt-engine.tsx`:
- Around line 149-150: The translation key 'chat.metadataKeys' used in the
FormLabel component is not present in the current locale contract and will
render as an untranslated key. Update the translation key passed to the t()
function from 'chat.metadataKeys' to 'chat.metadataFields' to match the defined
i18n keys in the locale contract.

In `@web/src/pages/next-search/retrieval-documents/index.tsx`:
- Around line 41-43: The useTranslation hook is already initialized with const {
t } = useTranslation() on line 41, but hardcoded English text strings remain at
lines 131, 158, and 162 (within ranges 128-132 and 157-163) that need to be
localized. Identify all hardcoded English string literals in those line ranges
and wrap them with the t() function to enable proper translation support,
ensuring each string has an appropriate translation key for localization.

---

Outside diff comments:
In `@web/src/pages/next-search/search-setting.tsx`:
- Around line 397-410: In the MultiSelect component in the search-setting.tsx
file, replace the hardcoded placeholder string "Please select" with the
appropriate existing translation key used elsewhere in the codebase. This will
ensure the placeholder text respects the user's locale setting instead of always
displaying in English.

---

Nitpick comments:
In `@web/src/pages/next-search/embed-app-modal.tsx`:
- Line 94: Replace the project-wrapped useTranslate hook with the standard
useTranslation from react-i18next. Change the import statement that currently
imports useTranslate to instead import useTranslation from react-i18next, and
update the hook invocation where useTranslate() is called to useTranslation()
instead. The t function returned from useTranslation will work identically with
the existing placeholder usage at line 94 (t('selectLocalePlaceholder')).
🪄 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: c9eda8df-5899-4574-90f2-fce1dfdde1ba

📥 Commits

Reviewing files that changed from the base of the PR and between 11499f7 and 35cd930.

📒 Files selected for processing (34)
  • web/src/components/message-item/index.tsx
  • web/src/components/next-message-item/index.tsx
  • web/src/components/ui/multi-select.tsx
  • web/src/locales/ar.ts
  • web/src/locales/bg.ts
  • web/src/locales/de.ts
  • web/src/locales/en.ts
  • web/src/locales/es.ts
  • web/src/locales/fr.ts
  • web/src/locales/id.ts
  • web/src/locales/it.ts
  • web/src/locales/ja.ts
  • web/src/locales/ko.ts
  • web/src/locales/pt-br.ts
  • web/src/locales/ru.ts
  • web/src/locales/tr.ts
  • web/src/locales/vi.ts
  • web/src/locales/zh-traditional.ts
  • web/src/locales/zh.ts
  • web/src/pages/agent/version-dialog/index.tsx
  • web/src/pages/agents/hooks/use-select-filters.ts
  • web/src/pages/agents/index.tsx
  • web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal/index.tsx
  • web/src/pages/dataflow-result/components/chunk-creating-modal/index.tsx
  • web/src/pages/dataset/components/metedata/manage-modal.tsx
  • web/src/pages/dataset/components/metedata/manage-values-modal.tsx
  • web/src/pages/dataset/dataset/use-select-filters.ts
  • web/src/pages/datasets/use-select-owners.ts
  • web/src/pages/memories/hooks.ts
  • web/src/pages/next-chats/chat/app-settings/chat-prompt-engine.tsx
  • web/src/pages/next-search/embed-app-modal.tsx
  • web/src/pages/next-search/retrieval-documents/index.tsx
  • web/src/pages/next-search/search-setting.tsx
  • web/src/utils/list-filter-util.ts

Comment thread web/src/locales/en.ts Resolved
Comment thread web/src/locales/es.ts Resolved
Comment thread web/src/locales/fr.ts Resolved
Comment thread web/src/locales/id.ts Resolved
Comment thread web/src/locales/ko.ts Resolved
Comment thread web/src/locales/zh-traditional.ts Resolved
Comment thread web/src/locales/zh.ts Resolved
@yingfeng yingfeng added the ci Continue Integration label Jun 22, 2026
@yingfeng
yingfeng marked this pull request as draft June 22, 2026 12:08
@yingfeng
yingfeng marked this pull request as ready for review June 22, 2026 12:08
@yingfeng
yingfeng requested a review from dcc123456 June 22, 2026 12:09
@yingfeng
yingfeng merged commit 6a82817 into infiniflow:main Jun 24, 2026
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants