Fix locale usage

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2018-12-11 03:47:32 +01:00
parent b514717076
commit dc2463a0ab
12 changed files with 35 additions and 49 deletions
@@ -45,7 +45,7 @@ public class LogExporterPreference extends Preference {
final File file = new File(path, "wireguard-log.txt");
if (!path.isDirectory() && !path.mkdirs())
throw new IOException(
getContext().getResources().getString(R.string.create_output_dir_error));
getContext().getString(R.string.create_output_dir_error));
/* We would like to simply run `builder.redirectOutput(file);`, but this is API 26.
* Instead we have to do this dance, since logcat appends.
@@ -56,7 +56,7 @@ public class ZipExporterPreference extends Preference {
futureConfigs.add(tunnel.getConfigAsync().toCompletableFuture());
if (futureConfigs.isEmpty()) {
exportZipComplete(null, new IllegalArgumentException(
getContext().getResources().getString(R.string.no_tunnels_error)));
getContext().getString(R.string.no_tunnels_error)));
return;
}
CompletableFuture.allOf(futureConfigs.toArray(new CompletableFuture[futureConfigs.size()]))
@@ -67,7 +67,7 @@ public class ZipExporterPreference extends Preference {
final File file = new File(path, "wireguard-export.zip");
if (!path.isDirectory() && !path.mkdirs())
throw new IOException(
getContext().getResources().getString(R.string.create_output_dir_error));
getContext().getString(R.string.create_output_dir_error));
try (ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(file))) {
for (int i = 0; i < futureConfigs.size(); ++i) {
zip.putNextEntry(new ZipEntry(tunnels.get(i).getName() + ".conf"));