fix(i18n): add missing English coverage for mod management and connected agents UI#304
fix(i18n): add missing English coverage for mod management and connected agents UI#304Bermpje wants to merge 2 commits intoopenagents-org:developfrom
Conversation
…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.
|
@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. |
There was a problem hiding this comment.
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
DataTablecomponent 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', '请选择...') |
There was a problem hiding this comment.
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.
| t('modManagement.settings.selectPlaceholder', '请选择...') | |
| t('modManagement.settings.selectPlaceholder') |
| <SelectValue | ||
| placeholder={ | ||
| field.placeholder || | ||
| t('modManagement.settings.addOptionPlaceholder', '添加选项...') |
There was a problem hiding this comment.
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.
| t('modManagement.settings.addOptionPlaceholder', '添加选项...') | |
| t('modManagement.settings.addOptionPlaceholder') |
| {t('modManagement.settings.addItem', '添加项')} | ||
| </Button> |
There was a problem hiding this comment.
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.
| return ( | ||
| <div className="text-sm text-gray-500 dark:text-gray-400"> | ||
| 不支持的字段类型: {field.type} | ||
| {t('modManagement.settings.unsupportedFieldType', '不支持的字段类型')}: {field.type} |
There was a problem hiding this comment.
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.
| {t('modManagement.settings.unsupportedFieldType', '不支持的字段类型')}: {field.type} | |
| {t('modManagement.settings.unsupportedFieldType', { | |
| defaultValue: '不支持的字段类型: {{type}}', | |
| type: field.type, | |
| })} |
| `Page ${currentPage} of ${totalPages}`, | ||
| paginationTotalRecordsLabel = (totalRecords) => `${totalRecords} records`, |
There was a problem hiding this comment.
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.
| `Page ${currentPage} of ${totalPages}`, | |
| paginationTotalRecordsLabel = (totalRecords) => `${totalRecords} records`, | |
| `第 ${currentPage} 页 / 共 ${totalPages} 页`, | |
| paginationTotalRecordsLabel = (totalRecords) => `${totalRecords} 条记录`, |
| paginationPageInfoLabel={(currentPage, totalPages) => | ||
| t("modManagement.table.pageInfo", "第 {{current}} 页,共 {{total}} 页", { | ||
| current: currentPage, | ||
| total: totalPages, | ||
| }) | ||
| } |
There was a problem hiding this comment.
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.
| paginationTotalRecordsLabel={(totalRecords) => | ||
| t("modManagement.table.totalRecords", "共 {{count}} 条记录", { | ||
| count: totalRecords, | ||
| }) | ||
| } |
There was a problem hiding this comment.
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.
Summary
Adds missing English i18n coverage in Studio where Chinese strings were still visible under English locale.
Changes
modManagement.table.*and config-field English keys instudio/src/i18n/locales/en/admin.jsonagents.searchPlaceholderinstudio/src/i18n/locales/en/network.jsonstudio/src/pages/mod-management/ConfigFieldRenderer.tsxwith i18n keysstudio/src/components/layout/ui/data-table.tsxpagination/count labels customizable with English defaultsstudio/src/pages/mod-management/ModManagementPage.tsxValidation
Scope
Focused i18n coverage fix only; no broader translation refactor.