fix bugs in language handling
This commit is contained in:
parent
9b9e50e0be
commit
8c412d78ef
|
@ -118,6 +118,10 @@ public class PoGetTextProducer extends LanguageFileProducer {
|
|||
}
|
||||
} else if (s.startsWith("#:")) {
|
||||
tu = new TranslationUnit(lang, s.substring(2).trim(), null, null, null);
|
||||
} else if (s.startsWith("#.")) {
|
||||
if (tu != null) {
|
||||
tu.setContext(s.substring(2).trim());
|
||||
}
|
||||
} else {
|
||||
throw new IOException("Encountered unexpected line '"+s+"'");
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ public class XLIFFProducer extends LanguageFileProducer {
|
|||
Element body = XMLUtil.getNamedChild(file, "body");
|
||||
for (Element transUnit : XMLUtil.getNamedChildren(body, "trans-unit")) {
|
||||
Element notes = XMLUtil.getNamedChild(transUnit, "notes");
|
||||
TranslationUnit tu = new TranslationUnit(file.getAttribute("target-language"), transUnit.getAttribute("id"),
|
||||
TranslationUnit tu = new TranslationUnit(file.getAttribute("target-language"), transUnit.getAttribute("resname"),
|
||||
notes == null ? null : XMLUtil.getNamedChildText(notes, "note"),
|
||||
XMLUtil.getNamedChildText(transUnit, "source"), XMLUtil.getNamedChildText(transUnit, "target"));
|
||||
if (!Utilities.noString(tu.getSrcText()) && !Utilities.noString(tu.getTgtText())) {
|
||||
|
|
Loading…
Reference in New Issue