diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-11 03:24:34 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-11 03:47:32 +0100 |
commit | dc2463a0ab032e09afbd4aaac5eeb1992c53d55e (patch) | |
tree | 392478daa48cd0b8883e98ad7426dc0e8c3e32d5 /app/src/main/java/com/wireguard/android/fragment | |
parent | b514717076be159077cd1956928c1c51ba7b7225 (diff) |
Fix locale usage
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard/android/fragment')
-rw-r--r-- | app/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.java | 4 | ||||
-rw-r--r-- | app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/app/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.java b/app/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.java index 878f9335..9c8a300d 100644 --- a/app/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.java +++ b/app/src/main/java/com/wireguard/android/fragment/ConfigNamingDialogFragment.java @@ -24,7 +24,6 @@ import com.wireguard.config.ParseException; import java.io.ByteArrayInputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; -import java.util.Locale; import java.util.Objects; public class ConfigNamingDialogFragment extends DialogFragment { @@ -69,8 +68,7 @@ public class ConfigNamingDialogFragment extends DialogFragment { try { config = Config.parse(new ByteArrayInputStream(getArguments().getString(KEY_CONFIG_TEXT).getBytes(StandardCharsets.UTF_8))); } catch (final IOException | ParseException exception) { - throw new RuntimeException(String.format(Locale.getDefault(), - getResources().getString(R.string.invalid_config_error), getClass().getSimpleName()), exception); + throw new RuntimeException(getResources().getString(R.string.invalid_config_error, getClass().getSimpleName()), exception); } } 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 85d66baa..bbcbab94 100644 --- a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java +++ b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java @@ -115,8 +115,7 @@ public class TunnelListFragment extends BaseFragment { int idx = name.lastIndexOf('/'); if (idx >= 0) { if (idx >= name.length() - 1) - throw new IllegalArgumentException(String.format(Locale.getDefault(), - getResources().getString(R.string.illegal_filename_error), name)); + throw new IllegalArgumentException(getResources().getString(R.string.illegal_filename_error, name)); name = name.substring(idx + 1); } boolean isZip = name.toLowerCase(Locale.ENGLISH).endsWith(".zip"); |