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

[FW][FIX] im_livechat: fix chatbot test page translation #162858

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Apr 22, 2024

This PR fixes two translation issues when launching a chat bot with a different language than the user's:

  • Wrong translation for question_selection answers
  • Wrong translation for the question_email answers
  1. The answers to a question_selection could be mistranslated because the post_welcome_steps method overwrites the context's language when calling message_post. As a result, the discuss.channel/new_message notification would have the wrong answers format.

    Steps to reproduce the issue:

    • Go to the test chat bot page
    • Switch the website language to the one that is not used by the user.
    • Check the return result of post_welcome_steps: answers are in the correct language.
    • Check the corresponding discuss.channel/new_message notification received through the websocket: the language is the one of the user.
  2. The chat bot language is not specified when calling the validate_email route so the lang is the one of the user by default.

    Steps to reproduce the issue:

    • Go to the chatbot test page
    • Activate another language than the one of the user
    • Select "I have a pricing question" with no operator available
    • Enter an invalid email
    • The answer is in the user's language while it should not

opw-3862125

Forward-Port-Of: #162655

This PR fixes two translation issues when launching a chat bot with a
different language than the user's:

1. Wrong translation for `question_selection` answers
2. Wrong translation for the `question_email` answers

1. The answers to a `question_selection` could be mistranslated
because the lang is missing from the context when `post_welcome_steps`
is called`. As a result, the `discuss.channel/new_message`
notification    would have the wrong answers format.

Steps to reproduce the issue:
- Go to the test chat bot test page
- Switch the website language to the one that is not used by the user.
- Check the return result of `post_welcome_steps`: answers are in the
correct language.
- Check the corresponding `discuss.channel/new_message` notification
received through the websocket: the language is the one of the user.

2. The chat bot language is not specified when calling the
`validate_email` route so the lang is the one of the user by default.

Steps to reproduce the issue:
- Go to the chat bot test page
- Activate another language than the one of the user
- Select "I have a pricing question" with no operator available
- Enter an invalid email
- The answer is in the user's language while it should not

opw-3862125

X-original-commit: c9cfd25
@robodoo
Copy link
Contributor

robodoo commented Apr 22, 2024

Pull request status dashboard.

@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 22, 2024

This PR targets saas-17.1 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Apr 22, 2024
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Apr 22, 2024
@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 22, 2024

@tsm-odoo the next pull request (#162881) is in conflict. You can merge the chain up to here by saying

@fw-bot r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@tsm-odoo
Copy link
Contributor

@fw-bot r+

robodoo pushed a commit that referenced this pull request Apr 23, 2024
This PR fixes two translation issues when launching a chat bot with a
different language than the user's:

1. Wrong translation for `question_selection` answers
2. Wrong translation for the `question_email` answers

1. The answers to a `question_selection` could be mistranslated
because the lang is missing from the context when `post_welcome_steps`
is called`. As a result, the `discuss.channel/new_message`
notification    would have the wrong answers format.

Steps to reproduce the issue:
- Go to the test chat bot test page
- Switch the website language to the one that is not used by the user.
- Check the return result of `post_welcome_steps`: answers are in the
correct language.
- Check the corresponding `discuss.channel/new_message` notification
received through the websocket: the language is the one of the user.

2. The chat bot language is not specified when calling the
`validate_email` route so the lang is the one of the user by default.

Steps to reproduce the issue:
- Go to the chat bot test page
- Activate another language than the one of the user
- Select "I have a pricing question" with no operator available
- Enter an invalid email
- The answer is in the user's language while it should not

opw-3862125

closes #162858

X-original-commit: c9cfd25
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
@robodoo robodoo closed this Apr 23, 2024
@fw-bot fw-bot deleted the saas-17.1-17.0-im_livechat-fix_chatbot_test_translation-tsm-xZSI-fw branch May 7, 2024 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants