Skip to content

fix(i18n): add missing English coverage for mod management and connected agents UI#304

Open
Bermpje wants to merge 2 commits intoopenagents-org:developfrom
Bermpje:feature/translation-fixes
Open

fix(i18n): add missing English coverage for mod management and connected agents UI#304
Bermpje wants to merge 2 commits intoopenagents-org:developfrom
Bermpje:feature/translation-fixes

Conversation

@Bermpje
Copy link
Copy Markdown
Contributor

@Bermpje Bermpje commented Mar 9, 2026

Summary

Adds missing English i18n coverage in Studio where Chinese strings were still visible under English locale.

Changes

  • Add missing modManagement.table.* and config-field English keys in studio/src/i18n/locales/en/admin.json
  • Add missing agents.searchPlaceholder in studio/src/i18n/locales/en/network.json
  • Replace hardcoded Chinese literals in studio/src/pages/mod-management/ConfigFieldRenderer.tsx with i18n keys
  • Make studio/src/components/layout/ui/data-table.tsx pagination/count labels customizable with English defaults
  • Wire i18n pagination labels in studio/src/pages/mod-management/ModManagementPage.tsx

Validation

  • Confirmed affected mod-management and connected-agents UI paths resolve to English under English locale
  • Lint check passed for touched files

Scope

Focused i18n coverage fix only; no broader translation refactor.

Bermpje added 2 commits March 9, 2026 15:22
…r experience

- Introduced `paginationPageInfoLabel` and `paginationTotalRecordsLabel` props to the DataTable component for dynamic pagination information.
- Updated the ModManagementPage to utilize these new props with translations for better localization.
- Added corresponding entries in the admin JSON locale file for pagination text.
- Introduced a new translation key `searchPlaceholder` in the network JSON locale file to enhance user experience by providing a prompt for searching agents.
Copilot AI review requested due to automatic review settings March 9, 2026 14:40
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 9, 2026

@Bermpje is attempting to deploy a commit to the Raphael's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves Studio’s i18n coverage under the English locale by adding missing translation keys and removing (some) hardcoded Chinese UI strings, particularly in Mod Management and Connected Agents views.

Changes:

  • Add missing English translation keys for mod management table/config-field strings and connected agents search placeholder.
  • Replace several hardcoded Chinese literals in the mod-management config field renderer with i18n lookups.
  • Extend the shared DataTable component to allow customizing pagination/count labels and wire those labels in Mod Management.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
studio/src/pages/mod-management/ModManagementPage.tsx Passes i18n-based pagination label functions into DataTable for the mod list.
studio/src/pages/mod-management/ConfigFieldRenderer.tsx Replaces hardcoded Chinese UI strings with i18n keys for select placeholders/buttons and unsupported-type message.
studio/src/i18n/locales/en/network.json Adds agents.searchPlaceholder English string.
studio/src/i18n/locales/en/admin.json Adds modManagement.table.* and modManagement.settings.* English strings.
studio/src/components/layout/ui/data-table.tsx Adds optional props for pagination labels and replaces hardcoded pagination strings with customizable label functions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

<SelectValue
placeholder={
field.placeholder ||
t('modManagement.settings.selectPlaceholder', '请选择...')
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

These placeholders use Chinese defaultValues in t(...). Given the app fallback language is English and you added English translations for these keys, consider switching the defaultValue to English (or removing it) so missing translations don’t surface Chinese text in non-zh locales.

Suggested change
t('modManagement.settings.selectPlaceholder', '请选择...')
t('modManagement.settings.selectPlaceholder')

Copilot uses AI. Check for mistakes.
<SelectValue
placeholder={
field.placeholder ||
t('modManagement.settings.addOptionPlaceholder', '添加选项...')
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

This multiselect placeholder also uses a Chinese defaultValue in t(...). To avoid Chinese showing up for missing translations in other locales, prefer an English defaultValue (or omit it) now that the English key exists in en/admin.json.

Suggested change
t('modManagement.settings.addOptionPlaceholder', '添加选项...')
t('modManagement.settings.addOptionPlaceholder')

Copilot uses AI. Check for mistakes.
Comment on lines +263 to 264
{t('modManagement.settings.addItem', '添加项')}
</Button>
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

addItem is now translated via t(...), but the provided defaultValue is Chinese. Since you added the English key, consider using an English defaultValue (or removing it) to keep behavior consistent with the PR goal of English coverage.

Copilot uses AI. Check for mistakes.
return (
<div className="text-sm text-gray-500 dark:text-gray-400">
不支持的字段类型: {field.type}
{t('modManagement.settings.unsupportedFieldType', '不支持的字段类型')}: {field.type}
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

For i18n, concatenating ": {field.type}" after the translated string makes it hard for some languages to reorder grammar/punctuation. Consider moving the whole message into the translation (e.g., include {{type}} in the i18n value) and pass type: field.type as an interpolation variable.

Suggested change
{t('modManagement.settings.unsupportedFieldType', '不支持的字段类型')}: {field.type}
{t('modManagement.settings.unsupportedFieldType', {
defaultValue: '不支持的字段类型: {{type}}',
type: field.type,
})}

Copilot uses AI. Check for mistakes.
Comment on lines +73 to +74
`Page ${currentPage} of ${totalPages}`,
paginationTotalRecordsLabel = (totalRecords) => `${totalRecords} records`,
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

DataTable still has Chinese defaults for other strings (e.g., searchPlaceholder = "搜索...", emptyMessage = "暂无数据"), but these new pagination defaults are English. If a caller relies on defaults, this can produce mixed-language UI. Consider localizing these defaults via i18n (and/or aligning the default language consistently across all defaults) rather than hardcoding English here.

Suggested change
`Page ${currentPage} of ${totalPages}`,
paginationTotalRecordsLabel = (totalRecords) => `${totalRecords} records`,
` ${currentPage} 页 / 共 ${totalPages}`,
paginationTotalRecordsLabel = (totalRecords) => `${totalRecords} 条记录`,

Copilot uses AI. Check for mistakes.
Comment on lines +414 to +419
paginationPageInfoLabel={(currentPage, totalPages) =>
t("modManagement.table.pageInfo", "第 {{current}} 页,共 {{total}} 页", {
current: currentPage,
total: totalPages,
})
}
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The defaultValue passed to t() here is Chinese, which can leak Chinese text if the key is missing (e.g., in a new locale or if the namespace isn’t loaded). Since the fallback language is English and you added English translations for these keys, consider using an English defaultValue (or omitting the defaultValue entirely) to avoid mixed-language UI.

Copilot uses AI. Check for mistakes.
Comment on lines +420 to +424
paginationTotalRecordsLabel={(totalRecords) =>
t("modManagement.table.totalRecords", "共 {{count}} 条记录", {
count: totalRecords,
})
}
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

Same issue as above: the Chinese defaultValue ("共 {{count}} 条记录") can show up when a translation is missing. Prefer an English defaultValue (or no defaultValue) since this PR is specifically adding English coverage for these keys.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@MontaEllis8 MontaEllis8 left a comment

Choose a reason for hiding this comment

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

✅ Code Review 通过

代码审查通过,建议合并。

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.

3 participants