Multilingual flask application
I believe that Flask-Babel is what you are looking for.
You can achieve this by creating a decorator that decides which route to use.
def lang_route(en, fr, *args, **kwargs):
# Find out the user's language
lang = "en"
if lang == "en":
return app.route(en, *args, **kwargs)
if lang == "fr":
return app.route(fr, *args, **kwargs)
@lang_route(en="/staff", fr="/equipe")
def staff():
return "staff"