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

Commit

Permalink
rename 'source' options to 'src' for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Jun 24, 2011
1 parent c44d75b commit 294ec94
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 19 deletions.
Expand Up @@ -139,7 +139,7 @@ public void visitTranslationResources(String docName, Resource srcDoc, Translati
{
InputSource inputSource = new InputSource(bis);
inputSource.setEncoding("utf8");
TranslationsResource targetDoc = poReader.extractTarget(inputSource, srcDoc, opts.getUseSourceOrder());
TranslationsResource targetDoc = poReader.extractTarget(inputSource, srcDoc, opts.getUseSrcOrder());
callback.visit(locale, targetDoc);
}
finally
Expand Down
Expand Up @@ -139,7 +139,7 @@ private TranslationsResource loadTranslationsResource(Resource srcDoc, File tran
// TODO consider using PropReader
TranslationsResource targetDoc = new TranslationsResource();
Properties props = loadPropFile(transFile);
if (opts.getUseSourceOrder())
if (opts.getUseSrcOrder())
{
for (TextFlow tf : srcDoc.getTextFlows())
{
Expand Down Expand Up @@ -194,7 +194,7 @@ public void visitTranslationResources(String docName, Resource srcDoc, Translati
File transFile = new File(opts.getTransDir(), filename);
if (transFile.exists())
{
TranslationsResource targetDoc = loadTranslationsResource(srcDoc, transFile, opts.getUseSourceOrder());
TranslationsResource targetDoc = loadTranslationsResource(srcDoc, transFile, opts.getUseSrcOrder());
callback.visit(locale, targetDoc);
}
else
Expand Down
Expand Up @@ -99,7 +99,7 @@ public void run() throws Exception
log.info("Source language: {}", opts.getSourceLang());
log.info("Copy previous translations: {}", opts.getCopyTrans());
log.info("Merge type: {}", opts.getMergeType());
log.info("Source Pattern: {}", opts.getSourcePattern());
log.info("Source file pattern: {}", opts.getSrcFilePattern());

if (opts.getPushTrans())
{
Expand Down
Expand Up @@ -12,8 +12,8 @@ public interface PushOptions extends ConfigurableProjectOptions
public String getProjectType();
public boolean getPushTrans();
public boolean getCopyTrans();
public boolean getUseSourceOrder();
public boolean getUseSrcOrder();
public String getMergeType();
public String getSourcePattern();
public String getSrcFilePattern();
}

Expand Up @@ -55,7 +55,7 @@ public Set<String> findDocNames(File srcDir) throws IOException
sourceFiles = new HashSet<String>();
Set<String> localDocNames = new HashSet<String>();

srcPatternFilter = new WildcardFileFilter(opts.getSourcePattern());
srcPatternFilter = new WildcardFileFilter(opts.getSrcFilePattern());
targetFileFilter = new TargetFileFilter(opts.getLocales(), XML_EXTENSION);
srcFileFilter = new AndFileFilter(srcPatternFilter, targetFileFilter);

Expand Down
Expand Up @@ -56,7 +56,7 @@ public void findDocNamesTest() throws IOException
XliffStrategy xliffStrategy = new XliffStrategy();

mockPushOption = createMock("mockPushOption", PushOptions.class);
EasyMock.expect(mockPushOption.getSourcePattern()).andReturn("*StringResource_en_US*");
EasyMock.expect(mockPushOption.getSrcFilePattern()).andReturn("*StringResource_en_US*");
EasyMock.expect(mockPushOption.getLocales()).andReturn(locales).anyTimes();
EasyMock.expect(mockPushOption.getSourceLang()).andReturn("en-US").anyTimes();

Expand All @@ -77,7 +77,7 @@ public void loadSrcDocTest() throws IOException
XliffStrategy xliffStrategy = new XliffStrategy();

mockPushOption = createMock("mockPushOption", PushOptions.class);
EasyMock.expect(mockPushOption.getSourcePattern()).andReturn("*StringResource_en_US*");
EasyMock.expect(mockPushOption.getSrcFilePattern()).andReturn("*StringResource_en_US*");
EasyMock.expect(mockPushOption.getTransDir()).andReturn(sourceDir).anyTimes();
EasyMock.expect(mockPushOption.getLocales()).andReturn(locales).anyTimes();
EasyMock.expect(mockPushOption.getSourceLang()).andReturn("en-US").anyTimes();
Expand Down
2 changes: 1 addition & 1 deletion client/zanata-maven-plugin/demo-xliff/pom.xml
Expand Up @@ -17,7 +17,7 @@
<configuration>
<projectType>xliff</projectType>
<srcDir>src</srcDir>
<sourcePattern>StringResource_en_US.xml</sourcePattern>
<srcFilePattern>StringResource_en_US.xml</srcFilePattern>
<transDir>src</transDir>
<!-- for instance
<importPo>false</importPo>
Expand Down
Expand Up @@ -77,9 +77,9 @@ public PushCommand initCommand()
* strings? This is only needed for compatibility with Zanata server below
* v1.4.
*
* @parameter expression="${zanata.useSourceOrder}" default-value="false"
* @parameter expression="${zanata.useSrcOrder}" default-value="false"
*/
private boolean useSourceOrder;
private boolean useSrcOrder;

/**
* Merge type: "auto" (default) or "import" (DANGER!).
Expand All @@ -89,11 +89,12 @@ public PushCommand initCommand()
private String merge;

/**
* Name pattern of source file
* Wildcard pattern for source files. This parameter is only needed for some
* project types, eg XLIFF.
*
* @parameter expression="${zanata.sourcePattern}"
* @parameter expression="${zanata.srcFilePattern}"
*/
private String sourcePattern;
private String srcFilePattern;

@Override
public File getSrcDir()
Expand Down Expand Up @@ -138,15 +139,15 @@ public String getMergeType()
}

@Override
public String getSourcePattern()
public String getSrcFilePattern()
{
return sourcePattern;
return srcFilePattern;
}

@Override
public boolean getUseSourceOrder()
public boolean getUseSrcOrder()
{
return useSourceOrder;
return useSrcOrder;
}

}

0 comments on commit 294ec94

Please sign in to comment.