From d00f62e2aa839e005653a5e9c855aa93f9026b50 Mon Sep 17 00:00:00 2001 From: "Rodolfo M. Raya" Date: Tue, 25 Aug 2020 11:00:56 -0300 Subject: [PATCH] Improved conversion to XLIFF 2.0 --- lib/openxliff.jar | Bin 459496 -> 459923 bytes src/com/maxprograms/xliff2/ToXliff2.java | 98 +++++++++++++++++++---- 2 files changed, 83 insertions(+), 15 deletions(-) diff --git a/lib/openxliff.jar b/lib/openxliff.jar index c33c191e6ea91d8470d3645213cb9b13b124441a..8b255a1fe0140b5fc70c66dbddc17b591d6bc6d9 100644 GIT binary patch delta 8837 zcmZvCc|4R~-~TM;vhTZyY-N{hA;MR-tQq^BCD{@}mNE7y+tAp{QYw^eBZO8_AyV0Q z+0u|SGUaz&Gw$Dg-_P^-=l$8vXFKOQFR$~N(DTjB7MbP4|(l9{$ zTZ9~b|2~2q*Foj8k#ekIq5mr(_OQtRE6u?XfR^E3WrN=0QKulMT_{Zm$S73^lmP`Q zCyGDy6JYp{vNF&(9a>R*{AYmv|9b&tLx2+4F|b#nc(*-(@qaEj0V%_16+x$scWI;G z5FVk=;Dzv^2pubgtqQCZ?A7LFWl2Z#TlH$1oxXsC!6fMLa6=Ri{`5G&)W~LzMMBm% zt3U+BO7#TyKbM4Hu!>W-TUMftiZ)3?kiI443kt&Qh%9ahkKDKgr`WS3ySy)CguxKJ zp#2ei_XNP$_&c+b5i+_}G%5h$)#me*Ak(dC6rOK5k;0dL;-`o7t<(Adgnt%wDeF#e zrcg?Hv*pSL$_dAia0OwAa1ez*WCjlufnE{L0YHS1Dtr&JB?zd)zpz8ZwlQ3bhmxAY zDD$WRGYrNdgdbc(93g-w$_qLOgja#^XeNru6PUh{F%t}y$cO(B2v@{s%>z7yysPkY zOpx753cQa(G~?j=bdaQ_1fETaV)PL1L&>DR9gd@cR0iGfG-v||1E1l7P>%@T*5Np4 z3kV5h_&4aN5khDYo=}B^5e|e22Sgl^K)k0oB&s3`D67)XA^;Xja>@HOc8c^cmEM?e$4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*DqVDbk%25b5ETN9}$pI8EAPQv$JB~(sCo&}`EPN@0=LNgjd_aBfO z^W7R@0)IhHh{^w#!o1>wFe#sBhP3z8(07*L1qoidBZ9wwL6DH-39=Gw(TKPm66c5f zM=T5{^WSecWqA9qWVmm`s%ci#&v&Pg7oEJEx`n*(#w=kt{@7<{V%PI7ldONYWTBfgP}x`&PPI1{xLa7csByVH7kWA zq%uT8EC&z&r(CpHio~%3k(|L&Lvt&F6~yGNM3_lfYWP43Am$ e5vCj!#hmgu^ri+>UtC;%$ diff --git a/src/com/maxprograms/xliff2/ToXliff2.java b/src/com/maxprograms/xliff2/ToXliff2.java index a000c397..aae42a24 100644 --- a/src/com/maxprograms/xliff2/ToXliff2.java +++ b/src/com/maxprograms/xliff2/ToXliff2.java @@ -27,6 +27,7 @@ import javax.xml.parsers.ParserConfigurationException; import com.maxprograms.converters.Constants; +import com.maxprograms.xml.Attribute; import com.maxprograms.xml.Catalog; import com.maxprograms.xml.Document; import com.maxprograms.xml.Element; @@ -257,7 +258,6 @@ private static void recurse(Element source, Element target) { space.addContent("keep"); metaGroup.addContent(space); } - } target.addContent(group); target = group; @@ -287,20 +287,38 @@ private static void recurse(Element source, Element target) { unit.addContent(originalData); Element src = source.getChild("source"); - List tags = src.getChildren("ph"); + List tags = src.getChildren(); Set tagSet = new TreeSet<>(); for (int i = 0; i < tags.size(); i++) { - Element ph = tags.get(i); - String id = "ph" + ph.getAttributeValue("id"); - if (!tagSet.contains(id)) { - Element data = new Element("data"); - data.setAttribute("id", id); - data.setContent(ph.getContent()); - originalData.addContent(data); - tagSet.add("ph" + ph.getAttributeValue("id")); + Element tag = tags.get(i); + if ("ph".equals(tag.getName())) { + String id = "ph" + tag.getAttributeValue("id"); + if (!tagSet.contains(id)) { + Element data = new Element("data"); + data.setAttribute("id", id); + data.setContent(tag.getContent()); + originalData.addContent(data); + tagSet.add("ph" + tag.getAttributeValue("id")); + } + } + if ("g".equals(tag.getName())) { + String id = "g" + tag.getAttributeValue("id"); + if (!tagSet.contains(id)) { + Element head = new Element("data"); + head.setAttribute("id", id); + head.setText(getHead(tag)); + originalData.addContent(head); + tagSet.add("g" + tag.getAttributeValue("id")); + + Element tail = new Element("data"); + tail.setAttribute("id", "/g" + tag.getAttributeValue("id")); + tail.setText(""); + originalData.addContent(tail); + tagSet.add("/g" + tag.getAttributeValue("id")); + } } } - + Element segment = new Element("segment"); segment.setAttribute("id", source.getAttributeValue("id")); unit.addContent(segment); @@ -328,6 +346,17 @@ private static void recurse(Element source, Element target) { ph.setAttribute("dataRef", "ph" + tag.getAttributeValue("id")); src2.addContent(ph); } + if (tag.getName().equals("g")) { + Element head = new Element("ph"); + head.setAttribute("id", "g" + tag.getAttributeValue("id")); + head.setAttribute("dataRef", "g" + tag.getAttributeValue("id")); + src2.addContent(head); + src2.addContent(tag.getText()); + Element tail = new Element("ph"); + tail.setAttribute("id", "/g" + tag.getAttributeValue("id")); + tail.setAttribute("dataRef", "/g" + tag.getAttributeValue("id")); + src2.addContent(tail); + } if (tag.getName().equals("mrk")) { Element mrk = new Element("mrk"); mrk.setAttribute("id", "mrk" + tag.getAttributeValue("mid")); @@ -373,6 +402,31 @@ private static void recurse(Element source, Element target) { ph.setAttribute("dataRef", id); tgt2.addContent(ph); } + if (tag.getName().equals("g")) { + String id = "g" + tag.getAttributeValue("id"); + if (!tagSet.contains(id)) { + Element head = new Element("data"); + head.setAttribute("id", id); + head.setText(getHead(tag)); + originalData.addContent(head); + tagSet.add("g" + tag.getAttributeValue("id")); + + Element tail = new Element("data"); + tail.setAttribute("id", "/g" + tag.getAttributeValue("id")); + tail.setText(""); + originalData.addContent(tail); + tagSet.add("/g" + tag.getAttributeValue("id")); + } + Element head = new Element("ph"); + head.setAttribute("id", id); + head.setAttribute("dataRef", id); + tgt2.addContent(head); + tgt2.addContent(tag.getText()); + Element tail = new Element("ph"); + tail.setAttribute("id", "/g" + tag.getAttributeValue("id")); + tail.setAttribute("dataRef", "/g" + tag.getAttributeValue("id")); + tgt2.addContent(tail); + } if (tag.getName().equals("mrk")) { Element mrk = new Element("mrk"); mrk.setAttribute("id", "mrk" + tag.getAttributeValue("mid")); @@ -421,8 +475,8 @@ private static void recurse(Element source, Element target) { Element tag = (Element) node; if (tag.getName().equals("ph")) { Element ph = new Element("ph"); - String id = "ph" + tag.getAttributeValue("id"); - ph.setAttribute("id",id); + String id = "ph" + tag.getAttributeValue("id"); + ph.setAttribute("id", id); if (!tagSet.contains(id)) { Element data = new Element("data"); data.setAttribute("id", id); @@ -457,8 +511,8 @@ private static void recurse(Element source, Element target) { Element tag = (Element) node; if (tag.getName().equals("ph")) { Element ph = new Element("ph"); - String id = "ph" + tag.getAttributeValue("id"); - ph.setAttribute("id",id); + String id = "ph" + tag.getAttributeValue("id"); + ph.setAttribute("id", id); if (!tagSet.contains(id)) { Element data = new Element("data"); data.setAttribute("id", id); @@ -496,4 +550,18 @@ private static void recurse(Element source, Element target) { } } + private static String getHead(Element e) { + StringBuilder builder = new StringBuilder(); + builder.append('<'); + builder.append(e.getName()); + List atts = e.getAttributes(); + Iterator it = atts.iterator(); + while (it.hasNext()) { + Attribute a = it.next(); + builder.append(' '); + builder.append(a.toString()); + } + builder.append('>'); + return builder.toString(); + } }