Variables within the substitute areas are being localized and not substituted correctly #6587

Closed
opened 2026-02-21 18:16:26 -05:00 by yindo · 1 comment
Owner

Originally created by @comfuture on GitHub (Nov 6, 2024).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.11.0

Utility with translation issue

workflow

🌐 Language affected

Almost all languages except English.

Actual phrase(s)

In the commit de5dfd99f65151402140f6e0afc16a13154cbe89, the substitute areas for most languages (e.g., {{count}}) were localized. As a result, variables within these placeholders are not being substituted correctly.

✔️ Expected phrase(s)

The substitute areas (e.g., {{count}}) should remain unchanged during localization to ensure that variables are correctly substituted.

ℹ Why is the current translation wrong

It seems that the translation files were generated through machine translation.

Originally created by @comfuture on GitHub (Nov 6, 2024). ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.11.0 ### Utility with translation issue workflow ### 🌐 Language affected Almost all languages except English. ### ❌ Actual phrase(s) In the commit [de5dfd99f65151402140f6e0afc16a13154cbe89](https://github.com/langgenius/dify/commit/de5dfd99f65151402140f6e0afc16a13154cbe89), the substitute areas for most languages (e.g., `{{count}}`) were localized. As a result, variables within these placeholders are not being substituted correctly. ### ✔️ Expected phrase(s) The substitute areas (e.g., `{{count}}`) should remain unchanged during localization to ensure that variables are correctly substituted. ### ℹ Why is the current translation wrong It seems that the translation files were generated through machine translation.
yindo added the 🐞 bug label 2026-02-21 18:16:26 -05:00
yindo closed this issue 2026-02-21 18:16:26 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 6, 2024):

Hello @comfuture! 👋 I'm here to help you with any bugs, questions, or contributions you might have. I'm a bot named Dosu, and I'm ready to assist you while you wait for a human maintainer.

I found a similar unsolved discussion regarding an error with invalid variables, which might be related to your issue. You can check it out here: Error in item: Invalid variable [1].

Regarding your issue, it seems that during the localization process, placeholders like {{count}} were incorrectly translated, which is causing the substitution to fail. This typically happens when machine translation tools do not recognize these placeholders as non-translatable elements.

To resolve this, you should ensure that the translation process preserves these placeholders. This can often be done by configuring the translation tool to ignore specific patterns or by manually reviewing and correcting the translation files to ensure placeholders remain unchanged. If there are any automated tests or scripts in the Dify codebase for checking the correct handling of placeholders, they might need to be updated or created to catch such issues in the future.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Nov 6, 2024): <!-- Greeting --> Hello @comfuture! 👋 I'm here to help you with any bugs, questions, or contributions you might have. I'm a bot named [Dosu](https://dosu.dev), and I'm ready to assist you while you wait for a human maintainer. <!-- Answer --> I found a similar unsolved discussion regarding an error with invalid variables, which might be related to your issue. You can check it out here: [Error in item: Invalid variable](https://github.com/langgenius/dify/discussions/8611) <sup>[[1]](https://github.com/langgenius/dify/discussions/8611)</sup>. Regarding your issue, it seems that during the localization process, placeholders like `{{count}}` were incorrectly translated, which is causing the substitution to fail. This typically happens when machine translation tools do not recognize these placeholders as non-translatable elements. To resolve this, you should ensure that the translation process preserves these placeholders. This can often be done by configuring the translation tool to ignore specific patterns or by manually reviewing and correcting the translation files to ensure placeholders remain unchanged. If there are any automated tests or scripts in the Dify codebase for checking the correct handling of placeholders, they might need to be updated or created to catch such issues in the future. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6587