fix: 修复新 UI 语言与文案显示问题#4876
Conversation
- add a reset-setup make target to clear setup records, root users, and related options. - support both docker dev PostgreSQL and local SQLite development databases. - restart the docker dev backend so setup status is recalculated after reset.
- add truncation layout for chat preset names to keep long labels inside the sidebar menu. - prevent loading and external-link icons from shrinking in constrained menu rows.
- call t() for granularity option labels in dashboard system settings. - keep localized text consistent between the select trigger and dropdown items.
- add a dev-api-rebuild make target to rebuild and start the docker backend service. - reuse DEV_COMPOSE_FILE and DEV_BACKEND_SERVICE variables to avoid repeated compose config literals.
- add shared interface language options to keep display names consistent. - reuse the shared options in the header switcher and profile preferences. - normalize language codes so zh-CN and zh_CN resolve to Simplified Chinese.
- route channel key prompts, form validation messages, and channel fallback text through i18n. - add missing translations across six locales for channels, rankings, billing, and logs. - update i18n sync reports so literal t() keys are present in the base locale.
WalkthroughThis PR consolidates language handling by introducing a ChangesInternationalization and Component Refactoring
Development Infrastructure
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 9
🧹 Nitpick comments (3)
web/default/src/i18n/locales/en.json (1)
799-801: 🏗️ Heavy liftUse hierarchical i18n keys for the newly added entries.
These newly added translation keys use full English sentences as key names, which diverges from the required semantic/hierarchical key convention and will keep key management brittle across locales and refactors.
As per coding guidelines, "Use hierarchical and semantically clear translation key names such as
dashboard.overview.titleand maintain naming consistency".Also applies to: 877-878, 1575-1575, 2872-2872, 3194-3194, 3205-3205, 3744-3744, 3900-3900, 4442-4451
🤖 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/default/src/i18n/locales/en.json` around lines 799 - 801, The JSON uses sentence strings as translation keys; rename the three keys "Compliance confirmation required", "Compliance confirmed", and "Compliance confirmed successfully" to hierarchical semantic keys (for example compliance.confirmation.required, compliance.confirmed, compliance.confirmed.success), move the original English strings to the values, and update all code references to use the new keys; also scan and convert the other sentence-like keys mentioned in your comment to consistent hierarchical keys (e.g., module.submodule.descriptiveName) and update their usages across the codebase so keys remain semantic and refactor-safe.web/default/src/components/layout/components/chat-presets-item.tsx (2)
100-102: 💤 Low valueConsider adding a title attribute for accessibility.
Similar to the web preset case, truncated external preset names should provide the full text via a title attribute for better user experience.
♻️ Proposed enhancement
<SidebarMenuSubButton + title={preset.name} onClick={() => { if (!loading) void onOpen(preset)Optional: Remove redundant
whitespace-nowrapclass.The
truncateutility already includeswhite-space: nowrap.Minor cleanup
- <span className='min-w-0 flex-1 truncate whitespace-nowrap'> + <span className='min-w-0 flex-1 truncate'> {preset.name} </span>🤖 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/default/src/components/layout/components/chat-presets-item.tsx` around lines 100 - 102, In the ChatPresetsItem component, the span that renders {preset.name} should include a title attribute so truncated external preset names are readable on hover; update the span in chat-presets-item.tsx (the element with className 'min-w-0 flex-1 truncate whitespace-nowrap') to add title={preset.name} and optionally remove the redundant 'whitespace-nowrap' class since 'truncate' already applies nowrap.
82-84: 💤 Low valueConsider adding a title attribute for accessibility.
Truncated preset names may hide important information from users. Adding a
titleattribute would allow users to view the full name on hover.♻️ Proposed enhancement
- <SidebarMenuSubButton + <SidebarMenuSubButton + title={preset.name} isActive={active} render={ <LinkOptional: Remove redundant
whitespace-nowrapclass.The
truncateutility already includeswhite-space: nowrap, making thewhitespace-nowrapclass redundant.Minor cleanup
- <span className='min-w-0 flex-1 truncate whitespace-nowrap'> + <span className='min-w-0 flex-1 truncate'> {preset.name} </span>🤖 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/default/src/components/layout/components/chat-presets-item.tsx` around lines 82 - 84, Add a title attribute to the span that displays the preset name so truncated names are readable on hover (use the same value as preset.name); update the element in chat-presets-item.tsx where preset.name is rendered (the span with class 'min-w-0 flex-1 truncate') to include title={preset.name}. Also remove the redundant 'whitespace-nowrap' class from that span since the 'truncate' utility already applies nowrap.
🤖 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 `@makefile`:
- Around line 49-64: Add fail-fast and transactional guards to the reset-setup
target: enable shell fail-fast by prefixing the multi-line recipe branches with
"set -e;" and for the Postgres branch call psql with ON_ERROR_STOP (psql -v
ON_ERROR_STOP=1) and wrap the SQL in a transaction (BEGIN; ...; COMMIT;), and
for the SQLite branch wrap the statements in a transaction (BEGIN TRANSACTION;
...; COMMIT;) so any SQL error aborts and prevents the subsequent echo/restart
steps; locate and modify the Docker/Postgres exec line that invokes psql and the
sqlite3 invocation to include these changes.
In `@web/default/src/i18n/locales/fr.json`:
- Line 9: The French locale has the English conjunction as the value for the key
",and " which will produce English text in French UI; update the mapping for the
JSON key ",and " in fr.json to the correct French conjunction value (e.g., ", et
"), save the file and re-run any i18n build/validation so the change propagates
(look specifically for the ",and " entry in fr.json to locate and edit it).
- Around line 799-801: The French locale contains untranslated UX/compliance
strings; locate the keys "Compliance confirmation required", "Compliance
confirmed", and "Compliance confirmed successfully" (and the other untranslated
keys noted around lines 869-878, 891-895, 1575, 1988-1989, 2001, 2640, 2872,
3194, 3205, 3744, 3900, and 4442-4451) in web/default/src/i18n/locales/fr.json
and replace the English values with accurate French translations that preserve
tone and legal meaning; ensure pluralization/variables (if any) remain intact
and run the localization linter/CI to validate JSON and coverage after updating
all affected keys.
In `@web/default/src/i18n/locales/ja.json`:
- Line 123: The Japanese locale contains untranslated English keys (e.g., the
string "acknowledge the related legal risks" in ja.json) used in the
compliance/payment gating flow; replace these English values with accurate
Japanese translations for all listed occurrences (including ranges 799-801, 869,
877-895, 1575, 1988-2002, 2640, 2872, 2966, 3194-3205, 3744, 3868, 3900, 4102,
4442-4451) and ensure any exact-match confirmation prompts and error messages
preserve meaning and punctuation so the UI logic (confirmation equality checks)
continues to work with the translated strings.
- Around line 7-10: Update the Japanese separator mappings so values use
Japanese punctuation instead of English commas: change the value for the key ","
from ", " to "、"; change the value for the key "、" from ", " to "、"; change the
value for the key ",and " from ", and " to "、および " (matching the existing "、および"
mapping for ", and"); keep the existing ", and": "、および" mapping as-is so all
separators are consistently localized.
In `@web/default/src/i18n/locales/ru.json`:
- Around line 799-801: The JSON contains English strings for compliance/legal
confirmations that must be localized; replace the values for the keys
"Compliance confirmation required", "Compliance confirmed", and "Compliance
confirmed successfully" in ru.json with their correct Russian translations (and
likewise update the other listed keys/strings at the ranges referenced by the
reviewer) ensuring the keys remain unchanged and only the right-hand side values
are translated into Russian so the user-facing confirmation text is fully
localized.
In `@web/default/src/i18n/locales/vi.json`:
- Line 9: The Vietnamese locale currently maps the key ",and " to the English
string ", and "; update the value to the Vietnamese connector ", và " to
localize the UI consistently (replace the value for the ",and " key with ", và
"), matching adjacent connector usage in the vi.json locale.
- Around line 799-801: Replace the English placeholder values in vi.json for the
compliance/legal keys with accurate Vietnamese translations: update the values
for "Compliance confirmation required", "Compliance confirmed", "Compliance
confirmed successfully" (and the other flagged keys at lines referenced: e.g.,
the pairs around 869-891, 1575, 1988-2001, 2640, 2872, 3194-3205, 3744, 3900,
4442-4451) by substituting Vietnamese text while keeping the JSON keys unchanged
and preserving punctuation and sentence meaning; ensure translations are
concise, legally clear, and reviewed for correctness (or sourced from a
native/industry translator) so the consent flows display proper Vietnamese
strings.
In `@web/default/src/i18n/locales/zh.json`:
- Line 1779: The locale key contains an escaped segment
("footer.new\u0061pi.projectAttributionSuffix" -> effective key
"footer.newapi.projectAttributionSuffix") which will not match code that expects
"footer.newApi.projectAttributionSuffix"; update the JSON key to the correct,
consistent key name used by the code (e.g.,
"footer.newApi.projectAttributionSuffix") so the translation resolves, ensuring
the change is made for the "footer.newApi.projectAttributionSuffix" entry and
any other occurrences of the escaped form are normalized.
---
Nitpick comments:
In `@web/default/src/components/layout/components/chat-presets-item.tsx`:
- Around line 100-102: In the ChatPresetsItem component, the span that renders
{preset.name} should include a title attribute so truncated external preset
names are readable on hover; update the span in chat-presets-item.tsx (the
element with className 'min-w-0 flex-1 truncate whitespace-nowrap') to add
title={preset.name} and optionally remove the redundant 'whitespace-nowrap'
class since 'truncate' already applies nowrap.
- Around line 82-84: Add a title attribute to the span that displays the preset
name so truncated names are readable on hover (use the same value as
preset.name); update the element in chat-presets-item.tsx where preset.name is
rendered (the span with class 'min-w-0 flex-1 truncate') to include
title={preset.name}. Also remove the redundant 'whitespace-nowrap' class from
that span since the 'truncate' utility already applies nowrap.
In `@web/default/src/i18n/locales/en.json`:
- Around line 799-801: The JSON uses sentence strings as translation keys;
rename the three keys "Compliance confirmation required", "Compliance
confirmed", and "Compliance confirmed successfully" to hierarchical semantic
keys (for example compliance.confirmation.required, compliance.confirmed,
compliance.confirmed.success), move the original English strings to the values,
and update all code references to use the new keys; also scan and convert the
other sentence-like keys mentioned in your comment to consistent hierarchical
keys (e.g., module.submodule.descriptiveName) and update their usages across the
codebase so keys remain semantic and refactor-safe.
🪄 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: c2c62a28-c6da-4cd5-92b8-557ea874cb3f
📒 Files selected for processing (22)
makefileweb/default/src/components/language-switcher.tsxweb/default/src/components/layout/components/chat-presets-item.tsxweb/default/src/components/ui/form.tsxweb/default/src/features/channels/components/dialogs/channel-test-dialog.tsxweb/default/src/features/channels/components/dialogs/multi-key-manage-dialog.tsxweb/default/src/features/channels/components/drawers/channel-mutate-drawer.tsxweb/default/src/features/profile/components/language-preferences-card.tsxweb/default/src/features/system-settings/content/dashboard-section.tsxweb/default/src/i18n/languages.tsweb/default/src/i18n/locales/_reports/_sync-report.jsonweb/default/src/i18n/locales/_reports/fr.untranslated.jsonweb/default/src/i18n/locales/_reports/ja.untranslated.jsonweb/default/src/i18n/locales/_reports/ru.untranslated.jsonweb/default/src/i18n/locales/_reports/vi.untranslated.jsonweb/default/src/i18n/locales/en.jsonweb/default/src/i18n/locales/fr.jsonweb/default/src/i18n/locales/ja.jsonweb/default/src/i18n/locales/ru.jsonweb/default/src/i18n/locales/vi.jsonweb/default/src/i18n/locales/zh.jsonweb/default/src/i18n/static-keys.ts
| @if docker compose -f $(DEV_COMPOSE_FILE) ps --services --status running | grep -qx "$(DEV_POSTGRES_SERVICE)"; then \ | ||
| echo "Detected running docker dev PostgreSQL. Removing setup record and root users..."; \ | ||
| docker compose -f $(DEV_COMPOSE_FILE) exec -T $(DEV_POSTGRES_SERVICE) \ | ||
| psql -U $(DEV_POSTGRES_USER) -d $(DEV_POSTGRES_DB) \ | ||
| -c 'DELETE FROM setups;' \ | ||
| -c 'DELETE FROM users WHERE role = 100;' \ | ||
| -c "DELETE FROM options WHERE key IN ('SelfUseModeEnabled', 'DemoSiteEnabled');"; \ | ||
| echo "Restarting docker dev backend so setup status is recalculated..."; \ | ||
| docker compose -f $(DEV_COMPOSE_FILE) restart $(DEV_BACKEND_SERVICE); \ | ||
| elif db_path="$${SQLITE_PATH:-$(DEV_SQLITE_PATH)}"; db_path="$${db_path%%\?*}"; [ -f "$$db_path" ]; then \ | ||
| db_path="$${SQLITE_PATH:-$(DEV_SQLITE_PATH)}"; \ | ||
| db_path="$${db_path%%\?*}"; \ | ||
| echo "Detected local SQLite database: $$db_path"; \ | ||
| sqlite3 "$$db_path" \ | ||
| "DELETE FROM setups; DELETE FROM users WHERE role = 100; DELETE FROM options WHERE key IN ('SelfUseModeEnabled', 'DemoSiteEnabled');"; \ | ||
| echo "SQLite setup state reset. Restart the local backend process before testing the setup wizard."; \ |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
python - <<'PY'
from pathlib import Path
lines = Path("makefile").read_text().splitlines()
start = next(i for i, line in enumerate(lines, 1) if line.startswith("reset-setup:"))
end = len(lines) + 1
for i in range(start + 1, len(lines) + 1):
line = lines[i - 1]
if line and not line.startswith("\t"):
end = i
break
block = lines[start - 1:end - 1]
for i, line in enumerate(block, start):
print(f"{i}:{line}")
print("\nHas fail-fast guard:", any("set -e" in line for line in block))
print("Has Postgres transaction:", any("BEGIN;" in line and "psql" not in line for line in block))
print("Has SQLite transaction:", any('sqlite3 "$$db_path"' in line for line in block) and any("BEGIN;" in line and "sqlite3" not in line for line in block))
PYRepository: QuantumNous/new-api
Length of output: 1671
Add fail-fast and transaction wrappers to prevent silent failures.
The reset-setup target lacks a fail-fast guard (set -e) and transactional wrappers around database operations. If psql or sqlite3 fails, the subsequent echo and restart commands still execute, causing the target to exit 0 even though the setup state was not cleared. Wrap both database branches with transaction commands and add a fail-fast guard at the start.
Suggested fix
reset-setup:
`@echo` "Resetting local setup wizard state..."
- `@if` docker compose -f $(DEV_COMPOSE_FILE) ps --services --status running | grep -qx "$(DEV_POSTGRES_SERVICE)"; then \
+ `@set` -e; \
+ if docker compose -f $(DEV_COMPOSE_FILE) ps --services --status running | grep -qx "$(DEV_POSTGRES_SERVICE)"; then \
echo "Detected running docker dev PostgreSQL. Removing setup record and root users..."; \
docker compose -f $(DEV_COMPOSE_FILE) exec -T $(DEV_POSTGRES_SERVICE) \
- psql -U $(DEV_POSTGRES_USER) -d $(DEV_POSTGRES_DB) \
- -c 'DELETE FROM setups;' \
- -c 'DELETE FROM users WHERE role = 100;' \
- -c "DELETE FROM options WHERE key IN ('SelfUseModeEnabled', 'DemoSiteEnabled');"; \
+ psql -v ON_ERROR_STOP=1 -U $(DEV_POSTGRES_USER) -d $(DEV_POSTGRES_DB) \
+ -c 'BEGIN;' \
+ -c 'DELETE FROM setups;' \
+ -c 'DELETE FROM users WHERE role = 100;' \
+ -c "DELETE FROM options WHERE key IN ('SelfUseModeEnabled', 'DemoSiteEnabled');" \
+ -c 'COMMIT;'; \
echo "Restarting docker dev backend so setup status is recalculated..."; \
docker compose -f $(DEV_COMPOSE_FILE) restart $(DEV_BACKEND_SERVICE); \
elif db_path="$${SQLITE_PATH:-$(DEV_SQLITE_PATH)}"; db_path="$${db_path%%\?*}"; [ -f "$$db_path" ]; then \
db_path="$${SQLITE_PATH:-$(DEV_SQLITE_PATH)}"; \
db_path="$${db_path%%\?*}"; \
echo "Detected local SQLite database: $$db_path"; \
sqlite3 "$$db_path" \
- "DELETE FROM setups; DELETE FROM users WHERE role = 100; DELETE FROM options WHERE key IN ('SelfUseModeEnabled', 'DemoSiteEnabled');"; \
+ "BEGIN; DELETE FROM setups; DELETE FROM users WHERE role = 100; DELETE FROM options WHERE key IN ('SelfUseModeEnabled', 'DemoSiteEnabled'); COMMIT;"; \
echo "SQLite setup state reset. Restart the local backend process before testing the setup wizard."; \
else \🤖 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 `@makefile` around lines 49 - 64, Add fail-fast and transactional guards to the
reset-setup target: enable shell fail-fast by prefixing the multi-line recipe
branches with "set -e;" and for the Postgres branch call psql with ON_ERROR_STOP
(psql -v ON_ERROR_STOP=1) and wrap the SQL in a transaction (BEGIN; ...;
COMMIT;), and for the SQLite branch wrap the statements in a transaction (BEGIN
TRANSACTION; ...; COMMIT;) so any SQL error aborts and prevents the subsequent
echo/restart steps; locate and modify the Docker/Postgres exec line that invokes
psql and the sqlite3 invocation to include these changes.
| "_copy": "_copie", | ||
| ",": ", ", | ||
| ", and": ", et", | ||
| ",and ": ", and ", |
There was a problem hiding this comment.
French conjunction mapping appears incorrect.
",and " is mapped to ", and " (English), which can inject English conjunctions in FR output. This should be French (e.g., ", et ").
🤖 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/default/src/i18n/locales/fr.json` at line 9, The French locale has the
English conjunction as the value for the key ",and " which will produce English
text in French UI; update the mapping for the JSON key ",and " in fr.json to the
correct French conjunction value (e.g., ", et "), save the file and re-run any
i18n build/validation so the change propagates (look specifically for the ",and
" entry in fr.json to locate and edit it).
| "Compliance confirmation required": "Compliance confirmation required", | ||
| "Compliance confirmed": "Compliance confirmed", | ||
| "Compliance confirmed successfully": "Compliance confirmed successfully", |
There was a problem hiding this comment.
Critical FR compliance UX strings are still untranslated.
These French-locale values are still English, including legal acknowledgements and compliance-gating messages. Since users must read/confirm these to proceed, this creates a high-risk UX/compliance gap for fr.
Also applies to: 869-878, 891-895, 1575-1575, 1988-1989, 2001-2001, 2640-2640, 2872-2872, 3194-3194, 3205-3205, 3744-3744, 3900-3900, 4442-4451
🤖 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/default/src/i18n/locales/fr.json` around lines 799 - 801, The French
locale contains untranslated UX/compliance strings; locate the keys "Compliance
confirmation required", "Compliance confirmed", and "Compliance confirmed
successfully" (and the other untranslated keys noted around lines 869-878,
891-895, 1575, 1988-1989, 2001, 2640, 2872, 3194, 3205, 3744, 3900, and
4442-4451) in web/default/src/i18n/locales/fr.json and replace the English
values with accurate French translations that preserve tone and legal meaning;
ensure pluralization/variables (if any) remain intact and run the localization
linter/CI to validate JSON and coverage after updating all affected keys.
| ",": ", ", | ||
| ", and": "、および", | ||
| ",and ": ", and ", | ||
| "、": ", ", |
There was a problem hiding this comment.
Keep the Japanese separator mappings localized.
These values now normalize , and 、 back to English comma formatting, so otherwise Japanese UI copy will render with mixed punctuation. Please keep these separator entries aligned with the Japanese separators already used elsewhere in this locale.
🤖 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/default/src/i18n/locales/ja.json` around lines 7 - 10, Update the
Japanese separator mappings so values use Japanese punctuation instead of
English commas: change the value for the key "," from ", " to "、"; change the
value for the key "、" from ", " to "、"; change the value for the key ",and "
from ", and " to "、および " (matching the existing "、および" mapping for ", and");
keep the existing ", and": "、および" mapping as-is so all separators are
consistently localized.
| "Account ID *": "アカウントID *", | ||
| "Account Info": "アカウント情報", | ||
| "Account used when authenticating with the SMTP server": "SMTPサーバーで認証する際に使用されるアカウント", | ||
| "acknowledge the related legal risks": "acknowledge the related legal risks", |
There was a problem hiding this comment.
Translate the new compliance flow copy in the Japanese locale.
These entries are still English in ja.json. Because they drive the payment/compliance gating flow, Japanese users will see mixed-language legal text, errors, and exact-match confirmation prompts, which undermines comprehension and can block completion.
Also applies to: 799-801, 869-869, 877-895, 1575-1575, 1988-2002, 2640-2640, 2872-2872, 2966-2966, 3194-3205, 3744-3744, 3868-3868, 3900-3900, 4102-4102, 4442-4451
🤖 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/default/src/i18n/locales/ja.json` at line 123, The Japanese locale
contains untranslated English keys (e.g., the string "acknowledge the related
legal risks" in ja.json) used in the compliance/payment gating flow; replace
these English values with accurate Japanese translations for all listed
occurrences (including ranges 799-801, 869, 877-895, 1575, 1988-2002, 2640,
2872, 2966, 3194-3205, 3744, 3868, 3900, 4102, 4442-4451) and ensure any
exact-match confirmation prompts and error messages preserve meaning and
punctuation so the UI logic (confirmation equality checks) continues to work
with the translated strings.
| "Compliance confirmation required": "Compliance confirmation required", | ||
| "Compliance confirmed": "Compliance confirmed", | ||
| "Compliance confirmed successfully": "Compliance confirmed successfully", |
There was a problem hiding this comment.
Localize compliance/legal consent strings in ru.json before release.
These user-facing compliance confirmations and legal-responsibility statements are still English in the Russian locale. In this flow, that creates a real comprehension risk for gated actions (payment/subscription/redemption/invitation) and undermines informed confirmation.
Also applies to: 869-878, 891-895, 1575-1575, 1988-1990, 2001-2001, 2640-2640, 2872-2872, 3194-3194, 3205-3205, 3744-3744, 3900-3900, 4102-4102, 4442-4451
🤖 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/default/src/i18n/locales/ru.json` around lines 799 - 801, The JSON
contains English strings for compliance/legal confirmations that must be
localized; replace the values for the keys "Compliance confirmation required",
"Compliance confirmed", and "Compliance confirmed successfully" in ru.json with
their correct Russian translations (and likewise update the other listed
keys/strings at the ranges referenced by the reviewer) ensuring the keys remain
unchanged and only the right-hand side values are translated into Russian so the
user-facing confirmation text is fully localized.
| "_copy": "_bản sao", | ||
| ",": ", ", | ||
| ", and": ", và", | ||
| ",and ": ", and ", |
There was a problem hiding this comment.
Fix English connector in Vietnamese locale value
Line 9 maps ",and " to ", and ", which keeps English output in Vietnamese UI. This should be localized consistently (e.g., ", và "), aligned with the adjacent connector key usage.
🤖 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/default/src/i18n/locales/vi.json` at line 9, The Vietnamese locale
currently maps the key ",and " to the English string ", and "; update the value
to the Vietnamese connector ", và " to localize the UI consistently (replace the
value for the ",and " key with ", và "), matching adjacent connector usage in
the vi.json locale.
| "Compliance confirmation required": "Compliance confirmation required", | ||
| "Compliance confirmed": "Compliance confirmed", | ||
| "Compliance confirmed successfully": "Compliance confirmed successfully", |
There was a problem hiding this comment.
Translate compliance/legal Vietnamese strings instead of shipping English fallbacks
Several newly added compliance and legal confirmation texts are still English in vi.json (for example Line 799, Line 877, Line 1988, Line 2872, Line 4442). This can break consent/comprehension flows for Vietnamese users and weakens legal acknowledgment UX.
Please provide actual Vietnamese translations for these keys before release.
Also applies to: 869-870, 877-878, 891-891, 895-895, 1575-1575, 1988-1989, 2001-2001, 2640-2640, 2872-2872, 3194-3194, 3205-3205, 3744-3744, 3900-3900, 4442-4451
🤖 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/default/src/i18n/locales/vi.json` around lines 799 - 801, Replace the
English placeholder values in vi.json for the compliance/legal keys with
accurate Vietnamese translations: update the values for "Compliance confirmation
required", "Compliance confirmed", "Compliance confirmed successfully" (and the
other flagged keys at lines referenced: e.g., the pairs around 869-891, 1575,
1988-2001, 2640, 2872, 3194-3205, 3744, 3900, 4442-4451) by substituting
Vietnamese text while keeping the JSON keys unchanged and preserving punctuation
and sentence meaning; ensure translations are concise, legally clear, and
reviewed for correctness (or sourced from a native/industry translator) so the
consent flows display proper Vietnamese strings.
| "footer.columns.related.title": "相关项目", | ||
| "footer.defaultCopyright": "版权所有。", | ||
| "footer.newapi.projectAttributionSuffix": "版权所有,由项目贡献者设计与开发。", | ||
| "footer.new\u0061pi.projectAttributionSuffix": "版权所有,由项目贡献者设计与开发。", |
There was a problem hiding this comment.
Potential i18n key mismatch caused by escaped key segment
Line 1779 uses footer.new\u0061pi.projectAttributionSuffix (effective key: footer.newapi.projectAttributionSuffix). If code references footer.newApi.projectAttributionSuffix, this translation will never resolve.
Suggested fix
- "footer.new\u0061pi.projectAttributionSuffix": "版权所有,由项目贡献者设计与开发。",
+ "footer.newApi.projectAttributionSuffix": "版权所有,由项目贡献者设计与开发。",As per coding guidelines, "Use hierarchical and semantically clear translation key names such as dashboard.overview.title and maintain naming consistency".
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "footer.new\u0061pi.projectAttributionSuffix": "版权所有,由项目贡献者设计与开发。", | |
| "footer.newApi.projectAttributionSuffix": "版权所有,由项目贡献者设计与开发。", |
🤖 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/default/src/i18n/locales/zh.json` at line 1779, The locale key contains
an escaped segment ("footer.new\u0061pi.projectAttributionSuffix" -> effective
key "footer.newapi.projectAttributionSuffix") which will not match code that
expects "footer.newApi.projectAttributionSuffix"; update the JSON key to the
correct, consistent key name used by the code (e.g.,
"footer.newApi.projectAttributionSuffix") so the translation resolves, ensuring
the change is made for the "footer.newApi.projectAttributionSuffix" entry and
any other occurrences of the escaped form are normalized.
Merged 28 commits from QuantumNous/new-api upstream/main, including: Backend: - feat: support request_header key source (QuantumNous#4903) - fix: apply group filter to channel list queries (QuantumNous#4885, QuantumNous#4847) - fix: enforce header nav access control for public modules (QuantumNous#4889) - fix: correct usage logs filtering (QuantumNous#4883) - fix: allow clearing channel remark (QuantumNous#4886) - feat: track upstream request ID and prevent response header override - feat: require compliance confirmation for paid features Frontend: - fix: 修复新 UI 语言与文案显示问题 (QuantumNous#4876) - fix(web): handle unlimited API key quota validation (QuantumNous#4881) - fix(web/default): batch fix new UI issues (QuantumNous#4880, QuantumNous#4893, QuantumNous#4817, QuantumNous#4877, QuantumNous#4898) - fix: prevent combobox from over-filtering options on focus (QuantumNous#4829) - fix(default): support DropdownMenuItem onSelect (QuantumNous#4787) - chore(deps): bump axios to 1.15.2 Conflict resolution: - Locale JSONs: union merge (design overrides preserved, upstream new keys added) - router/api-router.go: kept design /public/session route, accepted upstream HeaderNavModuleAuth - common-logs-filter-bar.tsx: kept design refactor, added upstream upstreamRequestId field - summary-cards.tsx: kept design layout, adapted to new useSummaryCardsConfig interface - _reports/*.untranslated.json: design state kept (fr/vi removed, ja/ru ours) - Other UI conflicts resolved per .gitattributes ours strategy Co-authored-by: Cursor <cursoragent@cursor.com>
Important
📝 变更描述 / Description
(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
(请在此粘贴截图、关键日志或测试报告,以证明变更生效)
问题描述
修复方式
t()翻译,并补齐渠道测试、多 key 管理和凭证刷新等 fallback 文案。测试说明
missingCount为 0。Summary by CodeRabbit
Release Notes
New Features
Improvements
Localization