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

Commit

Permalink
prevent use of gettext extensions for non-po translation file upload
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmason committed Sep 18, 2012
1 parent 19dd3d5 commit 8e50bba
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -158,9 +158,18 @@ public String uploadTranslationFile()
translationFileUpload.getFileName(), localeId);

// translate it
Set<String> extensions;
if( translationFileUpload.getFileName().endsWith(".po") )
{
extensions = new StringSet(ExtensionType.GetText.toString());
}
else
{
extensions = Collections.<String>emptySet();
}
List<String> warnings =
translationServiceImpl.translateAllInDoc(projectSlug, iterationSlug, translationFileUpload.getDocId(),
new LocaleId(localeId), transRes, new StringSet(ExtensionType.GetText.toString()),
new LocaleId(localeId), transRes, extensions,
translationFileUpload.getMergeTranslations() ? MergeType.AUTO : MergeType.IMPORT);

StringBuilder facesInfoMssg = new StringBuilder("File {0} uploaded.");
Expand Down

0 comments on commit 8e50bba

Please sign in to comment.