33
33
import cc .arduino .utils .MultiStepProgress ;
34
34
import cc .arduino .utils .Progress ;
35
35
import processing .app .BaseNoGui ;
36
+ import processing .app .I18n ;
36
37
import processing .app .helpers .FileUtils ;
37
38
38
39
import java .io .File ;
@@ -97,17 +98,17 @@ public void updateIndex() throws Exception {
97
98
rescanLibraryIndex (progress );
98
99
}
99
100
100
- public void install (ContributedLibrary lib , ContributedLibrary replacedLib ) {
101
+ public void install (ContributedLibrary lib , ContributedLibrary replacedLib ) throws Exception {
101
102
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 () ));
103
104
return ;
104
105
}
105
106
106
107
final MultiStepProgress progress = new MultiStepProgress (3 );
107
108
108
109
// Step 1: Download library
109
110
try {
110
- downloader .download (lib , progress , _ ("Downloading library: \" " + lib .getName () + " \" " ));
111
+ downloader .download (lib , progress , I18n . format ( _ ("Downloading library: \" {0} \" " ), lib .getName ()));
111
112
} catch (InterruptedException e ) {
112
113
// Download interrupted... just exit
113
114
return ;
@@ -118,7 +119,7 @@ public void install(ContributedLibrary lib, ContributedLibrary replacedLib) {
118
119
// all the temporary folders and abort installation.
119
120
120
121
// 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 ()));
122
123
onProgress (progress );
123
124
File libsFolder = indexer .getSketchbookLibrariesFolder ();
124
125
File tmpFolder = FileUtils .createTempFolderIn (libsFolder );
@@ -149,7 +150,7 @@ public void remove(ContributedLibrary lib) throws IOException {
149
150
final MultiStepProgress progress = new MultiStepProgress (2 );
150
151
151
152
// Step 1: Remove library
152
- progress .setStatus (_ ("Removing library: \" " + lib .getName () + " \" " ));
153
+ progress .setStatus (I18n . format ( _ ("Removing library: \" {0} \" " ), lib .getName ()));
153
154
onProgress (progress );
154
155
FileUtils .recursiveDelete (lib .getInstalledFolder ());
155
156
progress .stepDone ();
0 commit comments