[PR #26710] Fix/tool provider tag internationalization #31525

Closed
opened 2026-02-21 20:49:37 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/26710

State: closed
Merged: Yes


Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

This PR fixes the internationalization issue with tool provider tags in the provider list component. Previously, tags like "# search" were displayed in English regardless of the user's locale setting, which created an inconsistent user experience for non-English users.

Changes Made:

  • Added useTags hook to web/app/components/tools/provider-list.tsx
  • Implemented getTagLabel function to translate tag labels based on current locale
  • Ensures all tool provider tags are properly internationalized

Technical Details:

  • The fix leverages the existing useTags hook from web/hooks/use-tags.ts
  • Uses getTagLabel(tag) to get the localized version of each tag
  • Maintains backward compatibility and doesn't affect existing functionality

Fixes https://github.com/langgenius/dify/issues/26711

Screenshots

Before After
Tags displayed in English: "# search", "# web_search" Tags displayed in user's locale: "# 搜索", "# 网络搜索" (for Chinese users)
image image image

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/26710 **State:** closed **Merged:** Yes --- > [!IMPORTANT] > > 1. Make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) > 1. Ensure there is an associated issue and you have been assigned to it > 1. Use the correct syntax to link this PR: `Fixes #<issue number>`. ## Summary This PR fixes the internationalization issue with tool provider tags in the provider list component. Previously, tags like "# search" were displayed in English regardless of the user's locale setting, which created an inconsistent user experience for non-English users. ### Changes Made: - Added `useTags` hook to `web/app/components/tools/provider-list.tsx` - Implemented `getTagLabel` function to translate tag labels based on current locale - Ensures all tool provider tags are properly internationalized ### Technical Details: - The fix leverages the existing `useTags` hook from `web/hooks/use-tags.ts` - Uses `getTagLabel(tag)` to get the localized version of each tag - Maintains backward compatibility and doesn't affect existing functionality Fixes https://github.com/langgenius/dify/issues/26711 ## Screenshots | Before | After | |--------|-------| | Tags displayed in English: "# search", "# web_search" | Tags displayed in user's locale: "# 搜索", "# 网络搜索" (for Chinese users) | | <img width="530" height="241" alt="image" src="https://github.com/user-attachments/assets/d11169fd-3c8b-4227-8018-5cf571dffbc1" /> <img width="1913" height="918" alt="image" src="https://github.com/user-attachments/assets/740ecdf4-a69e-42f5-816e-9c56958ce31c" /> | <img width="523" height="265" alt="image" src="https://github.com/user-attachments/assets/f04a65e4-0b6b-4350-a56f-0926283045cb" /> | ## Checklist - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [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
yindo added the pull-request label 2026-02-21 20:49:37 -05:00
yindo closed this issue 2026-02-21 20:49:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#31525