From 4f7fae89b1ba7f6cf95a71243f468924c0f3375b Mon Sep 17 00:00:00 2001 From: "Yussin R. Hidayat" Date: Tue, 13 Jul 2021 14:34:50 +0700 Subject: [PATCH] Override configuration to fix partial translation --- .../src/main/java/org/smartregister/util/LangUtils.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/opensrp-app/src/main/java/org/smartregister/util/LangUtils.java b/opensrp-app/src/main/java/org/smartregister/util/LangUtils.java index 4532f402c..3ce8e88b8 100644 --- a/opensrp-app/src/main/java/org/smartregister/util/LangUtils.java +++ b/opensrp-app/src/main/java/org/smartregister/util/LangUtils.java @@ -36,13 +36,14 @@ public static Configuration setAppLocale(Context context, String language) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - configuration.setLocale(locale); + Configuration overrideConfiguration = new Configuration(configuration); + overrideConfiguration.setLocale(locale); LocaleList localeList = new LocaleList(locale); LocaleList.setDefault(localeList); - configuration.setLocales(localeList); + overrideConfiguration.setLocales(localeList); - context.createConfigurationContext(configuration); + context.createConfigurationContext(overrideConfiguration); } else { configuration.locale = locale;