mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 04:39:54 +01:00
Unit tests for i18n component.
This commit is contained in:
@@ -121,8 +121,11 @@ public class I18nImpl implements I18n {
|
||||
}
|
||||
|
||||
public void loadLocale() throws IOException {
|
||||
File root = FileUtils.getBriarDirectory();
|
||||
Scanner s = new Scanner(new File(root, "Data/locale.cfg"));
|
||||
loadLocale(FileUtils.getBriarDirectory());
|
||||
}
|
||||
|
||||
public void loadLocale(File dir) throws IOException {
|
||||
Scanner s = new Scanner(new File(dir, "Data/locale.cfg"));
|
||||
if(s.hasNextLine()) setLocale(new Locale(s.nextLine()));
|
||||
s.close();
|
||||
}
|
||||
@@ -132,7 +135,7 @@ public class I18nImpl implements I18n {
|
||||
}
|
||||
|
||||
public void saveLocale(File dir) throws IOException {
|
||||
File localeCfg = new File(dir, "locale.cfg");
|
||||
File localeCfg = new File(dir, "Data/locale.cfg");
|
||||
FileOutputStream out = new FileOutputStream(localeCfg);
|
||||
PrintStream print = new PrintStream(out);
|
||||
print.println(locale);
|
||||
|
||||
@@ -82,7 +82,7 @@ class SetupWorker implements Runnable {
|
||||
createLaunchers(dir);
|
||||
if(callback.isCancelled()) return;
|
||||
// Save the chosen locale for the first launch
|
||||
i18n.saveLocale(data);
|
||||
i18n.saveLocale(dir);
|
||||
if(callback.isCancelled()) return;
|
||||
// Installation succeeded - delete the installer
|
||||
jar.deleteOnExit();
|
||||
|
||||
Reference in New Issue
Block a user