From 2cc6a069aeac222ec33c712c39609d3f10a62cbb Mon Sep 17 00:00:00 2001 From: sunilpaulmathew Date: Mon, 12 Dec 2022 21:17:36 +0100 Subject: [PATCH] AppSettings: Added Arabic to language switch Signed-off-by: sunilpaulmathew --- .../smartpack/packagemanager/utils/AppSettings.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/smartpack/packagemanager/utils/AppSettings.java b/app/src/main/java/com/smartpack/packagemanager/utils/AppSettings.java index d160058..6a4cc27 100644 --- a/app/src/main/java/com/smartpack/packagemanager/utils/AppSettings.java +++ b/app/src/main/java/com/smartpack/packagemanager/utils/AppSettings.java @@ -131,6 +131,8 @@ public static String getLanguage(Activity activity) { return activity.getString(R.string.language_pl); case "it": return activity.getString(R.string.language_it); + case "ar": + return activity.getString(R.string.language_ar); default: return activity.getString(R.string.language_default) + " (" + java.util.Locale.getDefault().getLanguage() + ")"; } @@ -197,7 +199,8 @@ private static String[] getLanguageMenu(Context context) { context.getString(R.string.language_zh), context.getString(R.string.language_hu), context.getString(R.string.language_pl), - context.getString(R.string.language_it) + context.getString(R.string.language_it), + context.getString(R.string.language_ar) }; } @@ -322,6 +325,12 @@ public void onItemSelected(int position) { Utils.restartApp(activity); } break; + case 19: + if (!sUtils.getLanguage(activity).equals("ar")) { + sUtils.saveString("appLanguage", "ar", activity); + Utils.restartApp(activity); + } + break; } } }.show();