Skip to content

Commit

Permalink
fixed bug in usx check
Browse files Browse the repository at this point in the history
  • Loading branch information
da1nerd committed Mar 31, 2016
1 parent 2420832 commit e107111
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import com.door43.tools.reporting.Logger;
import com.door43.translationstudio.AppContext;
import com.door43.translationstudio.rendering.USXtoUSFMConverter;
import com.door43.util.FileUtilities;
import com.door43.util.Zip;

Expand All @@ -18,6 +19,7 @@

import java.io.BufferedReader;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
Expand Down Expand Up @@ -268,6 +270,9 @@ public TargetTranslation importDraftTranslation(NativeSpeaker nativeSpeaker, Sou

TargetTranslation t = createTargetTranslation(nativeSpeaker, targetLanguage, draftTranslation.projectSlug, TranslationType.TEXT, resourceSlug, draftTranslation.getFormat());

// convert legacy usx format to usfm
boolean convertToUSFM = draftTranslation.getFormat() == TranslationFormat.USX;

try {
if (t != null) {
// commit local changes to history
Expand All @@ -280,7 +285,8 @@ public TargetTranslation importDraftTranslation(NativeSpeaker nativeSpeaker, Sou
t.applyChapterTitleTranslation(ct, c.title);
t.applyChapterReferenceTranslation(ct, c.reference);
for(Frame f:library.getFrames(draftTranslation, c.getId())) {
t.applyFrameTranslation(t.getFrameTranslation(f), f.body);
String text = convertToUSFM ? USXtoUSFMConverter.doConversion(f.body).toString() : f.body;
t.applyFrameTranslation(t.getFrameTranslation(f), text);
}
}
// TODO: 3/23/2016 also import the front and back matter along with project title
Expand Down

0 comments on commit e107111

Please sign in to comment.