Black Lives Matter. Please consider donating to Black Girls Code today.

Dash app html language and translate attributes

Context: Set the language identification of the Dash app for built in translators such as Chrome’s “Translate”

Progress: I was able to specify the global language of the Dash page using the following entrance in the meta_tags:

                    'http-equiv': 'content-language',
                    'content': 'en-us'

I’m also aware that each dash html component has the ‘lang’ attribute for specifying individually each component’s language.

Problem: There is no way of specifying the ‘translate’ attribute for dash html components, the mentioned HTML attribute is useful for telling translators such as Chrome’s to ignore or not that specific text (eg do not translate “wc” to “baño (bathroom)”. This feature would also be needed inside in sub-components of html components such as Dash Datatable (eg. ability to specify ‘translate’ attribute for each column header).

The automatic translate functionality is very useful and it would be really helpful to have this attribute enabled.

SOLUTION: As it turns out, the translate attribute is no longer the way to do this, instead, simply specify “notranslate” className in your html element that contains the text you don’t want to be translated automatically.