Skip to content

Commit 9e877df

Browse files
committed
fix[i18n]: Add localization
1 parent dae6210 commit 9e877df

4 files changed

Lines changed: 14 additions & 9 deletions

File tree

app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/LauncherActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public void onFragmentResumed(@NonNull FragmentManager fm, @NonNull Fragment f)
141141
}
142142

143143
if (isOlderThan13) {
144-
hasNoOnlineProfileDialog(this, getString(R.string.global_error), "This version is not available in demo mode.");
144+
hasNoOnlineProfileDialog(this, getString(R.string.global_error), getString(R.string.demo_versions_supported));
145145
return false;
146146
}
147147
}

app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ public static boolean hasOnlineProfile(){
14631463
}
14641464
public static void hasNoOnlineProfileDialog(Activity activity){
14651465
if (hasOnlineProfile()){
1466-
} else dialogOnUiThread(activity, "No Minecraft Account Found", "Please log into your Minecraft: Java Edition account to use this feature.");
1466+
} else dialogOnUiThread(activity, activity.getString(R.string.no_minecraft_account_found), activity.getString(R.string.feature_requires_java_account));
14671467
}
14681468
public static void hasNoOnlineProfileDialog(Activity activity, String customTitle, String customMessage){
14691469
if (hasOnlineProfile()){
@@ -1472,7 +1472,7 @@ public static void hasNoOnlineProfileDialog(Activity activity, String customTitl
14721472
public static void hasNoOnlineProfileDialog(Activity activity, Runnable run){
14731473
if (hasOnlineProfile()){
14741474
run.run();
1475-
} else dialogOnUiThread(activity, "No Minecraft Account Found", "Please log into your Minecraft: Java Edition account to use this feature.");
1475+
} else dialogOnUiThread(activity, activity.getString(R.string.no_minecraft_account_found), activity.getString(R.string.feature_requires_java_account));
14761476
}
14771477
public static void hasNoOnlineProfileDialog(Activity activity, Runnable run, String customTitle, String customMessage){
14781478
if (hasOnlineProfile()){

app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/fragments/MainMenuFragment.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
6969
mShareLogsButton.setOnClickListener((v) -> shareLog(requireContext()));
7070

7171
mOpenDirectoryButton.setOnClickListener((v)-> {
72-
if (hasOnlineProfile()) {
73-
if (Tools.isDemoProfile(v.getContext())){
74-
hasNoOnlineProfileDialog(getActivity(), "Demo Profile not supported", "Please change accounts to use this function");
75-
}
76-
openPath(v.getContext(), getCurrentProfileDirectory(), false);
77-
} else hasNoOnlineProfileDialog(requireActivity());
72+
if (Tools.isDemoProfile(v.getContext())){ // Say a different message when on demo profile since they might see the hidden demo folder
73+
hasNoOnlineProfileDialog(getActivity(), getString(R.string.demo_unsupported), getString(R.string.change_account));
74+
} else if (!hasOnlineProfile()) { // Otherwise display the generic pop-up to log in
75+
hasNoOnlineProfileDialog(requireActivity());
76+
} else openPath(v.getContext(), getCurrentProfileDirectory(), false);
77+
7878
});
7979

8080

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,4 +445,9 @@
445445
<string name="mg_renderer_summary_computeShaderext">May help with shaderpack glitches. Disable if not needed, can cause crashes.</string>
446446
<string name="mg_renderer_title_errorSetting">Error Filtering</string>
447447
<string name="app_short_name">Amethyst</string>
448+
<string name="demo_versions_supported">Only Vanilla 1.3.1 and above are supported on demo accounts</string>
449+
<string name="demo_unsupported">Demo Profile not supported</string>
450+
<string name="change_account">Please change accounts to use this function</string>
451+
<string name="no_minecraft_account_found">No Minecraft Account Found</string>
452+
<string name="feature_requires_java_account">This feature requires a Microsoft account that owns Minecraft Java Edition.</string>
448453
</resources>

0 commit comments

Comments
 (0)