dify icon indicating copy to clipboard operation
dify copied to clipboard

fix: move hardcoded text to language settings (#16990)

Open Perfecto23 opened this issue 8 months ago • 4 comments

  • 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:

  1. Replaced hardcoded text in API code (such as default conversation names and dataset descriptions) with I18nObject instances that support multilingual content.
  2. Moved hardcoded UI text from frontend components (like ImageInput prompts) to i18n configuration files.
  3. 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 image Using i18n configured multilingual prompt text image
Static page title "Plugins - Dify" image Dynamic i18n title using ${t('plugin.metadata.title')} - Dify image

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) and cd web && npx lint-staged(frontend) to appease the lint gods

Perfecto23 avatar Mar 30 '25 10:03 Perfecto23

@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

Perfecto23 avatar Mar 30 '25 10:03 Perfecto23

Thanks, @Perfecto23 I will take a look at this PR later.

crazywoola avatar Mar 31 '25 02:03 crazywoola

I will fix these problem tonight.

Perfecto23 avatar Mar 31 '25 02:03 Perfecto23

image

Please approval this PR's workflow, thanks @crazywoola

Perfecto23 avatar Mar 31 '25 14:03 Perfecto23