sequentech / documentation

Sequent Tech documentation site
https://sequentech.github.io/documentation/
GNU Affero General Public License v3.0
1 stars 0 forks source link

adding support for prevent_site_translation parameter #111

Closed edulix closed 1 year ago

edulix commented 1 year ago

Parent issue: https://github.com/sequentech/meta/issues/60

Problem description

In some cases, the web browser automatically translates the frontend web sites when it shouldn't. EPI has reported this happening in a case in which the whole website is already in english, but the browser detects the german article die as an english word and translate it to the english translation of the word die. Not good.

Proposed Solution

Add to config.yml a parameter config.sequent_ui.prevent_site_translation that is false by default, but when enabled it sets the translate="no" attribute to the <html> element . translateis an official HTML5 attribute that indicates that the content of this element should not be translated.

Rationale

Adding the translate="no" attribute should prevent the browser from translating what it shouldn't. Note that, we are already indicating the language of the content in the HTML element, so it should not be translating from that language. And if the text language is for example "german" and the user wants a translation to "arabic", we would be preventing that from happening. For that reason, this should not be enabled by default. But in any specific deployment, it can be set.