Repository navigation
fix(i18n): add missing translation keys for model provider form fields - #17551
Conversation
📝 WalkthroughWalkthroughProvider configuration locale maps add API key placeholders, PaddleOCR algorithm labels, and FishAudio API-key and reference-ID messages in English and Chinese. ChangesProvider configuration locale updates
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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: 2
🤖 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`:
- Line 2017: Update the new English translation entries near apiKeyPlaceholder
and the additional referenced entries to use sentence case: lowercase ordinary
nouns such as “key,” “algorithm,” and “reference ID,” while preserving acronyms
and proper nouns.
- Around line 2206-2207: Align FishAudioRefIDMessage with the fish_audio_refid
field contract: since provider-config-map.ts marks it required, update the
message to require a non-empty Reference ID and remove the instruction that
blank input uses the default model. Alternatively, only retain the blank-input
wording if fish_audio_refid is made optional and its required validation is
removed.
🪄 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 Plus
Run ID: 623a807c-4956-4b64-a306-e06d81880197
📒 Files selected for processing (2)
web/src/locales/en.tsweb/src/locales/zh.ts
| addTheModel: 'Add', | ||
| apiKey: 'API Key', | ||
| apiKeyMessage: 'Please enter the API Key', | ||
| apiKeyPlaceholder: 'Please enter the API Key', |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use sentence case for the new English translations.
These entries capitalize ordinary nouns (Key, Algorithm, Reference ID) in sentence positions. Please preserve acronyms and proper nouns, but lowercase common nouns.
Proposed wording
- apiKeyPlaceholder: 'Please enter the API Key',
+ apiKeyPlaceholder: 'Please enter the API key',
- paddleocrSelectAlgorithm: 'Select Algorithm',
+ paddleocrSelectAlgorithm: 'Select algorithm',
- FishAudioAKMessage: 'Please input your API Key',
- addFishAudioRefID: 'FishAudio Reference ID',
+ FishAudioAKMessage: 'Please input your API key',
+ addFishAudioRefID: 'Fish Audio reference ID',Also applies to: 2055-2055, 2204-2205
🤖 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/locales/en.ts` at line 2017, Update the new English translation
entries near apiKeyPlaceholder and the additional referenced entries to use
sentence case: lowercase ordinary nouns such as “key,” “algorithm,” and
“reference ID,” while preserving acronyms and proper nouns.
Source: Coding guidelines
| FishAudioRefIDMessage: | ||
| 'Please input the Reference ID (leave blank to use the default model).', |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Locate relevant files"
git ls-files | rg 'provider-config-map|fish_audio|locales/(en|zh)\.ts' || true
echo
echo "Search for fish_audio_refid"
rg -n "fish_audio_refid|FishAudioRefIDMessage|Reference ID" . || true
echo
echo "Inspect provider-config-map around fish_audio"
for f in $(git ls-files | rg 'provider-config-map'); do
echo "--- $f ---"
rg -n -C 8 "fish_audio_refid" "$f"
done
echo
echo "Inspect en.ts around FishAudioRefIDMessage"
f="web/src/locales/en.ts"
if [ -f "$f" ]; then
wc -l "$f"
sed -n '2196,2212p' "$f" | cat -n
fiRepository: infiniflow/ragflow
Length of output: 6476
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Inspect form validation handling"
for f in $(git ls-files | rg 'provider-schema|FormFieldType|required|placeholder|validation'); do
echo "--- outline $f ---"
ast-grep outline "$f" --view compact || true
echo
done
echo
echo "Search for form validation helpers"
rg -n "FormFieldType|required|placeholder:|validation:|placeholder" web/src/pages/user-setting/setting-model/provider-schema web/src -g '*.ts' -g '*.tsx' | head -n 200Repository: infiniflow/ragflow
Length of output: 33500
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Inspect dynamic form validation implementation"
for f in $(git ls-files | rg 'components/dynamic-form|dynamic-form'); do
echo "--- $f ---"
wc -l "$f"
ast-grep outline "$f" --view signatures || true
rg -n -C 4 "required|validation|placeholder|Error|validate|Text" "$f" || true
done
echo
echo "Inspect hook rendering around provider fields"
f="web/src/pages/user-setting/setting-model/provider-schema/hooks/use-provider-fields.tsx"
sed -n '180,255p' "$f" | cat -n
echo
echo "Inspect provider modal action validation around submit"
f="web/src/pages/user-setting/setting-model/provider-schema/hooks/use-provider-modal-actions.ts"
wc -l "$f"
ast-grep outline "$f" --view signatures || true
sed -n '1,260p' "$f" | cat -nRepository: infiniflow/ragflow
Length of output: 23619
Align the FishAudio reference-ID message with the required field contract.
provider-config-map.ts configures fish_audio_refid as required: true, which generates a non-empty string minimum-length validation; leaving it blank can fail. Update FishAudioRefIDMessage to require a reference ID, or make the field optional and remove its required validation if blank IDs are supported.
🤖 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/locales/en.ts` around lines 2206 - 2207, Align FishAudioRefIDMessage
with the fish_audio_refid field contract: since provider-config-map.ts marks it
required, update the message to require a non-empty Reference ID and remove the
instruction that blank input uses the default model. Alternatively, only retain
the blank-input wording if fish_audio_refid is made optional and its required
validation is removed.
wangq8
left a comment
There was a problem hiding this comment.
LGTM! Simple and correct i18n fix.
What this fixes:
- Component code in
provider-config-map.tsalready referencesFishAudioAKMessageandFishAudioRefIDMessage(without theaddprefix), but the locale files hadaddFishAudioAKMessageandaddFishAudioRefIDMessage. This mismatch meant those translation keys were silently broken. - Adds missing
apiKeyPlaceholderkey (already referenced by components likegoogle-form/index.tsx). - Adds missing
paddleocrSelectAlgorithmkey.
One note (non-blocking):
Other locale files (pt-br, bg, vi, ru, ja, fr, es, ko, de) still have the old addFishAudio* key names — they'll need the same rename in a follow-up. But that's fine to handle separately.
Thanks!
Summary
fix(i18n): add missing translation keys for model provider form fields