From 9ad5531076dbf98e07e2e5fe75434cfb8a56ad63 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 1 Jul 2020 14:07:50 +0200 Subject: [PATCH] MOBILE-3462 lang: Fix error when direction had wrong value --- src/providers/lang.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/providers/lang.ts b/src/providers/lang.ts index b598be1b7..7454acd7d 100644 --- a/src/providers/lang.ts +++ b/src/providers/lang.ts @@ -55,7 +55,9 @@ export class CoreLangProvider { translate.onLangChange.subscribe((event: any) => { platform.setLang(event.lang, true); - platform.setDir(this.translate.instant('core.thisdirection'), true); + + const dir = this.translate.instant('core.thisdirection'); + platform.setDir(dir.indexOf('rtl') != -1 ? 'rtl' : 'ltr', true); }); }