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

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

Closed
4 tasks done
comfuture opened this issue Nov 6, 2024 · 1 comment
Closed
4 tasks done
Labels
🐞 bug Something isn't working

Comments

@comfuture
Copy link
Contributor

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.

Copy link

dosubot bot commented 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 dosubot bot added the 🐞 bug Something isn't working label Nov 6, 2024
@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Dec 7, 2024
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2024
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Dec 22, 2024
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
None yet
Development

No branches or pull requests

1 participant