Skip to content

Commit f0cc644

Browse files
author
Federico Fissore
committed
Library installer: made messages play nicer with i18n
1 parent 8187649 commit f0cc644

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

arduino-core/src/cc/arduino/contributions/libraries/LibraryInstaller.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import cc.arduino.utils.MultiStepProgress;
3434
import cc.arduino.utils.Progress;
3535
import processing.app.BaseNoGui;
36+
import processing.app.I18n;
3637
import processing.app.helpers.FileUtils;
3738

3839
import java.io.File;
@@ -97,17 +98,17 @@ public void updateIndex() throws Exception {
9798
rescanLibraryIndex(progress);
9899
}
99100

100-
public void install(ContributedLibrary lib, ContributedLibrary replacedLib) {
101+
public void install(ContributedLibrary lib, ContributedLibrary replacedLib) throws Exception {
101102
if (lib.isInstalled()) {
102-
System.out.println(_("Library is already installed: \"" + lib.getName() + "\""));
103+
System.out.println(I18n.format(_("Library is already installed: \"{0}\""), lib.getName() + " " + lib.getParsedVersion()));
103104
return;
104105
}
105106

106107
final MultiStepProgress progress = new MultiStepProgress(3);
107108

108109
// Step 1: Download library
109110
try {
110-
downloader.download(lib, progress, _("Downloading library: \"" + lib.getName() + "\""));
111+
downloader.download(lib, progress, I18n.format(_("Downloading library: \"{0}\""), lib.getName()));
111112
} catch (InterruptedException e) {
112113
// Download interrupted... just exit
113114
return;
@@ -118,7 +119,7 @@ public void install(ContributedLibrary lib, ContributedLibrary replacedLib) {
118119
// all the temporary folders and abort installation.
119120

120121
// Step 2: Unpack library on the correct location
121-
progress.setStatus(_("Installing library: \"" + lib.getName() + "\""));
122+
progress.setStatus(I18n.format(_("Installing library: \"{0}\""), lib.getName()));
122123
onProgress(progress);
123124
File libsFolder = indexer.getSketchbookLibrariesFolder();
124125
File tmpFolder = FileUtils.createTempFolderIn(libsFolder);
@@ -149,7 +150,7 @@ public void remove(ContributedLibrary lib) throws IOException {
149150
final MultiStepProgress progress = new MultiStepProgress(2);
150151

151152
// Step 1: Remove library
152-
progress.setStatus(_("Removing library: \"" + lib.getName() + "\""));
153+
progress.setStatus(I18n.format(_("Removing library: \"{0}\""), lib.getName()));
153154
onProgress(progress);
154155
FileUtils.recursiveDelete(lib.getInstalledFolder());
155156
progress.stepDone();

0 commit comments

Comments
 (0)