Using @app.url_defaults, add the locale in links generated with url_for. This means that once a user is within a locale namespace, all links in the application will continue using that namespace. This change also excludes the default locale, so when a user visits /, they will be linked to /about, not /en/about.
Coverage increased (+0.1%) to 86.163% when pulling b6c49e9d058d9f6a356e95dbf4a78696c903668c on url-for-with-locale into 6212b66499e4f9be5b6a5b67f7c6f3e84b3efc90 on master.
Coverage increased (+0.1%) to 86.163% when pulling b6c49e9d058d9f6a356e95dbf4a78696c903668c on url-for-with-locale into 6212b66499e4f9be5b6a5b67f7c6f3e84b3efc90 on master.
Using
@app.url_defaults
, add the locale in links generated withurl_for
. This means that once a user is within a locale namespace, all links in the application will continue using that namespace. This change also excludes the default locale, so when a user visits/
, they will be linked to/about
, not/en/about
.