Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

Commit 465e8b0

Browse files
Add Indonesian to language switch
Signed-off-by: sunilpaulmathew <[email protected]>
1 parent 2d3c14a commit 465e8b0

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

app/src/main/java/com/smartpack/kernelprofiler/MainActivity.java

+9
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ private void settingsMenu(Activity activity) {
195195
.setChecked(Utils.getBoolean("use_el", false, activity));
196196
language.add(Menu.NONE, 21, Menu.NONE, getString(R.string.language_ko)).setCheckable(true)
197197
.setChecked(Utils.getBoolean("use_ko", false, activity));
198+
language.add(Menu.NONE, 22, Menu.NONE, getString(R.string.language_in)).setCheckable(true)
199+
.setChecked(Utils.getBoolean("use_in", false, activity));
198200
SubMenu app = menu.addSubMenu(Menu.NONE, 0, Menu.NONE, getString(R.string.app_about));
199201
app.add(Menu.NONE, 7, Menu.NONE, getString(R.string.share));
200202
app.add(Menu.NONE, 8, Menu.NONE, getString(R.string.support));
@@ -327,6 +329,13 @@ private void settingsMenu(Activity activity) {
327329
Utils.restartApp(activity);
328330
}
329331
break;
332+
case 22:
333+
if (!Utils.getBoolean("use_in", false, activity)) {
334+
Utils.setDefaultLanguage(activity);
335+
Utils.saveBoolean("use_in", true, activity);
336+
Utils.restartApp(activity);
337+
}
338+
break;
330339
}
331340
return false;
332341
});

app/src/main/java/com/smartpack/kernelprofiler/utils/Utils.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,15 @@ public static void setDefaultLanguage(Context context) {
322322
saveBoolean("use_el", false, context);
323323
saveBoolean("use_pt", false, context);
324324
saveBoolean("use_ko", false, context);
325+
saveBoolean("use_in", false, context);
325326
}
326327

327328
public static boolean languageDefault(Context context) {
328329
return !getBoolean("use_en", false, context)
329330
&& !getBoolean("use_el", false, context)
330331
&& !getBoolean("use_pt", false, context)
331-
&& !getBoolean("use_ko", false, context);
332+
&& !getBoolean("use_ko", false, context)
333+
&& !getBoolean("use_in", false, context);
332334
}
333335

334336
public static String getLanguage(Context context) {
@@ -340,6 +342,8 @@ public static String getLanguage(Context context) {
340342
return "pt";
341343
} else if (getBoolean("use_ko", false, context)) {
342344
return "ko";
345+
} else if (getBoolean("use_in", false, context)) {
346+
return "in";
343347
} else {
344348
return java.util.Locale.getDefault().getLanguage();
345349
}

app/src/main/res/values/strings.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<string name="language_en">English</string>
4545
<string name="language_default">Default</string>
4646
<string name="language_ko">Korean</string>
47+
<string name="language_in">Indonesian</string>
4748
<string name="language_pt">Portuguese</string>
4849
<string name="more_apps">More from Developer</string>
4950
<string name="name_empty">Profile name shouldn\'t be empty! Aborting.</string>
@@ -56,7 +57,7 @@
5657
<string name="on_boot_message">%s is set as the default profile!</string>
5758
<string name="on_boot_summary">Applying On-Boot Settings (%s)!</string>
5859
<string name="press_back">Press back again to exit</string>
59-
<string name="profile_applied_success">%s applied successfully!</string>
60+
<string name="profile_applied_success">\'%s\' applied successfully!</string>
6061
<string name="profile_description">Profile Description</string>
6162
<string name="profile_description_empty">Adding a short description for this profile is highly recommended!</string>
6263
<string name="profile_description_summary">Add description here!</string>

0 commit comments

Comments
 (0)