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

fix: Resolve errors caused by Chrome's translation feature #553

Merged
merged 4 commits into from
Jul 18, 2024

Conversation

Ihara-kenta
Copy link
Contributor

@Ihara-kenta Ihara-kenta commented Jul 9, 2024

修正概要

  • ページ全体を Google 自動翻訳の対象外にした

修正背景

  • 特定のメッセージが返答された場合に Javascritp エラーになっている
  • 翻訳ページ (/translate) でも日英での翻訳部分も自動で翻訳されており、意図していない動作をしていた
  • リポジトリ全体が日本向けに構成されており、国外での提供は予定していないため、 ページ全体に翻訳機能を有効化にする必要性はないと考え、ページ全体に適用をした

Issue #, if available:
Related Issue: #518

Description of changes:

  • Fix JavaScript errors occurring when Chrome's translation feature is enabled
  • Resolve conflicts between elements inserted by the translation feature and application's DOM manipulation
  • Add policy to prohibit the use of Google auto-translation
  • Fix an error in google translation

References:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Ihara-kenta Ihara-kenta marked this pull request as draft July 9, 2024 09:36
@Ihara-kenta
Copy link
Contributor Author

Ihara-kenta commented Jul 9, 2024

TODO

  • 動作担保
  • 事象の再現と再発をしないことを確認

検証詳細

対象ブラウザ

再現ステップ

  1. ブラウザの自動翻訳機能を ON にする
  2. トップページから 「チャット」 の試すボタンをクリック
  3. テンプレートのフィボナッチ数列の文言を送信
  4. エラーを確認

- Fix JavaScript errors occurring when Chrome's translation feature is enabled
- Resolve conflicts between elements inserted by the translation feature and application's DOM manipulation

References:
- facebook/react#11538 (comment)

Related Issue: aws-samples#518
@Ihara-kenta Ihara-kenta force-pushed the fix-chrome-translation-error branch from b511303 to 5bafb47 Compare July 9, 2024 09:39
@Ihara-kenta
Copy link
Contributor Author

チャットページ

Google Chrome

Before

chat_before

After

chat_after

Microsoft Edge

Before

chat_before_edge

After

chat_after_edge

翻訳ページ

Google Chrome

Before

スクリーンショット 2024-07-18 13 12 42

After

スクリーンショット 2024-07-18 13 13 32

Microsoft Edge

Before

スクリーンショット 2024-07-18 13 15 52

After

スクリーンショット 2024-07-18 13 15 09

@Ihara-kenta Ihara-kenta marked this pull request as ready for review July 18, 2024 04:37
Copy link
Contributor

@tbrand tbrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!! ありがとうございます!

@tbrand tbrand merged commit b451c6d into aws-samples:main Jul 18, 2024
2 checks passed
@Ihara-kenta Ihara-kenta deleted the fix-chrome-translation-error branch July 21, 2024 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants