Skip to content

fix(i18n): add missing translation keys for model provider form fields - #17551

Merged
wangq8 merged 2 commits into
infiniflow:mainfrom
dcc123456:fix/model-provider-placehoder-0730
Jul 30, 2026
Merged

wangq8 merged 2 commits into
infiniflow:mainfrom
dcc123456:fix/model-provider-placehoder-0730

Conversation

@dcc123456

Copy link
Copy Markdown
Collaborator

Summary

fix(i18n): add missing translation keys for model provider form fields

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 30, 2026
@dcc123456
dcc123456 requested a review from wangq8 July 30, 2026 02:29
@dcc123456 dcc123456 added 🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration labels Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Provider configuration locale maps add API key placeholders, PaddleOCR algorithm labels, and FishAudio API-key and reference-ID messages in English and Chinese.

Changes

Provider configuration locale updates

Layer / File(s) Summary
Provider configuration translations
web/src/locales/en.ts, web/src/locales/zh.ts
Adds API key placeholder and PaddleOCR algorithm selection labels in both locales, and updates English FishAudio API-key and reference-ID messages.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: cike8899, euvre

Poem

A rabbit hops through words so bright,
API keys now greet the light.
PaddleOCR chooses with care,
FishAudio finds its reference there.
Two tongues bloom fresh in the UI air.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description uses the required Summary heading, but it only repeats the title and lacks any brief explanation or background context. Expand the Summary with what problem the new keys solve and any relevant context about the affected forms or locales.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title is clear, concise, and matches the main change: adding missing i18n keys for provider form fields.

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.

@dcc123456
dcc123456 marked this pull request as draft July 30, 2026 02:29
@dcc123456
dcc123456 marked this pull request as ready for review July 30, 2026 02:29
@dosubot dosubot Bot added the 🧰 typescript Pull requests that update Typescript code label Jul 30, 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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between dcaa62f and c2ee65f.

📒 Files selected for processing (2)
  • web/src/locales/en.ts
  • web/src/locales/zh.ts

Comment thread web/src/locales/en.ts
addTheModel: 'Add',
apiKey: 'API Key',
apiKeyMessage: 'Please enter the API Key',
apiKeyPlaceholder: 'Please enter the API Key',

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.

📐 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

Comment thread web/src/locales/en.ts
Comment on lines +2206 to 2207
FishAudioRefIDMessage:
'Please input the Reference ID (leave blank to use the default model).',

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.

🗄️ 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
fi

Repository: 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 200

Repository: 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 -n

Repository: 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 wangq8 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Simple and correct i18n fix.

What this fixes:

  • Component code in provider-config-map.ts already references FishAudioAKMessage and FishAudioRefIDMessage (without the add prefix), but the locale files had addFishAudioAKMessage and addFishAudioRefIDMessage. This mismatch meant those translation keys were silently broken.
  • Adds missing apiKeyPlaceholder key (already referenced by components like google-form/index.tsx).
  • Adds missing paddleocrSelectAlgorithm key.

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!

@wangq8
wangq8 merged commit 493f605 into infiniflow:main Jul 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files. 🧰 typescript Pull requests that update Typescript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants