Skip to content

Commit

Permalink
Added Greek transaltions to language switch & updated credits
Browse files Browse the repository at this point in the history
Signed-off-by: sunilpaulmathew <[email protected]>
  • Loading branch information
sunilpaulmathew committed Mar 31, 2024
1 parent 2d3be3c commit 56b473c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
1 change: 1 addition & 0 deletions Credits.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ APK Explorer & Editor (AEE) is, and as always, an open-source project which is r
* vuvov11 - Thai Translation
* Me - Arabic (SA) Translation
* asdfqw, Fsotm. mai, sardonicdozen, & 始 - Chinese (zh-Hans) Translation
* [VisionR1](https://github.com/VisionR1) - Greek Translation

_If you think I missed your name, please let me know._
33 changes: 9 additions & 24 deletions app/src/main/java/com/apk/editor/utils/AppSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public static List<sSerializableItems> getCredits(Context context) {
mData.add(new sSerializableItems(null, "Fsotm. mai", "Chinese (zh-Hans) Translation", null));
mData.add(new sSerializableItems(null, "sardonicdozen", "Chinese (zh-Hans) Translation", null));
mData.add(new sSerializableItems(null, "始", "Chinese (zh-Hans) Translation", null));
mData.add(new sSerializableItems(null, "VisionR1", "Greek Translation", "https://github.com/VisionR1"));
return mData;
}

Expand Down Expand Up @@ -171,6 +172,8 @@ public static String getLanguage(Context context) {
return context.getString(R.string.language_lt);
case "th":
return context.getString(R.string.language_th);
case "el":
return context.getString(R.string.language_el);
default:
return context.getString(R.string.app_theme_auto);
}
Expand Down Expand Up @@ -324,77 +327,65 @@ public void onItemSelected(int itemPosition) {
switch (itemPosition) {
case 0:
sCommonUtils.saveString("appLanguage", java.util.Locale.getDefault().getLanguage(), context);
restartApp(context);
break;
case 1:
sCommonUtils.saveString("appLanguage", "ar", context);
restartApp(context);
break;
case 2:
sCommonUtils.saveString("appLanguage", "zh", context);
restartApp(context);
break;
case 3:
sCommonUtils.saveString("appLanguage", "cs", context);
restartApp(context);
break;
case 4:
sCommonUtils.saveString("appLanguage", "de", context);
restartApp(context);
break;
case 5:
sCommonUtils.saveString("appLanguage", "en_US", context);
restartApp(context);
break;
case 6:
sCommonUtils.saveString("appLanguage", "fr", context);
restartApp(context);
break;
case 7:
sCommonUtils.saveString("appLanguage", "es", context);
restartApp(context);
break;
case 8:
sCommonUtils.saveString("appLanguage", "ru", context);
restartApp(context);
break;
case 9:
sCommonUtils.saveString("appLanguage", "tr", context);
restartApp(context);
break;
case 10:
sCommonUtils.saveString("appLanguage", "vi", context);
restartApp(context);
break;
case 11:
sCommonUtils.saveString("appLanguage", "pl", context);
restartApp(context);
break;
case 12:
sCommonUtils.saveString("appLanguage", "in", context);
restartApp(context);
break;
case 13:
sCommonUtils.saveString("appLanguage", "hu", context);
restartApp(context);
break;
case 14:
sCommonUtils.saveString("appLanguage", "uk", context);
restartApp(context);
break;
case 15:
sCommonUtils.saveString("appLanguage", "hi", context);
restartApp(context);
break;
case 16:
sCommonUtils.saveString("appLanguage", "lt", context);
restartApp(context);
break;
case 17:
sCommonUtils.saveString("appLanguage", "th", context);
restartApp(context);
break;
case 18:
sCommonUtils.saveString("appLanguage", "el", context);
break;
}
Intent intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(intent);
}
}.show();
}
Expand All @@ -404,10 +395,4 @@ public static boolean isCustomKey(Context context) {
sCommonUtils.getString("X509Certificate", null, context) != null;
}

private static void restartApp(Context context) {
Intent intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(intent);
}

}

0 comments on commit 56b473c

Please sign in to comment.