Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
ensure that .pot extensions are handled properly in uploaded source f…
Browse files Browse the repository at this point in the history
…iles.
  • Loading branch information
davidmason committed Apr 2, 2014
1 parent d419591 commit cbda6ac
Showing 1 changed file with 6 additions and 5 deletions.
Expand Up @@ -147,7 +147,7 @@ public Response tryValidatedUploadSourceFile(GlobalDocumentId id,
uploadForm));
}

if (uploadForm.getFileType().equals(".pot")) {
if (uploadForm.getFileType().equals("pot")) {
InputStream potStream = getInputStream(tempFile, uploadForm);
parsePotFile(potStream, id, uploadForm);
} else {
Expand Down Expand Up @@ -315,10 +315,11 @@ private void persistRawDocument(HDocument document, File rawFile,

private void parsePotFile(InputStream potStream, GlobalDocumentId id,
DocumentFileUploadForm uploadForm) {
Resource doc;
doc =
translationFileServiceImpl.parseUpdatedPotFile(potStream,
id.getDocId(), uploadForm.getFileType(),
// real upload filename not available, but the service only cares about
// the suffix.
String uploadFileName = "." + uploadForm.getFileType();
Resource doc = translationFileServiceImpl.parseUpdatedPotFile(potStream,
id.getDocId(), uploadFileName,
useOfflinePo(id));
doc.setLang(new LocaleId("en-US"));
// TODO Copy Trans values
Expand Down

0 comments on commit cbda6ac

Please sign in to comment.