Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] "Auto Generate" fields sometimes outputs in Chinese #4622

Open
darxreborn opened this issue Nov 6, 2024 · 2 comments
Open

[Bug] "Auto Generate" fields sometimes outputs in Chinese #4622

darxreborn opened this issue Nov 6, 2024 · 2 comments
Labels
🐛 Bug Something isn't working | 缺陷

Comments

@darxreborn
Copy link

darxreborn commented Nov 6, 2024

📦 Environment

Docker

📌 Version

1.28.0

💻 Operating System

Windows, macOS, Ubuntu, Other Linux

🌐 Browser

Chrome, Edge, Safari, Firefox, Other

🐛 Bug Description

When creating a new assistant and providing a role setting, within the assistant setting ("Assistant Info") the button "Auto Generate" sometimes outputs/fills in the data in Chinese rather than the user's language.

📷 Recurrence Steps

Example:

  1. image
  2. image

🚦 Expected Behavior

The output should be in English (example):
image

📝 Additional Information

The generate in Chinese text is quite random; so everytime the button is clicked the output will be written in Chinese more often that in English.
User setting is set to English:
image

@darxreborn darxreborn added the 🐛 Bug Something isn't working | 缺陷 label Nov 6, 2024
@lobehubbot
Copy link
Member

👀 @ggatesdew

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

Copy link

dosubot bot commented Nov 6, 2024

Hey there, @ggatesdew! I'm here to help you with any bugs, questions, or contributions. Let's tackle this issue together!

The issue you're experiencing with the "Auto Generate" feature outputting in Chinese instead of the user's preferred language might be related to how the language preference is being detected or applied. Here are a few areas to investigate:

  1. Language Detection and Preference: Ensure that the language detection mechanism is correctly identifying and applying the user's language preference. The application uses the createI18nNext function with the i18next library and LanguageDetector plugin to determine the user's language preference, which is stored in cookies [1].

  2. Fallback Mechanism: Check if the fallback mechanism is inadvertently defaulting to Chinese. The system should fall back to a default language if the preferred language is not available. This default is determined by the DEFAULT_LANG constant, which should be set correctly to avoid unexpected language outputs [2].

  3. Translation Files: Verify that the translation files for the preferred language (e.g., English) are complete and correctly configured. Any discrepancies in these files could lead to incorrect language output.

  4. Code Logic: Review the logic in the AutoGenerateInput.tsx file to ensure that the translation function t is being used correctly to fetch the appropriate language strings [3].

By checking these areas, you might identify the root cause of the issue. If the problem persists, consider reviewing recent changes in the codebase that might have affected language handling.

To continue talking to Dosu, mention @dosu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷
Projects
Status: Roadmap - Chat 1.x
Development

No branches or pull requests

2 participants