Open udaynwa opened 8 months ago
We should discuss this on our dev call.
Challenges:
Use POST /api/Home/Detect endpoint of the translation service to detect language.
Should be checked on the Summary
field
Can we check language right after the first page of the FR form is completed? Then user would be still on the form when detection is finished. When finished, maybe a pop-up window could ask to confirm the detected language (Or even without confirmation the original language would be set to the detected language). How does that sound?
I think, it should happen on the Frontend before saving the data.
Submission workflow options:
Option 1: When user submits the FR, a warning could pop-up in the UI language saying "We detected the form has been filled in XXXXX language. Please confirm it." If user clicks on the "Confirm" button then Original_language will be changed to the detected language. If user click on "Reject" button then the Original_language will not be updated.
Option 2: When user submits the FR, the Original_language will be set based on the detected language. No message box shows up. If language dtection fails, then Original_language remains the UI language
I believe Option 2 would be easier and nicer solution, however we need to check how effective is the Language detection on the Summary field, to avoid changing the FR and Emergency page Original_language to a falsely detected language.
- Option 2: When user submits the FR, the Original_language will be set based on the detected language. No message box shows up. If language dtection fails, then Original_language remains the UI language
I believe Option 2 would be easier and nicer solution, however we need to check how effective is the Language detection on the Summary field, to avoid changing the FR and Emergency page Original_language to a falsely detected language.
@tovari I do agree that option 2 is a nicer solution. I do agree that we need to assess the effectiveness of the language detection service. The language detection won't always work and automatically saving in the detected language that is a mismatch could lead to translation issues. A confirmation from the user will always be a good idea.
DEV comment
This is feasible, but it will add extra cost/time to the translation as we need to send multiple requests for language checks and translation.
cc @tovari