Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android adds multi-language support #153

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/android/java/com/hydra/noods/BindingsPreference.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected void onClick()
// Create the dialog for rebinding an input
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(getTitle());
builder.setMessage("Press a key to bind it to this input.");
builder.setMessage(R.string.key_to_bind);
builder.setNegativeButton("Cancel", null);

builder.setPositiveButton("Clear", new DialogInterface.OnClickListener()
Expand Down
22 changes: 11 additions & 11 deletions src/android/java/com/hydra/noods/FileBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private void showInfo(final boolean start)

// Create the Play Store information dialog
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Welcome to NooDS");
builder.setTitle(R.string.welcome_to_noods);
builder.setView(view);
builder.setCancelable(!start);
builder.setPositiveButton("OK", new DialogInterface.OnClickListener()
Expand Down Expand Up @@ -381,20 +381,20 @@ private void tryStartCore()
switch (result)
{
case 1: // Missing BIOS files
builder.setTitle("Error Loading BIOS");
builder.setMessage("Make sure the path settings point to valid BIOS files and try again. " +
"You can modify path settings in " + getExternalFilesDir(null).getPath() + "/noods.ini.");
builder.setTitle(R.string.error_bios_1);
builder.setMessage(getString(R.string.error_bios_2) +
getString(R.string.error_bios_3) + getExternalFilesDir(null).getPath() + "/noods.ini.");
break;

case 2: // Non-bootable firmware file
builder.setTitle("Error Loading Firmware");
builder.setMessage("Make sure the path settings point to a bootable firmware file or try another boot method. " +
"You can modify path settings in " + getExternalFilesDir(null).getPath() + "/noods.ini.");
builder.setTitle(R.string.error_firmware_1);
builder.setMessage(getString(R.string.error_firmware_2) +
getString(R.string.error_firmware_3) + getExternalFilesDir(null).getPath() + "/noods.ini.");
break;

case 3: // Unreadable ROM file
builder.setTitle("Error Loading ROM");
builder.setMessage("Make sure the ROM file is accessible and try again.");
builder.setTitle(R.string.error_rom_1);
builder.setMessage(R.string.error_rom_2);
break;
}

Expand Down Expand Up @@ -471,8 +471,8 @@ public void onCancel(DialogInterface dialog)
if (isNdsLoaded())
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Loading GBA ROM");
builder.setMessage("Load the previous NDS ROM alongside this ROM?");
builder.setTitle(R.string.loading_gba_rom);
builder.setMessage(R.string.load_the_previous_nds_rom);

builder.setPositiveButton("Yes", new DialogInterface.OnClickListener()
{
Expand Down
24 changes: 12 additions & 12 deletions src/android/java/com/hydra/noods/NooActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ public void onClick(DialogInterface dialog, int id)

// Use the message with extra information if a state file doesn't exist yet
if (checkState() == 1) // File fail
builder.setMessage("Saving and loading states is dangerous and can lead to data " +
"loss. States are also not guaranteed to be compatible across emulator " +
"versions. Please rely on in-game saving to keep your progress, and back up " +
".sav files before using this feature. Do you want to save the current state?");
builder.setMessage(getString(R.string.save_warning_1) +
getString(R.string.save_warning_2) +
getString(R.string.save_warning_3) +
getString(R.string.save_warning_4));
else
builder.setMessage("Do you want to overwrite the saved " +
"state with the current state? This can't be undone!");
builder.setMessage(getString(R.string.overwrite_save_1) +
getString(R.string.overwrite_save_2));
builder.create().show();
return true;

Expand All @@ -206,8 +206,8 @@ public void onClick(DialogInterface dialog, int id)
switch (checkState())
{
case 0: // Success
builder2.setMessage("Do you want to load the saved state " +
"and lose the current state? This can't be undone!");
builder2.setMessage(getString(R.string.load_warning_1) +
getString(R.string.load_warning_2));
builder2.setNegativeButton("Cancel", null);
builder2.setPositiveButton("OK", new DialogInterface.OnClickListener()
{
Expand All @@ -223,17 +223,17 @@ public void onClick(DialogInterface dialog, int id)
break;

case 1: // File fail
builder2.setMessage("The state file doesn't exist or couldn't be opened.");
builder2.setMessage(R.string.File_fail);
builder2.setNegativeButton("OK", null);
break;

case 2: // Format fail
builder2.setMessage("The state file doesn't have a valid format.");
builder2.setMessage(R.string.Format_fail);
builder2.setNegativeButton("OK", null);
break;

case 3: // Version fail
builder2.setMessage("The state file isn't compatible with this version of NooDS.");
builder2.setMessage(R.string.Version_fail);
builder2.setPositiveButton("OK", null);
break;
}
Expand All @@ -256,7 +256,7 @@ public void onClick(DialogInterface dialog, final int which)
// Confirm the change because accidentally resizing a working save file could be bad!
AlertDialog.Builder builder4 = new AlertDialog.Builder(NooActivity.this);
builder4.setTitle("Changing Save Type");
builder4.setMessage("Are you sure? This may result in data loss!");
builder4.setMessage(R.string.change_save_type_warning);
builder4.setNegativeButton("Cancel", null);
builder4.setPositiveButton("OK", new DialogInterface.OnClickListener()
{
Expand Down
6 changes: 3 additions & 3 deletions src/android/res/menu/file_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

<item android:id="@+id/info_action"
android:icon="@drawable/info"
android:title="Information"
android:title="@string/information"
android:visible="false"
app:showAsAction="always" />

<item android:id="@+id/storage_action"
android:icon="@drawable/storage"
android:title="Change Storage"
android:title="@string/change_storage"
android:visible="false"
app:showAsAction="always" />

<item android:id="@+id/settings_action"
android:icon="@drawable/settings"
android:title="Settings"
android:title="@string/settings"
app:showAsAction="always" />

</menu>
16 changes: 8 additions & 8 deletions src/android/res/menu/noo_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
xmlns:app="http://schemas.android.com/apk/res-auto">

<item android:id="@+id/controls_action"
android:title="Toggle Controls" />
android:title="@string/toggle_controls" />

<item android:id="@+id/restart_action"
android:title="Restart" />
android:title="@string/restart" />

<item android:id="@+id/save_state_action"
android:title="Save State" />
android:title="@string/save_state" />

<item android:id="@+id/load_state_action"
android:title="Load State" />
android:title="@string/load_state" />

<item android:id="@+id/save_type_action"
android:title="Change Save Type" />
android:title="@string/change_save_type" />

<item android:id="@+id/bindings_action"
android:title="Input Bindings" />
android:title="@string/input_bindings" />

<item android:id="@+id/settings_action"
android:title="Settings" />
android:title="@string/settings" />

<item android:id="@+id/browser_action"
android:title="File Browser" />
android:title="@string/file_browser" />

</menu>
2 changes: 1 addition & 1 deletion src/android/res/menu/settings_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<item android:id="@+id/bindings_action"
android:icon="@drawable/bindings"
android:title="Input Bindings"
android:title="@string/input_bindings"
app:showAsAction="always" />

</menu>
93 changes: 93 additions & 0 deletions src/android/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>


<resources>
<!--file_menu-->
<string name="information">Information</string>
<string name="change_storage">Change Storage</string>
<string name="settings">Settings</string>

<!--noo_menu-->
<string name="toggle_controls">Toggle Controls</string>
<string name="restart">Restart</string>
<string name="save_state">Save State</string>
<string name="load_state">Load State</string>
<string name="change_save_type">Change Save Type</string>
<string name="input_bindings">Input Bindings</string>
<string name="file_browser">File Browser</string>

<!--bindings-->
<string name="buttons">Buttons</string>
<string name="a_button">A Button</string>
<string name="b_button">B Button</string>
<string name="x_button">X Button</string>
<string name="y_button">Y Button</string>
<string name="start_button">Start Button</string>
<string name="select_button">Select Button</string>
<string name="up_button">Up Button</string>
<string name="down_button">Down Button</string>
<string name="left_button">Left Button</string>
<string name="right_button">Right Button</string>
<string name="l_button">L Button</string>
<string name="r_button">R Button</string>
<string name="hotkeys">Hotkeys</string>
<string name="fast_forward_hold">Fast Forward Hold</string>
<string name="fast_forward_toggle">Fast Forward Toggle</string>
<string name="screen_swap_toggle">Screen Swap Toggle</string>

<!--settings-->
<string name="general_settings">General Settings</string>
<string name="direct_boot">Direct Boot</string>
<string name="fps_limiter">FPS Limiter</string>
<string name="threaded_2d">Threaded 2D</string>
<string name="threaded_3d">Threaded 3D</string>
<string name="high_resolution_3d">High-Resolution 3D</string>
<string name="use_microphone">Use Microphone</string>
<string name="show_fps_counter">Show FPS Counter</string>
<string name="screen_layout">Screen Layout</string>
<string name="screen_position">Screen Position</string>
<string name="screen_rotation">Screen Rotation</string>
<string name="screen_arrangement">Screen Arrangement</string>
<string name="screen_sizing">Screen Sizing</string>
<string name="screen_gap">Screen Gap</string>
<string name="screen_filter">Screen Filter</string>
<string name="integer_scale">Integer Scale</string>
<string name="gba_crop">GBA Crop</string>
<string name="simulate_ghosting">Simulate Ghosting</string>
<string name="on_screen_controls">On-Screen Controls</string>
<string name="button_scale">Button Scale</string>
<string name="button_spacing">Button Spacing</string>
<string name="vibration_strength">Vibration Strength</string>

<!--NooActivity-->
<string name="save_warning_1">"Saving and loading states is dangerous and can lead to data "</string>
<string name="save_warning_2">"loss. States are also not guaranteed to be compatible across emulator "</string>
<string name="save_warning_3">"versions. Please rely on in-game saving to keep your progress, and back up "</string>
<string name="save_warning_4">.sav files before using this feature. Do you want to save the current state?</string>
<string name="overwrite_save_1">"Do you want to overwrite the saved "</string>
<string name="overwrite_save_2">state with the current state? This can\'t be undone!</string>
<string name="load_warning_1">"Do you want to load the saved state "</string>
<string name="load_warning_2">and lose the current state? This can\'t be undone!</string>
<string name="File_fail">The state file doesn\'t exist or couldn\'t be opened.</string>
<string name="Format_fail">The state file doesn\'t have a valid format.</string>
<string name="Version_fail">The state file isn\'t compatible with this version of NooDS.</string>
<string name="change_save_type_warning">Are you sure? This may result in data loss!</string>

<!--BindingsPreference-->
<string name="key_to_bind">Press a key to bind it to this input.</string>

<!--FileBrowser-->
<string name="welcome_to_noods">Welcome to NooDS</string>
<string name="error_bios_1">Error Loading BIOS</string>
<string name="error_bios_2">"Make sure the path settings point to valid BIOS files and try again. "</string>
<string name="error_bios_3">"You can modify path settings in "</string>
<string name="error_firmware_1">Error Loading Firmware</string>
<string name="error_firmware_2">"Make sure the path settings point to a bootable firmware file or try another boot method. "</string>
<string name="error_firmware_3">"You can modify path settings in "</string>
<string name="error_rom_1">Error Loading ROM</string>
<string name="error_rom_2">Make sure the ROM file is accessible and try again.</string>
<string name="loading_gba_rom">Loading GBA ROM</string>
<string name="load_the_previous_nds_rom">Load the previous NDS ROM alongside this ROM?</string>


</resources>
Loading