| 
32 | 32 | import java.util.List;  | 
33 | 33 | 
 
  | 
34 | 34 | import static processing.app.I18n._;  | 
35 |  | - | 
 | 35 | +import static processing.app.I18n.format;  | 
36 | 36 | 
 
  | 
37 | 37 | public class Serial implements SerialPortEventListener {  | 
38 | 38 | 
 
  | 
@@ -84,7 +84,7 @@ public static boolean touchForCDCReset(String iname) throws SerialException {  | 
84 | 84 |       serialPort.closePort();  | 
85 | 85 |       return true;  | 
86 | 86 |     } catch (SerialPortException e) {  | 
87 |  | -      throw new SerialException(I18n.format(_("Error touching serial port ''{0}''."), iname), e);  | 
 | 87 | +      throw new SerialException(format(_("Error touching serial port ''{0}''."), iname), e);  | 
88 | 88 |     } finally {  | 
89 | 89 |       if (serialPort.isOpened()) {  | 
90 | 90 |         try {  | 
@@ -116,13 +116,13 @@ private Serial(String iname, int irate, char iparity, int idatabits, float istop  | 
116 | 116 |       port.addEventListener(this);  | 
117 | 117 |     } catch (SerialPortException e) {  | 
118 | 118 |       if (e.getPortName().startsWith("/dev") && SerialPortException.TYPE_PERMISSION_DENIED.equals(e.getExceptionType())) {  | 
119 |  | -        throw new SerialException(I18n.format(_("Error opening serial port ''{0}''. Try consulting the documentation at http://playground.arduino.cc/Linux/All#Permission"), iname));  | 
 | 119 | +        throw new SerialException(format(_("Error opening serial port ''{0}''. Try consulting the documentation at http://playground.arduino.cc/Linux/All#Permission"), iname));  | 
120 | 120 |       }  | 
121 |  | -      throw new SerialException(I18n.format(_("Error opening serial port ''{0}''."), iname), e);  | 
 | 121 | +      throw new SerialException(format(_("Error opening serial port ''{0}''."), iname), e);  | 
122 | 122 |     }  | 
123 | 123 | 
 
  | 
124 | 124 |     if (port == null) {  | 
125 |  | -      throw new SerialNotFoundException(I18n.format(_("Serial port ''{0}'' not found. Did you select the right one from the Tools > Serial Port menu?"), iname));  | 
 | 125 | +      throw new SerialNotFoundException(format(_("Serial port ''{0}'' not found. Did you select the right one from the Tools > Serial Port menu?"), iname));  | 
126 | 126 |     }  | 
127 | 127 |   }  | 
128 | 128 | 
 
  | 
@@ -231,7 +231,7 @@ static public List<String> list() {  | 
231 | 231 |    * I think of something slightly more intelligent to do.  | 
232 | 232 |    */  | 
233 | 233 |   private static void errorMessage(String where, Throwable e) {  | 
234 |  | -    System.err.println(I18n.format(_("Error inside Serial.{0}()"), where));  | 
 | 234 | +    System.err.println(format(_("Error inside Serial.{0}()"), where));  | 
235 | 235 |     e.printStackTrace();  | 
236 | 236 |   }  | 
237 | 237 | }  | 
0 commit comments