From d317c5bf03bce75acbf00b2a89e3815688d38f42 Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Tue, 11 Nov 2014 16:30:20 +0100 Subject: [PATCH 1/3] Try to make limelight more translatable --- app/src/main/java/com/limelight/AppView.java | 62 ++--- app/src/main/java/com/limelight/Game.java | 31 ++- app/src/main/java/com/limelight/PcView.java | 255 +++++++++--------- .../preferences/AddComputerManually.java | 10 +- app/src/main/res/values/arrays.xml | 10 +- app/src/main/res/values/strings.xml | 89 ++++++ 6 files changed, 270 insertions(+), 187 deletions(-) diff --git a/app/src/main/java/com/limelight/AppView.java b/app/src/main/java/com/limelight/AppView.java index cd1ea178..aeff34de 100644 --- a/app/src/main/java/com/limelight/AppView.java +++ b/app/src/main/java/com/limelight/AppView.java @@ -63,7 +63,7 @@ public class AppView extends Activity { return; } - String labelText = "App List for "+getIntent().getStringExtra(NAME_EXTRA); + String labelText = getResources().getString(R.string.title_applist)+" "+getIntent().getStringExtra(NAME_EXTRA); TextView label = (TextView) findViewById(R.id.appListText); setTitle(labelText); label.setText(labelText); @@ -133,27 +133,27 @@ public class AppView extends Activity { } @Override - public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { + public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); - - AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo; - AppObject selectedApp = appListAdapter.getItem(info.position); - if (selectedApp == null || selectedApp.app == null) { - return; - } - - int runningAppId = getRunningAppId(); - if (runningAppId != -1) { - if (runningAppId == selectedApp.app.getAppId()) { - menu.add(Menu.NONE, RESUME_ID, 1, "Resume Session"); - menu.add(Menu.NONE, QUIT_ID, 2, "Quit Session"); - } - else { - menu.add(Menu.NONE, RESUME_ID, 1, "Quit Current Game and Start"); - menu.add(Menu.NONE, CANCEL_ID, 2, "Cancel"); - } - } - } + + AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo; + AppObject selectedApp = appListAdapter.getItem(info.position); + if (selectedApp == null || selectedApp.app == null) { + return; + } + + int runningAppId = getRunningAppId(); + if (runningAppId != -1) { + if (runningAppId == selectedApp.app.getAppId()) { + menu.add(Menu.NONE, RESUME_ID, 1, getResources().getString(R.string.applist_menu_resume)); + menu.add(Menu.NONE, QUIT_ID, 2, getResources().getString(R.string.applist_menu_quit)); + } + else { + menu.add(Menu.NONE, RESUME_ID, 1, getResources().getString(R.string.applist_menu_quit_and_start)); + menu.add(Menu.NONE, CANCEL_ID, 2, getResources().getString(R.string.applist_menu_cancel)); + } + } + } @Override public void onContextMenuClosed(Menu menu) { @@ -186,17 +186,18 @@ public class AppView extends Activity { StringBuilder str = new StringBuilder(); str.append(app.getAppName()); if (app.getIsRunning()) { - str.append(" - Running"); + str.append(" - "+getResources().getString(R.string.applist_app_running)); } return str.toString(); } private void addListPlaceholder() { - appListAdapter.add(new AppObject("No apps found. Try rescanning for games in GeForce Experience.", null)); + appListAdapter.add(new AppObject(getResources().getString(R.string.applist_no_apps), null)); } private void updateAppList() { - final SpinnerDialog spinner = SpinnerDialog.displayDialog(this, "App List", "Refreshing app list...", true); + final SpinnerDialog spinner = SpinnerDialog.displayDialog(this, getResources().getString(R.string.applist_refresh_title), + getResources().getString(R.string.applist_refresh_msg), true); new Thread() { @Override public void run() { @@ -246,7 +247,7 @@ public class AppView extends Activity { } private void doQuit(final NvApp app) { - Toast.makeText(AppView.this, "Quitting "+app.getAppName()+"...", Toast.LENGTH_SHORT).show(); + Toast.makeText(AppView.this, getResources().getString(R.string.applist_quit_app)+" "+app.getAppName()+"...", Toast.LENGTH_SHORT).show(); new Thread(new Runnable() { @Override public void run() { @@ -255,17 +256,16 @@ public class AppView extends Activity { try { httpConn = new NvHTTP(ipAddress, uniqueId, null, PlatformBinding.getCryptoProvider(AppView.this)); if (httpConn.quitApp()) { - message = "Successfully quit "+app.getAppName(); + message = getResources().getString(R.string.applist_quit_success)+" "+app.getAppName(); } else { - message = "Failed to quit "+app.getAppName(); + message = getResources().getString(R.string.applist_quit_fail)+" "+app.getAppName(); } updateAppList(); } catch (UnknownHostException e) { - message = "Failed to resolve host"; + message = getResources().getString(R.string.error_unknown_host); } catch (FileNotFoundException e) { - message = "GFE returned an HTTP 404 error. Make sure your PC is running a supported GPU. Using remote desktop software can also cause this error. " - + "Try rebooting your machine or reinstalling GFE."; + message = getResources().getString(R.string.error_404); } catch (Exception e) { message = e.getMessage(); } @@ -295,4 +295,4 @@ public class AppView extends Activity { return text; } } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/limelight/Game.java b/app/src/main/java/com/limelight/Game.java index 5cbad9f4..3bb036c2 100644 --- a/app/src/main/java/com/limelight/Game.java +++ b/app/src/main/java/com/limelight/Game.java @@ -113,12 +113,13 @@ public class Game extends Activity implements SurfaceHolder.Callback, // Inflate the content setContentView(R.layout.activity_game); - + // Start the spinner - spinner = SpinnerDialog.displayDialog(this, "Establishing Connection", "Starting connection", true); + spinner = SpinnerDialog.displayDialog(this, getResources().getString(R.string.conn_establishing_title), + getResources().getString(R.string.conn_establishing_msg), true); // Read the stream preferences - prefConfig = PreferenceConfiguration.readPreferences(this); + prefConfig = PreferenceConfiguration.readPreferences(this); switch (prefConfig.decoder) { case PreferenceConfiguration.FORCE_SOFTWARE_DECODER: drFlags |= VideoDecoderRenderer.FLAG_FORCE_SOFTWARE_DECODING; @@ -143,11 +144,11 @@ public class Game extends Activity implements SurfaceHolder.Callback, sv.setOnTouchListener(this); // Warn the user if they're on a metered connection - checkDataConnection(); - - // Make sure Wi-Fi is fully powered up + checkDataConnection(); + + // Make sure Wi-Fi is fully powered up WifiManager wifiMgr = (WifiManager) getSystemService(Context.WIFI_SERVICE); - wifiLock = wifiMgr.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "Limelight"); + wifiLock = wifiMgr.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "Limelight"); wifiLock.setReferenceCounted(false); wifiLock.acquire(); @@ -214,7 +215,7 @@ public class Game extends Activity implements SurfaceHolder.Callback, { ConnectivityManager mgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); if (mgr.isActiveNetworkMetered()) { - displayTransientMessage("Warning: Your active network connection is metered!"); + displayTransientMessage(getResources().getString(R.string.conn_metered)); } } @@ -262,13 +263,13 @@ public class Game extends Activity implements SurfaceHolder.Callback, int averageDecoderLat = decoderRenderer.getAverageDecoderLatency(); String message = null; if (averageEndToEndLat > 0) { - message = "Average client-side frame latency: "+averageEndToEndLat+" ms"; + message = getResources().getString(R.string.conn_client_latency)+" "+averageEndToEndLat+" ms"; if (averageDecoderLat > 0) { - message += " (hardware decoder latency: "+averageDecoderLat+" ms)"; + message += " ("+getResources().getString(R.string.conn_client_latency_hw)+" "+averageDecoderLat+" ms)"; } } else if (averageDecoderLat > 0) { - message = "Average hardware decoder latency: "+averageDecoderLat+" ms"; + message = getResources().getString(R.string.conn_hardware_latency)+" "+averageDecoderLat+" ms"; } if (message != null) { @@ -634,7 +635,7 @@ public class Game extends Activity implements SurfaceHolder.Callback, @Override public void stageStarting(Stage stage) { if (spinner != null) { - spinner.setMessage("Starting "+stage.getName()); + spinner.setMessage(getResources().getString(R.string.conn_starting)+" "+stage.getName()); } } @@ -665,7 +666,8 @@ public class Game extends Activity implements SurfaceHolder.Callback, if (!displayedFailureDialog) { displayedFailureDialog = true; stopConnection(); - Dialog.displayDialog(this, "Connection Error", "Starting "+stage.getName()+" failed", true); + Dialog.displayDialog(this, getResources().getString(R.string.conn_error_title), + getResources().getString(R.string.conn_error_msg)+" "+stage.getName(), true); } } @@ -676,7 +678,8 @@ public class Game extends Activity implements SurfaceHolder.Callback, e.printStackTrace(); stopConnection(); - Dialog.displayDialog(this, "Connection Terminated", "The connection failed unexpectedly", true); + Dialog.displayDialog(this, getResources().getString(R.string.conn_fail_title), + getResources().getString(R.string.conn_fail_msg), true); } } diff --git a/app/src/main/java/com/limelight/PcView.java b/app/src/main/java/com/limelight/PcView.java index 0683dce6..b453596c 100644 --- a/app/src/main/java/com/limelight/PcView.java +++ b/app/src/main/java/com/limelight/PcView.java @@ -237,35 +237,35 @@ public class PcView extends Activity { } @Override - public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { + public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { stopComputerUpdates(false); // Call superclass super.onCreateContextMenu(menu, v, menuInfo); - - AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo; - ComputerObject computer = pcListAdapter.getItem(info.position); - if (computer == null || computer.details == null) { - startComputerUpdates(); - return; - } - - // Inflate the context menu - if (computer.details.reachability == ComputerDetails.Reachability.OFFLINE) { - menu.add(Menu.NONE, WOL_ID, 1, "Send Wake-On-LAN request"); - menu.add(Menu.NONE, DELETE_ID, 2, "Delete PC"); - } - else if (computer.details.pairState != PairState.PAIRED) { - menu.add(Menu.NONE, PAIR_ID, 1, "Pair with PC"); - if (computer.details.reachability == ComputerDetails.Reachability.REMOTE) { - menu.add(Menu.NONE, DELETE_ID, 2, "Delete PC"); - } - } - else { - menu.add(Menu.NONE, APP_LIST_ID, 1, "View Game List"); - menu.add(Menu.NONE, UNPAIR_ID, 2, "Unpair"); - } - } + + AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo; + ComputerObject computer = pcListAdapter.getItem(info.position); + if (computer == null || computer.details == null) { + startComputerUpdates(); + return; + } + + // Inflate the context menu + if (computer.details.reachability == ComputerDetails.Reachability.OFFLINE) { + menu.add(Menu.NONE, WOL_ID, 1, getResources().getString(R.string.pcview_menu_send_wol)); + menu.add(Menu.NONE, DELETE_ID, 2, getResources().getString(R.string.pcview_menu_delete_pc)); + } + else if (computer.details.pairState != PairState.PAIRED) { + menu.add(Menu.NONE, PAIR_ID, 1, getResources().getString(R.string.pcview_menu_pair_pc)); + if (computer.details.reachability == ComputerDetails.Reachability.REMOTE) { + menu.add(Menu.NONE, DELETE_ID, 2, getResources().getString(R.string.pcview_menu_delete_pc)); + } + } + else { + menu.add(Menu.NONE, APP_LIST_ID, 1, getResources().getString(R.string.pcview_menu_app_list)); + menu.add(Menu.NONE, UNPAIR_ID, 2, getResources().getString(R.string.pcview_menu_unpair_pc)); + } + } @Override public void onContextMenuClosed(Menu menu) { @@ -274,21 +274,19 @@ public class PcView extends Activity { private void doPair(final ComputerDetails computer) { if (computer.reachability == ComputerDetails.Reachability.OFFLINE) { - Toast.makeText(PcView.this, "Computer is offline", Toast.LENGTH_SHORT).show(); + Toast.makeText(PcView.this, getResources().getString(R.string.pair_pc_offline), Toast.LENGTH_SHORT).show(); return; } if (computer.runningGameId != 0) { - Toast.makeText(PcView.this, "Computer is currently in a game. " + - "You must close the game before pairing.", Toast.LENGTH_LONG).show(); + Toast.makeText(PcView.this, getResources().getString(R.string.pair_pc_ingame), Toast.LENGTH_LONG).show(); return; } if (managerBinder == null) { - Toast.makeText(PcView.this, "The ComputerManager service is not running. " + - "Please wait a few seconds or restart the app.", Toast.LENGTH_LONG).show(); + Toast.makeText(PcView.this, getResources().getString(R.string.error_manager_not_running), Toast.LENGTH_LONG).show(); return; } - Toast.makeText(PcView.this, "Pairing...", Toast.LENGTH_SHORT).show(); + Toast.makeText(PcView.this, getResources().getString(R.string.pairing), Toast.LENGTH_SHORT).show(); new Thread(new Runnable() { @Override public void run() { @@ -311,23 +309,24 @@ public class PcView extends Activity { PlatformBinding.getDeviceName(), PlatformBinding.getCryptoProvider(PcView.this)); if (httpConn.getPairState() == PairingManager.PairState.PAIRED) { - message = "Already paired"; + message = getResources().getString(R.string.pair_already_paired); } else { final String pinStr = PairingManager.generatePinString(); // Spin the dialog off in a thread because it blocks - Dialog.displayDialog(PcView.this, "Pairing", "Please enter the following PIN on the target PC: "+pinStr, false); + Dialog.displayDialog(PcView.this, getResources().getString(R.string.pair_pairing_title), + getResources().getString(R.string.pair_pairing_msg)+" "+pinStr, false); PairingManager.PairState pairState = httpConn.pair(pinStr); if (pairState == PairingManager.PairState.PIN_WRONG) { - message = "Incorrect PIN"; + message = getResources().getString(R.string.pair_incorrect_pin); } else if (pairState == PairingManager.PairState.FAILED) { - message = "Pairing failed"; + message = getResources().getString(R.string.pair_fail); } else if (pairState == PairingManager.PairState.PAIRED) { - message = "Paired successfully"; + message = getResources().getString(R.string.pair_success); } else { // Should be no other values @@ -335,10 +334,9 @@ public class PcView extends Activity { } } } catch (UnknownHostException e) { - message = "Failed to resolve host"; + message = getResources().getString(R.string.error_unknown_host); } catch (FileNotFoundException e) { - message = "GFE returned an HTTP 404 error. Make sure your PC is running a supported GPU. Using remote desktop software can also cause this error. " - + "Try rebooting your machine or reinstalling GFE."; + message = getResources().getString(R.string.error_404); } catch (Exception e) { message = e.getMessage(); } @@ -361,26 +359,25 @@ public class PcView extends Activity { private void doWakeOnLan(final ComputerDetails computer) { if (computer.reachability != ComputerDetails.Reachability.OFFLINE) { - Toast.makeText(PcView.this, "Computer is online", Toast.LENGTH_SHORT).show(); + Toast.makeText(PcView.this, getResources().getString(R.string.wol_pc_online), Toast.LENGTH_SHORT).show(); return; } if (computer.macAddress == null) { - Toast.makeText(PcView.this, "Unable to wake PC because GFE didn't send a MAC address", Toast.LENGTH_SHORT).show(); + Toast.makeText(PcView.this, getResources().getString(R.string.wol_no_mac), Toast.LENGTH_SHORT).show(); return; } - Toast.makeText(PcView.this, "Waking PC...", Toast.LENGTH_SHORT).show(); + Toast.makeText(PcView.this, getResources().getString(R.string.wol_waking_pc), Toast.LENGTH_SHORT).show(); new Thread(new Runnable() { @Override public void run() { String message; try { WakeOnLanSender.sendWolPacket(computer); - message = "It may take a few seconds for your PC to wake up. " + - "If it doesn't, make sure it's configured properly for Wake-On-LAN."; + message = getResources().getString(R.string.wol_waking_msg); } catch (IOException e) { - message = "Failed to send Wake-On-LAN packets"; + message = getResources().getString(R.string.wol_fail); } final String toastMessage = message; @@ -396,16 +393,15 @@ public class PcView extends Activity { private void doUnpair(final ComputerDetails computer) { if (computer.reachability == ComputerDetails.Reachability.OFFLINE) { - Toast.makeText(PcView.this, "Computer is offline", Toast.LENGTH_SHORT).show(); + Toast.makeText(PcView.this, getResources().getString(R.string.error_pc_offline), Toast.LENGTH_SHORT).show(); return; } if (managerBinder == null) { - Toast.makeText(PcView.this, "The ComputerManager service is not running. " + - "Please wait a few seconds or restart the app.", Toast.LENGTH_LONG).show(); + Toast.makeText(PcView.this, getResources().getString(R.string.error_manager_not_running), Toast.LENGTH_LONG).show(); return; } - Toast.makeText(PcView.this, "Unpairing...", Toast.LENGTH_SHORT).show(); + Toast.makeText(PcView.this, getResources().getString(R.string.unpairing), Toast.LENGTH_SHORT).show(); new Thread(new Runnable() { @Override public void run() { @@ -427,20 +423,19 @@ public class PcView extends Activity { if (httpConn.getPairState() == PairingManager.PairState.PAIRED) { httpConn.unpair(); if (httpConn.getPairState() == PairingManager.PairState.NOT_PAIRED) { - message = "Unpaired successfully"; + message = getResources().getString(R.string.unpair_success); } else { - message = "Failed to unpair"; + message = getResources().getString(R.string.unpair_fail); } } else { - message = "Device was not paired"; + message = getResources().getString(R.string.unpair_error); } } catch (UnknownHostException e) { - message = "Failed to resolve host"; + message = getResources().getString(R.string.error_unknown_host); } catch (FileNotFoundException e) { - message = "GFE returned an HTTP 404 error. Make sure your PC is running a supported GPU. Using remote desktop software can also cause this error. " - + "Try rebooting your machine or reinstalling GFE."; + message = getResources().getString(R.string.error_404); } catch (Exception e) { message = e.getMessage(); } @@ -458,12 +453,11 @@ public class PcView extends Activity { private void doAppList(ComputerDetails computer) { if (computer.reachability == ComputerDetails.Reachability.OFFLINE) { - Toast.makeText(PcView.this, "Computer is offline", Toast.LENGTH_SHORT).show(); + Toast.makeText(PcView.this, getResources().getString(R.string.error_pc_offline), Toast.LENGTH_SHORT).show(); return; } if (managerBinder == null) { - Toast.makeText(PcView.this, "The ComputerManager service is not running. " + - "Please wait a few seconds or restart the app.", Toast.LENGTH_LONG).show(); + Toast.makeText(PcView.this, getResources().getString(R.string.error_manager_not_running), Toast.LENGTH_LONG).show(); return; } @@ -482,79 +476,76 @@ public class PcView extends Activity { startActivity(i); } - @Override - public boolean onContextItemSelected(MenuItem item) { - AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); - ComputerObject computer = pcListAdapter.getItem(info.position); - switch (item.getItemId()) - { - case PAIR_ID: - doPair(computer.details); - return true; - - case UNPAIR_ID: - doUnpair(computer.details); - return true; - - case WOL_ID: - doWakeOnLan(computer.details); - return true; - - case DELETE_ID: - if (managerBinder == null) { - Toast.makeText(PcView.this, "The ComputerManager service is not running. " + - "Please wait a few seconds or restart the app.", Toast.LENGTH_LONG).show(); - return true; - } - managerBinder.removeComputer(computer.details.name); - removeListView(computer.details); - return true; - - case APP_LIST_ID: - doAppList(computer.details); - return true; - - default: - return super.onContextItemSelected(item); - } - } + @Override + public boolean onContextItemSelected(MenuItem item) { + AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); + ComputerObject computer = pcListAdapter.getItem(info.position); + switch (item.getItemId()) + { + case PAIR_ID: + doPair(computer.details); + return true; + + case UNPAIR_ID: + doUnpair(computer.details); + return true; + + case WOL_ID: + doWakeOnLan(computer.details); + return true; + + case DELETE_ID: + if (managerBinder == null) { + Toast.makeText(PcView.this, getResources().getString(R.string.error_manager_not_running), Toast.LENGTH_LONG).show(); + return true; + } + managerBinder.removeComputer(computer.details.name); + removeListView(computer.details); + return true; + + case APP_LIST_ID: + doAppList(computer.details); + return true; + + default: + return super.onContextItemSelected(item); + } + } - private static String generateString(ComputerDetails details) { - StringBuilder str = new StringBuilder(); - str.append(details.name).append(" - "); - if (details.state == ComputerDetails.State.ONLINE) { - str.append("Online "); - if (details.reachability == ComputerDetails.Reachability.LOCAL) { - str.append("(Local) - "); - } - else { - str.append("(Remote) - "); - } - if (details.pairState == PairState.PAIRED) { - if (details.runningGameId == 0) { - str.append("Available"); - } - else { - str.append("In Game"); - } - } - else { - str.append("Not Paired"); - } - } - else { - str.append("Offline"); - } - return str.toString(); - } - - private void addListPlaceholder() { - pcListAdapter.add(new ComputerObject("Discovery is running. No computers found yet. " + - "If your PC doesn't show up in about 15 seconds, " + - "make sure your computer is running GFE or add your PC manually using the button above.", null)); - } - - private void removeListView(ComputerDetails details) { + private static String generateString(ComputerDetails details) { + StringBuilder str = new StringBuilder(); + str.append(details.name).append(" - "); + if (details.state == ComputerDetails.State.ONLINE) { + str.append(getResources().getString(R.string.status_online)+" "); + if (details.reachability == ComputerDetails.Reachability.LOCAL) { + str.append("("+getResources().getString(R.string.status_local)+") - "); + } + else { + str.append("("+getResources().getString(R.string.status_remote)+") - "); + } + if (details.pairState == PairState.PAIRED) { + if (details.runningGameId == 0) { + str.append(getResources().getString(R.string.status_available)); + } + else { + str.append(getResources().getString(R.string.status_ingame)); + } + } + else { + str.append(getResources().getString(R.string.status_not_paired)); + } + } + else { + str.append(getResources().getString(R.string.status_offline)); + } + return str.toString(); + } + + private void addListPlaceholder() { + pcListAdapter.add(new ComputerObject(getResources().getString(R.string.discovery_running), null)); + } + + private void removeListView(ComputerDetails details) { for (int i = 0; i < pcListAdapter.getCount(); i++) { ComputerObject computer = pcListAdapter.getItem(i); @@ -568,8 +559,8 @@ public class PcView extends Activity { // Add the placeholder if we're down to 0 computers addListPlaceholder(); } - } - + } + private void updateListView(ComputerDetails details) { String computerString = generateString(details); ComputerObject existingEntry = null; diff --git a/app/src/main/java/com/limelight/preferences/AddComputerManually.java b/app/src/main/java/com/limelight/preferences/AddComputerManually.java index 51ba1bbc..0cb46136 100644 --- a/app/src/main/java/com/limelight/preferences/AddComputerManually.java +++ b/app/src/main/java/com/limelight/preferences/AddComputerManually.java @@ -47,14 +47,14 @@ public class AddComputerManually extends Activity { InetAddress addr = InetAddress.getByName(host); if (!managerBinder.addComputerBlocking(addr)){ - msg = "Unable to connect to the specified computer. Make sure the required ports are allowed through the firewall."; + msg = getResources().getString(R.string.addpc_fail); } else { - msg = "Successfully added computer"; + msg = getResources().getString(R.string.addpc_success); finish = true; } } catch (UnknownHostException e) { - msg = "Unable to resolve PC address. Make sure you didn't make a typo in the address."; + msg = getResources().getString(R.string.addpc_unknown_host); } final boolean toastFinish = finish; @@ -141,11 +141,11 @@ public class AddComputerManually extends Activity { @Override public void onClick(View v) { if (hostText.getText().length() == 0) { - Toast.makeText(AddComputerManually.this, "You must enter an IP address", Toast.LENGTH_LONG).show(); + Toast.makeText(AddComputerManually.this, getResources().getString(R.string.addpc_enter_ip), Toast.LENGTH_LONG).show(); return; } - Toast.makeText(AddComputerManually.this, "Adding PC...", Toast.LENGTH_SHORT).show(); + Toast.makeText(AddComputerManually.this, getResources().getString(R.string.addpc_adding_pc), Toast.LENGTH_SHORT).show(); computersToAdd.add(hostText.getText().toString()); } }); diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 2b597539..73df0415 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -6,7 +6,7 @@ 1080p 30 FPS 1080p 60 FPS - + 720p30 720p60 1080p30 @@ -14,13 +14,13 @@ - Force Software Decoding Auto-select Decoder + Force Software Decoding Force Hardware Decoding - - software + auto + software hardware - \ No newline at end of file + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index fa765c21..87329220 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,13 +1,102 @@ + + View Game List + Pair with PC + Unpair + Send Wake-On-LAN request + Delete PC + + + Pairing... + Computer is offline + Computer is currently in a game. You must close the game before pairing. + Already paired + Pairing + Please enter the following PIN on the target PC: + Incorrect PIN + Pairing failed + Paired successfully + + + Computer is online + Unable to wake PC because GFE didn\'t send a MAC address + Waking PC... + It may take a few seconds for your PC to wake up. + If it doesn\'t, make sure it'\s configured properly for Wake-On-LAN. + + Failed to send Wake-On-LAN packets + + + Unpairing... + Unpaired successfully + Failed to unpair + Device was not paired + + + Computer is offline + The ComputerManager service is not running. Please wait a few seconds or restart the app. + Failed to resolve host + GFE returned an HTTP 404 error. Make sure your PC is running a supported GPU. + Using remote desktop software can also cause this error. Try rebooting your machine or reinstalling GFE. + + + + Online + Offline + Local + Remote + Available + In Game + Not Paired + + + Establishing Connection + Starting connection + Warning: Your active network connection is metered! + Average client-side frame latency: + hardware decoder latency: + Average hardware decoder latency: + Starting + Connection Error + Fail starting + Connection Terminated + The connection failed unexpectedly + + + Unable to connect to the specified computer. Make sure the required ports are allowed through the firewall. + Successfully added computer + Unable to resolve PC address. Make sure you didn\'t make a typo in the address. + You must enter an IP address + Adding PC... + + Discovery is running. No computers found yet. If your PC doesn't show up in about 15 seconds, + make sure your computer is running GFE or add your PC manually using the button above. + IP address of GeForce PC PC List Streaming Settings Add PC Manually + + + App List for + Resume Session + Quit Session + Quit Current Game and Start + Cancel + Running + No apps found. Try rescanningfor games in GeForce Experience. + App List + Refreshing app list... + Error + Failed to get app list + Quitting + Successfully quit + Failed to quit Manually Add PC From f112d45e1ac3b9705a9a9e11926106a91581eda9 Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Wed, 12 Nov 2014 09:58:26 +0100 Subject: [PATCH 2/3] Some cleanup --- app/src/main/java/com/limelight/AppView.java | 3 ++- .../preferences/AddComputerManually.java | 3 ++- app/src/main/res/values/strings.xml | 27 +++---------------- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/com/limelight/AppView.java b/app/src/main/java/com/limelight/AppView.java index c44b19a7..d2a717fc 100644 --- a/app/src/main/java/com/limelight/AppView.java +++ b/app/src/main/java/com/limelight/AppView.java @@ -221,7 +221,8 @@ public class AppView extends Activity { spinner.dismiss(); } - Dialog.displayDialog(AppView.this, "Error", "Failed to get app list", true); + Dialog.displayDialog(AppView.this, getResources().getString(R.string.applist_refresh_error_title), + getResources().getString(R.string.applist_refresh_error_msg), true); } }.start(); } diff --git a/app/src/main/java/com/limelight/preferences/AddComputerManually.java b/app/src/main/java/com/limelight/preferences/AddComputerManually.java index ebb3e717..1f38d983 100644 --- a/app/src/main/java/com/limelight/preferences/AddComputerManually.java +++ b/app/src/main/java/com/limelight/preferences/AddComputerManually.java @@ -48,7 +48,8 @@ public class AddComputerManually extends Activity { String msg; boolean finish = false; - SpinnerDialog dialog = SpinnerDialog.displayDialog(this, "Add PC Manually", "Connecting to the specified PC...", false); + SpinnerDialog dialog = SpinnerDialog.displayDialog(this, getResources().getString(R.string.title_add_pc), + getResources().getString(R.string.msg_add_pc), false); try { InetAddress addr = InetAddress.getByName(host); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1c448103..8cf6c162 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -42,15 +42,6 @@ Using remote desktop software can also cause this error. Try rebooting your machine or reinstalling GFE. - - - Establishing Connection Starting connection @@ -69,31 +60,20 @@ Successfully added computer Unable to resolve PC address. Make sure you didn\'t make a typo in the address. You must enter an IP address - - IP address of GeForce PC - - - Apps on Resume Session Quit Session Quit Current Game and Start Cancel - - - App List + App List Refreshing apps... - Error - Failed to get app list + Error + Failed to get app list Quitting Successfully quit Failed to quit @@ -101,6 +81,7 @@ Add PC Manually Add PC + Connecting to the specified PC... Basic Settings From b9ba9adc1f4ae29203ed00e76ee03a6b14d159c5 Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Wed, 12 Nov 2014 12:52:18 +0100 Subject: [PATCH 3/3] Forgot about these --- app/src/main/res/layout-land/activity_pc_view.xml | 4 ++-- app/src/main/res/layout-port/activity_pc_view.xml | 4 ++-- app/src/main/res/values/strings.xml | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/layout-land/activity_pc_view.xml b/app/src/main/res/layout-land/activity_pc_view.xml index 06ad7c52..68e830ab 100644 --- a/app/src/main/res/layout-land/activity_pc_view.xml +++ b/app/src/main/res/layout-land/activity_pc_view.xml @@ -42,7 +42,7 @@ android:layout_centerVertical="true" android:textAppearance="?android:attr/textAppearanceLarge" android:gravity="center" - android:text="Searching for PCs on the network..."/> + android:text="@string/searching_pc"/> @@ -68,4 +68,4 @@ android:src="@drawable/add_computer" style="?android:attr/borderlessButtonStyle"/> - \ No newline at end of file + diff --git a/app/src/main/res/layout-port/activity_pc_view.xml b/app/src/main/res/layout-port/activity_pc_view.xml index 20a7cb60..5f3bc8b9 100644 --- a/app/src/main/res/layout-port/activity_pc_view.xml +++ b/app/src/main/res/layout-port/activity_pc_view.xml @@ -42,7 +42,7 @@ android:layout_centerVertical="true" android:textAppearance="?android:attr/textAppearanceLarge" android:gravity="center" - android:text="Searching for PCs on the network..."/> + android:text="@string/searching_pc"/> @@ -68,4 +68,4 @@ android:src="@drawable/add_computer" style="?android:attr/borderlessButtonStyle"/> - \ No newline at end of file + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8cf6c162..0edb454e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -63,6 +63,7 @@ IP address of GeForce PC + Searching for PCs on the network... Apps on