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

Message not changed to translated messsage after call client.translate #5349

Open
rixon08 opened this issue Aug 12, 2024 · 9 comments · May be fixed by #5437
Open

Message not changed to translated messsage after call client.translate #5349

rixon08 opened this issue Aug 12, 2024 · 9 comments · May be fixed by #5437
Labels
discussion Discuss solutions, possible features, POCs, etc

Comments

@rixon08
Copy link

rixon08 commented Aug 12, 2024

Describe the bug
I tried to use ChatClient.translate to translate the message to French. After get success, the message won't change anything. But there is description below message "Translated to French".

SDK version

  • 6.4.4

To Reproduce
Steps to reproduce the behavior:

  1. Call function ChatClient.translate
  2. After success, message won't change anything, but there is description below message "Translated to French".

Expected behavior
Message will change after success get translated message

Device:

  • Android version: 14

Screenshots
Screenshot 2024-08-12 at 16 47 57

@rixon08 rixon08 added the bug Something isn't working label Aug 12, 2024
@kanat
Copy link
Collaborator

kanat commented Aug 29, 2024

Hi @rixon08,

It seems like you've enabled auto translation.
If so, you don't need to manually call ChatClient.translate

Here are the docs you could follow instead:

@rixon08
Copy link
Author

rixon08 commented Aug 30, 2024

Hi @kanat
Should I set those 2 docs to make translation work?
Because I just set from this (https://getstream.io/chat/docs/sdk/android/ui/guides/custom-translations/#automatic-translation) docs only

@kanat
Copy link
Collaborator

kanat commented Aug 30, 2024

Hi @rixon08,

Yes, both setups are required.

@rixon08
Copy link
Author

rixon08 commented Sep 3, 2024

Hi @kanat
What if I want to translate one message only that I choose, not all message in that channel. Should I call ChatClient.translate and set this docs https://getstream.io/chat/docs/node/translation/#enabling-automatic-translation?

@kanat
Copy link
Collaborator

kanat commented Sep 10, 2024

Hi @rixon08,

If you'd like translate just a single message, you don't need to enable auto_translation at all.
You can just call ChatClient.translate

@kanat kanat added discussion Discuss solutions, possible features, POCs, etc and removed bug Something isn't working labels Sep 10, 2024
@rixon08
Copy link
Author

rixon08 commented Sep 17, 2024

Hi @kanat
I've tried to add this doc https://getstream.io/chat/docs/sdk/android/ui/guides/custom-translations/#supporting-auto-translation-in-the-custom-chatmessagetexttransformer and after I call ChatClient.translate, message doesn't changed. But after I close View then I open again, the message has changed. How to make message changed after call ChatClient.translate?

@kanat
Copy link
Collaborator

kanat commented Sep 25, 2024

Hey @rixon08,

What UI components do you use: Compose or XML?

@rixon08
Copy link
Author

rixon08 commented Sep 26, 2024

Hi @kanat
I'm using XML

@kanat kanat linked a pull request Oct 9, 2024 that will close this issue
16 tasks
@kanat
Copy link
Collaborator

kanat commented Oct 9, 2024

Hey @rixon08,

We’ve created a PR that adds a Translate action to the sample app, so you can implement something similar.

Please note that although the SampleApp uses ChatClient.getCurrentUser().language, it’s not mandatory to follow this approach. You can pass any language you prefer, such as the language stored in your app.

Manual Translation to User's language
Translate_to_French.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discuss solutions, possible features, POCs, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@kanat @rixon08 and others