Skip to content

Commit

Permalink
Fixed TMX export
Browse files Browse the repository at this point in the history
  • Loading branch information
rmraya committed Jul 6, 2023
1 parent 26e77f4 commit 5cedfbc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Binary file modified lib/openxliff.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions src/com/maxprograms/converters/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ private Constants() {

public static final String TOOLID = "OpenXLIFF";
public static final String TOOLNAME = "OpenXLIFF Filters";
public static final String VERSION = "3.9.0";
public static final String BUILD = "20230630_1257";
public static final String VERSION = "3.10.0";
public static final String BUILD = "20230705_1254";

public static final String SUCCESS = "0";
public static final String ERROR = "1";
Expand Down
17 changes: 9 additions & 8 deletions src/com/maxprograms/converters/TmxExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,18 +256,18 @@ public static String extractText(Element src) {
if (!assoc.isEmpty()) {
assoc = " assoc=\"" + XMLUtils.cleanText(assoc) + "\"";
}
String id = "";
String x = "";
if (type.equals("ph")) {
id = src.getAttributeValue("id");
if (!id.isEmpty()) {
id = " x=\"" + XMLUtils.cleanText(id) + "\"";
x = src.getAttributeValue("id");
if (!x.isEmpty()) {
x = " x=\"" + XMLUtils.cleanText(x).hashCode() + "\"";
}
}
StringBuilder text = new StringBuilder();
text.append("<ph");
text.append(ctype);
text.append(assoc);
text.append(id);
text.append(x);
text.append('>');
while (i.hasNext()) {
XMLNode o = i.next();
Expand Down Expand Up @@ -378,9 +378,9 @@ public static String extractText(Element src) {
}
String rid = src.getAttributeValue("rid");
if (!rid.isEmpty()) {
rid = " i=\"" + XMLUtils.cleanText(rid) + "\"";
rid = " i=\"" + XMLUtils.cleanText(rid).hashCode() + "\"";
} else {
rid = " i=\"" + XMLUtils.cleanText(src.getAttributeValue("id")) + "\"";
rid = " i=\"" + XMLUtils.cleanText(src.getAttributeValue("id")).hashCode() + "\"";
}
StringBuilder text = new StringBuilder();
text.append('<');
Expand Down Expand Up @@ -446,7 +446,8 @@ public static String extractText(Element src) {
}
name.append(ts.charAt(i));
}
return "<ph type=\"mrk-protected\" x=\"" + XMLUtils.cleanText(src.getAttributeValue("mid", "-"))
return "<ph type=\"mrk-protected\" x=\""
+ XMLUtils.cleanText(src.getAttributeValue("mid", "-")).hashCode()
+ "\">" + XMLUtils.cleanText(ts) + "</ph>" + XMLUtils.cleanText(src.getText())
+ "<ph type=\"mrk-close\">" + XMLUtils.cleanText("</" + name.toString() + ">") + "</ph>";
}
Expand Down

0 comments on commit 5cedfbc

Please sign in to comment.