fix: move hardcoded text to language settings (#16990)
- Move hardcoded text from components and API to language configuration files
- Improve internationalization support for plugins, image inputs and dataset messages
Summary
This PR addresses issue #16990 by moving hardcoded text from components and API code to language configuration files. The changes focus on three main areas:
- Replaced hardcoded text in API code (such as default conversation names and dataset descriptions) with I18nObject instances that support multilingual content.
- Moved hardcoded UI text from frontend components (like ImageInput prompts) to i18n configuration files.
- Improved internationalization support for plugins, image inputs, and dataset-related messages.
These changes enhance the system's internationalization capabilities, making textual content more maintainable and extensible across different languages.
Fixes #16990
Screenshots
| Before | After |
|---|---|
| Hardcoded dataset description text "useful for when you want to answer queries about..." | Using I18nObject with multilingual dataset descriptions |
| Hardcoded image upload component prompt text |
Using i18n configured multilingual prompt text |
| Static page title "Plugins - Dify" |
Dynamic i18n title using ${t('plugin.metadata.title')} - Dify |
Checklist
[!IMPORTANT]
Please review the checklist below before submitting your pull request.
- [ ] This change requires a documentation update, included: Dify Document
- [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
- [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
- [x] I've updated the documentation accordingly.
- [x] I ran
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods
@crazywoola
Hello maintainers, this is my first PR contribution in Dify repository. I've addressed issue #16990 by moving hardcoded text to language configuration files to improve internationalization support.
As a new contributor, I've carefully followed the project guidelines and made sure to keep the changes focused and well-tested. I would greatly appreciate your review and feedback on this PR when you have the time.
Thank you for maintaining such an excellent project, and I look forward to making more contributions to Dify in the future.
Best regards
Thanks, @Perfecto23 I will take a look at this PR later.
I will fix these problem tonight.
Please approval this PR's workflow, thanks @crazywoola