Skip to content

Commit

Permalink
Improved conversion from JSON parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
rmraya committed Dec 25, 2024
1 parent 50dc26e commit 6e60142
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
Binary file modified lib/openxliff.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/com/maxprograms/converters/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private Constants() {
public static final String TOOLID = "OpenXLIFF";
public static final String TOOLNAME = "OpenXLIFF Filters";
public static final String VERSION = "4.0.0";
public static final String BUILD = "20241225_0817";
public static final String BUILD = "20241225_0934";

public static final String SUCCESS = "0";
public static final String ERROR = "1";
Expand Down
8 changes: 6 additions & 2 deletions src/com/maxprograms/converters/Convert.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ public static void main(String[] args) {
try {
convert(jsonFile);
} catch (IOException | JSONException e) {
logger.log(Level.ERROR, Messages.getString("Convert.13"), e);
MessageFormat mf = new MessageFormat(Messages.getString("Convert.13"));
logger.log(Level.ERROR, mf.format(new String[] { e.getMessage() }));
}
return;
}
Expand Down Expand Up @@ -550,7 +551,10 @@ private static void convert(String jsonFile) throws IOException, JSONException {
params.put("ignoresvg", "yes");
}
params.put("xmlfilter", xmlfilter);
run(params);
List<String> result = run(params);
if (!Constants.SUCCESS.equals(result.get(0))) {
throw new IOException(result.get(1));
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/com/maxprograms/converters/converters.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Convert.09=Unable to auto-detect character set. Use '-enc' parameter.
Convert.10=Unsupported encoding
Convert.11=Missing '-srcLang' parameter
Convert.12=''{0}'' is not a valid language code
Convert.13=Error processing JSON file: {0}
Convert.14=Error validating languages
Convert.15=SRX file ''{0}'' does not exist
Convert.16='catalog' folder not found
Expand Down
1 change: 1 addition & 0 deletions src/com/maxprograms/converters/converters_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Convert.09=No se puede detectar automáticamente el juego de caracteres. Utilice
Convert.10=Codificación no admitida
Convert.11=Falta el parámetro '-srcLang'
Convert.12=''{0}'' no es un código de idioma válido
Convert.13=Error al procesar el archivo JSON: {0}
Convert.14=Error al validar idiomas
Convert.15=El archivo SRX ''{0}'' no existe
Convert.16=No se encontró la carpeta 'catalog'
Expand Down

0 comments on commit 6e60142

Please sign in to comment.