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

Commit

Permalink
Default 'validate' option to CONTENT as in help text (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Apr 15, 2016
1 parent c2a5565 commit 1571e9b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import org.zanata.rest.dto.resource.Resource;
import org.zanata.rest.dto.resource.TranslationsResource;

import javax.annotation.Nonnull;

/**
* Push options for documents that are parsed on the client and transmitted as a
* {@link Resource} or {@link TranslationsResource}.
Expand All @@ -52,6 +54,7 @@ public interface PushOptions extends PushPullOptions {

public ImmutableList<String> getFileTypes();

@Nonnull
public String getValidate();

public boolean isMyTrans();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@

import com.google.common.collect.ImmutableList;
import org.kohsuke.args4j.Option;
import org.zanata.adapter.xliff.XliffCommon;
import org.zanata.client.commands.AbstractPushPullOptionsImpl;
import org.zanata.client.commands.BooleanValueHandler;
import org.zanata.client.commands.PushPullType;
import org.zanata.client.commands.ZanataCommand;
import org.zanata.util.StringUtil;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
* @author Sean Flanigan <a
* href="mailto:[email protected]">[email protected]</a>
Expand Down Expand Up @@ -58,6 +62,7 @@ public class PushOptionsImpl extends AbstractPushPullOptionsImpl<PushOptions>
private String pushType = DEF_PUSH_TYPE;
private String sourceLang = "en-US";

@Nullable
private String validate;
private boolean myTrans = DEF_MY_TRANS;

Expand Down Expand Up @@ -250,7 +255,11 @@ void setExcludeLocaleFilenames(boolean excludeLocaleFilenames) {
}

@Override
@Nonnull
public String getValidate() {
if (validate == null) {
return XliffCommon.ValidationType.CONTENT.name();
}
return validate;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.zanata.client.commands.push.PushOptions;
import org.zanata.client.commands.push.RawPushCommand;

import javax.annotation.Nonnull;

/**
* @author Sean Flanigan <a
* href="mailto:[email protected]">[email protected]</a>
Expand Down Expand Up @@ -211,6 +213,7 @@ public boolean getExcludeLocaleFilenames() {
}

@Override
@Nonnull
public String getValidate() {
return validate;
}
Expand Down

0 comments on commit 1571e9b

Please sign in to comment.