Openbravo Issue Tracking System - POS2
View Issue Details
0052745POS2Corepublic2023-06-14 17:442024-03-14 12:47
cberner 
Triage Platform Base 
normalminorhave not tried
newopen 
5
 
 
No
0052745: Chrome auto-detects wrong language, always detecting English(also when language changed)
Chrome based browsers use the following mechanism to detect the current language of a website: https://stackoverflow.com/a/3130857 [^]

It seems that in the react application we are always setting the main html element to lang="en", which stands for English language. This means, that when changing the profile language to for example French, the language of the page to chrome is still English and not French. This results in the browser suggesting to translate the page from English to the system's language.

For example, if I have my system set to Spanish language and I logged in and switched my profile default language to Spanish in pos2, I will get suggested by chrome to translate the webpage from English to Spanish, although it is already in Spanish.
1. Set system language to any other than English(or keep english and see that there's no suggestion to translate when switching to another language)
2. Open WebPOS2, login and change the current default language to another than English. Profile -> Change language (mark the set default checkbox)
3. Check that when refreshing or reentering the page, you're shown the suggestion to translate from English to your system language.
Apply the solution provided here but using react: https://stackoverflow.com/a/3130857 [^]

This means to change the main html element when switching profile language: https://stackoverflow.com/a/52287911 [^]
No tags attached.
gif french suggested language.gif (1,366,915) 2024-03-14 12:47
https://issues.openbravo.com/file_download.php?file_id=19548&type=bug
Issue History
2023-06-14 17:44cbernerNew Issue
2023-06-14 17:44cbernerAssigned To => Triage Platform Base
2023-06-14 17:44cbernerTriggers an Emergency Pack => No
2023-06-14 17:48cbernerDescription Updatedbug_revision_view_page.php?rev_id=26259#r26259
2024-03-14 12:47cbernerFile Added: french suggested language.gif

There are no notes attached to this issue.