Skip to content
Snippets Groups Projects
Commit 3ecacadc authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

app-shell: in case routing to an unknown language, fall back to the default

This happens for example if we access "/dbp-signature.html" in which case the
router interprets the file name as a language.
parent f3994e09
No related branches found
No related tags found
No related merge requests found
Pipeline #33473 passed
......@@ -271,6 +271,10 @@ export class AppShell extends ScopedElementsMixin(AdapterLitElement) {
* @param {string} lang
*/
updateLangIfChanged(lang) {
// in case the language is unknown, fall back to the default
if (!i18n.languages.includes(lang)) {
lang = this.lang;
}
if (this.lang !== lang) {
this.lang = lang;
this.router.update();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment