diff options
author | Samuel Holland <samuel@sholland.org> | 2018-04-30 11:36:56 -0500 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2018-04-30 11:39:23 -0500 |
commit | 8e4fb91a28c01b753a72a8a9130e7b4d78e9ee83 (patch) | |
tree | c6a041288a1b5de1e97f73343e0a7d6fa17a58ed /app/src | |
parent | 7eedf08d4bbe8d15a38cde777d92e72930ffa2e8 (diff) |
global: Clean up XML
Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/AndroidManifest.xml | 2 | ||||
-rw-r--r-- | app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java | 7 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 18 |
3 files changed, 18 insertions, 9 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b81b0fcc..f99c02ee 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -5,8 +5,8 @@ android:installLocation="internalOnly"> <uses-permission android:name="android.permission.INTERNET" /> - <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <application android:name=".Application" diff --git a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java index 5291d8fb..2b81a98a 100644 --- a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java +++ b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java @@ -254,9 +254,12 @@ public class TunnelListFragment extends BaseFragment { else if (tunnels.isEmpty() && throwables.size() == 1) /* Use the exception message from above. */ ; else if (throwables.isEmpty()) - message = getString(R.string.import_total_success, tunnels.size()); + message = getResources().getQuantityString(R.plurals.import_total_success, + tunnels.size(), tunnels.size()); else if (!throwables.isEmpty()) - message = getString(R.string.import_partial_success, tunnels.size(), tunnels.size() + throwables.size()); + message = getResources().getQuantityString(R.plurals.import_partial_success, + tunnels.size() + throwables.size(), + tunnels.size(), tunnels.size() + throwables.size()); if (binding != null) { final CoordinatorLayout container = binding.mainContainer; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f028d2b6..d3bc8b99 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -12,6 +12,14 @@ <item quantity="one">%d tunnel selected</item> <item quantity="other">%d tunnels selected</item> </plurals> + <plurals name="import_partial_success"> + <item quantity="one">Imported %d of %d tunnels</item> + <item quantity="other">Imported %d of %d tunnels</item> + </plurals> + <plurals name="import_total_success"> + <item quantity="one">Imported %d tunnel</item> + <item quantity="other">Imported %d tunnels</item> + </plurals> <string name="add_peer">Add peer</string> <string name="addresses">Addresses</string> <string name="allowed_ips">Allowed IPs</string> @@ -28,19 +36,16 @@ <string name="error_down">Error bringing down tunnel: %s</string> <string name="error_root">Please obtain root access and try again</string> <string name="error_up">Error bringing up tunnel: %s</string> + <string name="export_error">Unable to export tunnels: %s</string> + <string name="export_success">Saved to %s</string> + <string name="export_summary">Zip file will be saved to downloads folder</string> <string name="generate">Generate</string> <string name="hint_automatic">(auto)</string> <string name="hint_generated">(generated)</string> <string name="hint_optional">(optional)</string> <string name="hint_random">(random)</string> - <string name="zip_exporter_title">Export tunnels to zip file</string> - <string name="export_error">Unable to export tunnels: %s</string> - <string name="export_success">Saved to %s</string> - <string name="export_summary">Zip file will be saved to downloads folder</string> <string name="import_error">Unable to import tunnel: %s</string> <string name="import_success">Imported “%s”</string> - <string name="import_total_success">Imported %d tunnels</string> - <string name="import_partial_success">Imported %d of %d tunnels</string> <string name="interface_title">Interface</string> <string name="listen_port">Listen port</string> <string name="mtu">MTU</string> @@ -66,4 +71,5 @@ <string name="tunnel_create_success">Successfully created tunnel “%s”</string> <string name="tunnel_rename_error">Unable to rename tunnel: %s</string> <string name="tunnel_rename_success">Successfully renamed tunnel to “%s”</string> + <string name="zip_exporter_title">Export tunnels to zip file</string> </resources> |