Announcing Dash Bio 1.0.0 🎉 : a one-stop-shop for bioinformatics and drug development visualizations.

Supporting differnt languages (aka, i18n)


I’m creating a dashboard using Dash that needs to display text (headers, paragraphs, etc.) in different languages. I have been looking for a way to do this directly in Dash, as well as using a third library that works well with Flask (for example, flask-babel)

What is the right approach for this problem?

Suppose that I have a simple application like the following one:

import dash
import dash_core_components as dcc
import dash_html_components as html
import as px

app = dash.Dash()

content = [
    dcc.Graph(['a', 'b'], y=[3, 2], title='Graph title'))

app.layout = html.Div(content)

if __name__ ==  '__main__':
    app.run_server(port=5000, debug=True)

My goal is to have the strings Header, Paragraph and Graph title translated to the language of the user’s web browser (I’m also fine if I need to add a toolbar that allows the user to select the language).