fix[i18n]: Add localization

This commit is contained in:
alexytomi 2025-06-21 00:00:41 +08:00
parent dae621043c
commit 9e877dfb12
4 changed files with 14 additions and 9 deletions

View File

@ -141,7 +141,7 @@ public class LauncherActivity extends BaseActivity {
}
if (isOlderThan13) {
hasNoOnlineProfileDialog(this, getString(R.string.global_error), "This version is not available in demo mode.");
hasNoOnlineProfileDialog(this, getString(R.string.global_error), getString(R.string.demo_versions_supported));
return false;
}
}

View File

@ -1463,7 +1463,7 @@ public final class Tools {
}
public static void hasNoOnlineProfileDialog(Activity activity){
if (hasOnlineProfile()){
} else dialogOnUiThread(activity, "No Minecraft Account Found", "Please log into your Minecraft: Java Edition account to use this feature.");
} else dialogOnUiThread(activity, activity.getString(R.string.no_minecraft_account_found), activity.getString(R.string.feature_requires_java_account));
}
public static void hasNoOnlineProfileDialog(Activity activity, String customTitle, String customMessage){
if (hasOnlineProfile()){
@ -1472,7 +1472,7 @@ public final class Tools {
public static void hasNoOnlineProfileDialog(Activity activity, Runnable run){
if (hasOnlineProfile()){
run.run();
} else dialogOnUiThread(activity, "No Minecraft Account Found", "Please log into your Minecraft: Java Edition account to use this feature.");
} else dialogOnUiThread(activity, activity.getString(R.string.no_minecraft_account_found), activity.getString(R.string.feature_requires_java_account));
}
public static void hasNoOnlineProfileDialog(Activity activity, Runnable run, String customTitle, String customMessage){
if (hasOnlineProfile()){

View File

@ -69,12 +69,12 @@ public class MainMenuFragment extends Fragment {
mShareLogsButton.setOnClickListener((v) -> shareLog(requireContext()));
mOpenDirectoryButton.setOnClickListener((v)-> {
if (hasOnlineProfile()) {
if (Tools.isDemoProfile(v.getContext())){
hasNoOnlineProfileDialog(getActivity(), "Demo Profile not supported", "Please change accounts to use this function");
}
openPath(v.getContext(), getCurrentProfileDirectory(), false);
} else hasNoOnlineProfileDialog(requireActivity());
if (Tools.isDemoProfile(v.getContext())){ // Say a different message when on demo profile since they might see the hidden demo folder
hasNoOnlineProfileDialog(getActivity(), getString(R.string.demo_unsupported), getString(R.string.change_account));
} else if (!hasOnlineProfile()) { // Otherwise display the generic pop-up to log in
hasNoOnlineProfileDialog(requireActivity());
} else openPath(v.getContext(), getCurrentProfileDirectory(), false);
});

View File

@ -445,4 +445,9 @@
<string name="mg_renderer_summary_computeShaderext">May help with shaderpack glitches. Disable if not needed, can cause crashes.</string>
<string name="mg_renderer_title_errorSetting">Error Filtering</string>
<string name="app_short_name">Amethyst</string>
<string name="demo_versions_supported">Only Vanilla 1.3.1 and above are supported on demo accounts</string>
<string name="demo_unsupported">Demo Profile not supported</string>
<string name="change_account">Please change accounts to use this function</string>
<string name="no_minecraft_account_found">No Minecraft Account Found</string>
<string name="feature_requires_java_account">This feature requires a Microsoft account that owns Minecraft Java Edition.</string>
</resources>