From 9ff1dee640b6473a920d3a760bf3e53dfc621e34 Mon Sep 17 00:00:00 2001 From: Sean Flanigan Date: Mon, 9 Nov 2015 11:20:10 +1000 Subject: [PATCH 1/9] Fix warning "Use of '_' might not be supported..." --- .../client/commands/ConsoleInteractor.java | 6 +-- .../commands/ConsoleInteractorImpl.java | 8 ++-- .../org/zanata/client/commands/Messages.java | 4 +- .../zanata/client/commands/OptionsUtil.java | 11 ++--- .../client/commands/TransFileResolver.java | 4 +- .../zanata/client/commands/UpdateChecker.java | 22 +++++----- .../client/commands/init/InitCommand.java | 44 +++++++++---------- .../commands/init/ProjectConfigHandler.java | 8 ++-- .../commands/init/ProjectIterationPrompt.java | 23 +++++----- .../client/commands/init/ProjectPrompt.java | 29 ++++++------ .../commands/init/SourceConfigPrompt.java | 32 +++++++------- .../commands/init/TransConfigPrompt.java | 10 ++--- .../commands/init/UserConfigHandler.java | 12 ++--- .../client/commands/OptionsUtilTest.java | 10 ++--- .../client/commands/UpdateCheckerTest.java | 6 +-- .../client/commands/init/InitCommandTest.java | 2 +- .../commands/init/UserConfigHandlerTest.java | 7 ++- 17 files changed, 116 insertions(+), 122 deletions(-) diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/ConsoleInteractor.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/ConsoleInteractor.java index 99bb3f71..df18992e 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/ConsoleInteractor.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/ConsoleInteractor.java @@ -22,7 +22,7 @@ import com.google.common.base.Strings; -import static org.zanata.client.commands.Messages._; +import static org.zanata.client.commands.Messages.get; public interface ConsoleInteractor { /** @@ -69,7 +69,7 @@ public boolean isAnswerValid(String answer) { @Override public String invalidErrorMessage(String answer) { - return String.format(_("expected.and.actual.answer"), "y or n", + return String.format(get("expected.and.actual.answer"), "y or n", answer); } }; @@ -81,7 +81,7 @@ public boolean isAnswerValid(String answer) { @Override public String invalidErrorMessage(String answer) { - return _("no.blank.answer"); + return get("no.blank.answer"); } }; static final AnswerValidator ANY = new AnswerValidator() { diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/ConsoleInteractorImpl.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/ConsoleInteractorImpl.java index b37095b3..d19ae4b4 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/ConsoleInteractorImpl.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/ConsoleInteractorImpl.java @@ -33,7 +33,7 @@ import com.google.common.collect.Lists; import static org.zanata.client.commands.StringUtil.indent; -import static org.zanata.client.commands.Messages._; +import static org.zanata.client.commands.Messages.get; /** * @author Patrick Huang translationFileExtension) { FileMappingRule rule = PROJECT_TYPE_FILE_MAPPING_RULES.get(projectType); - checkState(rule != null, _("no.default.mapping"), projectType); + checkState(rule != null, get("no.default.mapping"), projectType); String relativePath = new FileMappingRuleHandler(rule, projectType, opts) .getRelativeTransFilePathForSourceDoc(qualifiedSrcDocName, localeMapping, translationFileExtension); diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/UpdateChecker.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/UpdateChecker.java index aa523f6a..509b7ad8 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/UpdateChecker.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/UpdateChecker.java @@ -21,7 +21,7 @@ package org.zanata.client.commands; import static org.zanata.client.commands.ConsoleInteractorImpl.AnswerValidator; -import static org.zanata.client.commands.Messages._; +import static org.zanata.client.commands.Messages.get; import static org.zanata.util.VersionUtility.getVersionInfo; import java.io.BufferedWriter; @@ -103,8 +103,8 @@ public boolean needToCheckUpdates(boolean interactiveMode) { try { if (!updateMarker.exists()) { createUpdateMarkerFile(updateMarker); - console.printfln(_("update.marker.created"), updateMarker); - console.printfln(_("update.marker.hint")); + console.printfln(get("update.marker.created"), updateMarker); + console.printfln(get("update.marker.hint")); return true; } // read the content and see if we need to check @@ -115,7 +115,7 @@ public boolean needToCheckUpdates(boolean interactiveMode) { boolean timeToCheck = daysPassed.compareTo(frequency.days()) >= 0; boolean noAsking = readNoAsking(props); if (timeToCheck && !noAsking && interactiveMode) { - console.printf(_("check.update.yes.no"), daysPassed.getDays()); + console.printf(get("check.update.yes.no"), daysPassed.getDays()); String check = console.expectAnswerWithRetry( AnswerValidator.YES_NO); if (check.toLowerCase().startsWith("n")) { @@ -159,15 +159,15 @@ private static Properties loadFileToProperties(File updateMarker) { private static void createUpdateMarkerFile(File updateMarker) throws IOException { boolean created = updateMarker.createNewFile(); - Preconditions.checkState(created, _("create.file.failure"), + Preconditions.checkState(created, get("create.file.failure"), updateMarker); String today = DATE_FORMATTER.print(new DateTime()); Properties props = new Properties(); props.setProperty(LAST_CHECKED, today); - props.setComment(FREQUENCY, _("valid.frequency")); + props.setComment(FREQUENCY, get("valid.frequency")); props.setProperty(FREQUENCY, "weekly"); props.setProperty(NO_ASKING, "true"); - props.setComment(NO_ASKING, _("no.check.update.prompt")); + props.setComment(NO_ASKING, get("no.check.update.prompt")); props.store(new BufferedWriter(new FileWriterWithEncoding(updateMarker, Charsets.UTF_8)), null); } @@ -178,9 +178,9 @@ public void checkNewerVersion() { return; } if (latestVersion.get().compareTo(currentVersionNo) > 0) { - console.printfln(_("suggest.update"), latestVersion.get()); + console.printfln(get("suggest.update"), latestVersion.get()); } else { - console.printfln(_("latest.version.confirm")); + console.printfln(get("latest.version.confirm")); } try { Properties props = loadFileToProperties(updateMarker); @@ -220,12 +220,12 @@ private Optional checkLatestVersion(ConsoleInteractor console) { log.debug( "Failed to resolve latest client artifact [status {}]. Ignored", response.getStatus()); - console.printfln(_("check.update.failed")); + console.printfln(get("check.update.failed")); return Optional.absent(); } } catch (Exception e) { log.warn("Exception when checking updates", e); - console.printfln(_("check.update.failed")); + console.printfln(get("check.update.failed")); return Optional.absent(); } // cheap xml parsing diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/InitCommand.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/InitCommand.java index ade6664d..6689c2dd 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/InitCommand.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/InitCommand.java @@ -25,7 +25,7 @@ import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Hint; import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Question; import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Warning; -import static org.zanata.client.commands.Messages._; +import static org.zanata.client.commands.Messages.get; import java.io.File; import java.io.IOException; @@ -142,42 +142,42 @@ protected void ensureServerVersion() { getClientFactory().getServerVersionInfo().getVersionNo(); if (new VersionComparator().compare(serverVersion, "3.4.0") < 0) { - console.printfln(Warning, _("server.incompatible")); - console.printfln(Hint, _("server.incompatible.hint")); - throw new RuntimeException(_("server.incompatible")); + console.printfln(Warning, get("server.incompatible")); + console.printfln(Hint, get("server.incompatible.hint")); + throw new RuntimeException(get("server.incompatible")); } } private void displayAdviceAboutWhatIsNext(boolean hasOldConfig) { - console.printfln(_("what.next")); + console.printfln(get("what.next")); if (hasOldConfig) { - console.printfln(_("compare.project.config"), + console.printfln(get("compare.project.config"), projectConfigHandler.getBackup()); } - console.printfln(_("view.project"), + console.printfln(get("view.project"), getProjectIterationUrl(getOpts().getUrl(), getOpts().getProj(), getOpts().getProjectVersion())); if (isInvokedByMaven()) { - console.printfln(_("mvn.push.source")); - console.printfln(_("mvn.push.both")); - console.printfln(_("mvn.push.trans")); - console.printfln(_("mvn.help")); + console.printfln(get("mvn.push.source")); + console.printfln(get("mvn.push.both")); + console.printfln(get("mvn.push.trans")); + console.printfln(get("mvn.help")); } else { - console.printfln(_("cli.push.source")); - console.printfln(_("cli.push.both")); - console.printfln(_("cli.push.trans")); - console.printfln(_("cli.help")); + console.printfln(get("cli.push.source")); + console.printfln(get("cli.push.both")); + console.printfln(get("cli.push.trans")); + console.printfln(get("cli.help")); } - console.printfln(_("browse.online.help")); + console.printfln(get("browse.online.help")); } private void advancedSettingsReminder() { ConfigurableProjectOptions opts = getOpts(); - console.printfln(Warning, _("customize.languages.warning")); - console.printfln(Hint, _("view.project"), + console.printfln(Warning, get("customize.languages.warning")); + console.printfln(Hint, get("view.project"), getProjectIterationUrl(opts.getUrl(), opts.getProj(), opts.getProjectVersion())); - console.printf(Question, _("continue.yes.no")); + console.printf(Question, get("continue.yes.no")); console.expectYes(); } @@ -191,7 +191,7 @@ private void applyConfigFileSilently() OptionsUtil.applyConfigFiles(opts); logger.setLevel(preLevel); console.printfln( - Confirmation, _("project.version.type.confirmation"), + Confirmation, get("project.version.type.confirmation"), opts.getProjectType(), opts.getProj(), opts .getProjectVersion()); } @@ -209,9 +209,9 @@ private static String getProjectIterationUrl(URL server, String projectSlug, public static void offerRetryOnServerError(Exception e, ConsoleInteractor consoleInteractor) { - consoleInteractor.printfln(Warning, _("server.error"), + consoleInteractor.printfln(Warning, get("server.error"), Throwables.getRootCause(e).getMessage()); - consoleInteractor.printf(Question, _("server.error.try.again")); + consoleInteractor.printf(Question, get("server.error.try.again")); consoleInteractor.expectYes(); } diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/ProjectConfigHandler.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/ProjectConfigHandler.java index 813e46f7..2f6a91a7 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/ProjectConfigHandler.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/ProjectConfigHandler.java @@ -32,7 +32,7 @@ import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Confirmation; import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Question; import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Warning; -import static org.zanata.client.commands.Messages._; +import static org.zanata.client.commands.Messages.get; /** * @author Patrick Huang @@ -59,8 +59,8 @@ protected void handleExistingProjectConfig() throws IOException { File projectConfig = getOpts().getProjectConfig(); if (projectConfig.exists()) { consoleInteractor - .printfln(Warning, _("project.config.exists")) - .printf(Question, _("continue.yes.no")); + .printfln(Warning, get("project.config.exists")) + .printf(Question, get("continue.yes.no")); consoleInteractor.expectYes(); // back up old zanata.xml String suffix = new SimpleDateFormat("yyyy-MM-dd-hh-mm-ss").format( @@ -69,7 +69,7 @@ protected void handleExistingProjectConfig() throws IOException { "zanata.xml." + suffix); FileUtils.moveFile(projectConfig, backup); consoleInteractor - .printfln(Confirmation, _("backup.old.project.config"), backup); + .printfln(Confirmation, get("backup.old.project.config"), backup); clearValuesSetByConfigurableMojo(); } diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/ProjectIterationPrompt.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/ProjectIterationPrompt.java index 2d1e60e9..12eb509f 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/ProjectIterationPrompt.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/ProjectIterationPrompt.java @@ -25,15 +25,13 @@ import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Hint; import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Question; import static org.zanata.client.commands.ConsoleInteractorImpl.AnswerValidatorImpl.expect; -import static org.zanata.client.commands.Messages._; +import static org.zanata.client.commands.Messages.get; import java.util.List; import org.zanata.client.commands.ConsoleInteractor; import org.zanata.client.commands.ConsoleInteractorImpl; import org.zanata.common.EntityStatus; -import org.zanata.rest.client.ProjectClient; -import org.zanata.rest.client.ProjectIterationClient; import org.zanata.rest.client.RestClientFactory; import org.zanata.rest.dto.Project; import org.zanata.rest.dto.ProjectIteration; @@ -41,7 +39,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Joiner; import com.google.common.base.Predicate; -import com.google.common.base.Strings; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.sun.jersey.api.client.UniformInterfaceException; @@ -63,12 +60,12 @@ class ProjectIterationPrompt { } public void selectOrCreateNewVersion() { - consoleInteractor.printfln(_("do.you.want.to")); + consoleInteractor.printfln(get("do.you.want.to")); consoleInteractor.printf("1)") - .printfln(Hint, _("project.version.select")); + .printfln(Hint, get("project.version.select")); consoleInteractor.printf("2)") - .printfln(Hint, _("project.version.create")); - consoleInteractor.printf(Question, _("select.or.create")); + .printfln(Hint, get("project.version.create")); + consoleInteractor.printf(Question, get("select.or.create")); String answer = consoleInteractor.expectAnswerWithRetry( expect("1", "2")); if (answer.equals("1")) { @@ -81,7 +78,7 @@ public void selectOrCreateNewVersion() { @VisibleForTesting protected void selectVersion() { Project project = clientFactory.getProjectClient(opts.getProj()).get(); - consoleInteractor.printfln(_("available.versions"), project.getName()); + consoleInteractor.printfln(get("available.versions"), project.getName()); int oneBasedIndex = 1; List versionIndexes = Lists.newArrayList(); Iterable activeIterations = Iterables @@ -94,7 +91,7 @@ protected void selectVersion() { .printfln(Hint, iteration.getId()); oneBasedIndex++; } - consoleInteractor.printf(Question, _("select.version.prompt")); + consoleInteractor.printf(Question, get("select.version.prompt")); String selection = consoleInteractor.expectAnswerWithRetry(expect(versionIndexes)); ProjectIteration projectIteration = Iterables.get(activeIterations, @@ -113,7 +110,7 @@ private String resolveProjectType(Project project, } else { String projectTypes = Joiner.on(", ").join(ProjectPrompt.PROJECT_TYPE_LIST); - consoleInteractor.printfln(Question, _("project.type.prompt"), + consoleInteractor.printfln(Question, get("project.type.prompt"), projectTypes); return consoleInteractor.expectAnswerWithRetry( ConsoleInteractorImpl.AnswerValidatorImpl @@ -123,7 +120,7 @@ private String resolveProjectType(Project project, @VisibleForTesting protected void createNewVersion() { - consoleInteractor.printfln(Question, _("project.version.id.prompt")); + consoleInteractor.printfln(Question, get("project.version.id.prompt")); String versionId = consoleInteractor.expectAnyAnswer(); ProjectIteration iteration = new ProjectIteration(versionId); iteration.setProjectType(opts.getProjectType()); @@ -135,7 +132,7 @@ protected void createNewVersion() { createNewVersion(); } opts.setProjectVersion(versionId); - consoleInteractor.printfln(Confirmation, _("project.version.created")); + consoleInteractor.printfln(Confirmation, get("project.version.created")); } diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/ProjectPrompt.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/ProjectPrompt.java index dbe9273a..97d499eb 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/ProjectPrompt.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/ProjectPrompt.java @@ -24,7 +24,7 @@ import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Hint; import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Question; import static org.zanata.client.commands.ConsoleInteractorImpl.AnswerValidatorImpl; -import static org.zanata.client.commands.Messages._; +import static org.zanata.client.commands.Messages.get; import java.util.Collections; import java.util.List; @@ -33,7 +33,6 @@ import org.zanata.common.EntityStatus; import org.zanata.common.ProjectType; import org.zanata.rest.client.ProjectClient; -import org.zanata.rest.client.ProjectsClient; import org.zanata.rest.client.RestClientFactory; import org.zanata.rest.dto.Project; @@ -78,10 +77,10 @@ class ProjectPrompt { * If creating, also ask for Project type. */ public void selectOrCreateNewProjectAndVersion() { - consoleInteractor.printfln(_("do.you.want.to")); - consoleInteractor.printf("1)").printfln(Hint, _("project.select")); - consoleInteractor.printf("2)").printfln(Hint, _("project.create")); - consoleInteractor.printf(Question, _("select.or.create")); + consoleInteractor.printfln(get("do.you.want.to")); + consoleInteractor.printf("1)").printfln(Hint, get("project.select")); + consoleInteractor.printf("2)").printfln(Hint, get("project.create")); + consoleInteractor.printf(Question, get("select.or.create")); String answer = consoleInteractor.expectAnswerWithRetry( AnswerValidatorImpl.expect("1", "2")); if (answer.equals("1")) { @@ -94,9 +93,9 @@ public void selectOrCreateNewProjectAndVersion() { @VisibleForTesting protected void selectProject() { ensureActiveProjects(); - consoleInteractor.printfln(_("available.projects")); + consoleInteractor.printfln(get("available.projects")); listFilteredProjectsPrefixedByNumber(); - consoleInteractor.printf(Question, _("select.project.prompt")); + consoleInteractor.printf(Question, get("select.project.prompt")); String selection = consoleInteractor.expectAnyAnswer(); if (selectionIsFilter(selection, filteredProjects)) { @@ -109,7 +108,7 @@ protected void selectProject() { opts.setProj(projectId); // TODO server returns Upper case project type!!! opts.setProjectType(project.getDefaultType().toLowerCase()); - consoleInteractor.printfln(Confirmation, _("project.confirmation"), + consoleInteractor.printfln(Confirmation, get("project.confirmation"), opts.getProj()); projectIterationPrompt.selectOrCreateNewVersion(); } @@ -187,14 +186,14 @@ protected void setAllProjectsAndFilteredProjects(List allProjects, @VisibleForTesting protected void createNewProject() { - consoleInteractor.printfln(_("create.project.help")); - consoleInteractor.printfln(Hint, _("project.id.constraint")); - consoleInteractor.printfln(Question, _("project.id.prompt")); + consoleInteractor.printfln(get("create.project.help")); + consoleInteractor.printfln(Hint, get("project.id.constraint")); + consoleInteractor.printfln(Question, get("project.id.prompt")); String projectId = consoleInteractor.expectAnyAnswer(); - consoleInteractor.printfln(Question, _("project.name.prompt")); + consoleInteractor.printfln(Question, get("project.name.prompt")); String projectName = consoleInteractor.expectAnyAnswer(); String projectTypes = Joiner.on(", ").join(PROJECT_TYPE_LIST); - consoleInteractor.printfln(Question, _("project.type.prompt"), projectTypes); + consoleInteractor.printfln(Question, get("project.type.prompt"), projectTypes); String projectType = consoleInteractor.expectAnswerWithRetry( AnswerValidatorImpl.expect(PROJECT_TYPE_LIST)); @@ -208,7 +207,7 @@ protected void createNewProject() { createNewProject(); } } - consoleInteractor.printfln(Confirmation, _("project.created")); + consoleInteractor.printfln(Confirmation, get("project.created")); opts.setProj(projectId); opts.setProjectType(projectType); projectIterationPrompt.createNewVersion(); diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/SourceConfigPrompt.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/SourceConfigPrompt.java index 0df88386..8e65671e 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/SourceConfigPrompt.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/SourceConfigPrompt.java @@ -36,8 +36,6 @@ import org.zanata.client.commands.push.PushCommand; import org.zanata.client.commands.push.PushOptions; import org.zanata.client.commands.push.PushOptionsImpl; -import org.zanata.rest.client.AsyncProcessClient; -import org.zanata.rest.client.CopyTransClient; import org.zanata.rest.client.RestClientFactory; import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Hint; @@ -45,7 +43,7 @@ import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Warning; import static org.zanata.client.commands.StringUtil.indent; import static org.zanata.client.commands.ConsoleInteractorImpl.AnswerValidatorImpl.*; -import static org.zanata.client.commands.Messages._; +import static org.zanata.client.commands.Messages.get; /** * Prompt for src dir. @@ -95,25 +93,25 @@ public SourceConfigPrompt( } SourceConfigPrompt promptUser() throws Exception { - console.printf(Question, _("src.dir.prompt")); + console.printf(Question, get("src.dir.prompt")); String localSrcDir = console.expectAnyNotBlankAnswer(); File srcDir = new File(localSrcDir); if (!srcDir.exists()) { - console.printfln(Warning, _("src.dir.not.exist"), + console.printfln(Warning, get("src.dir.not.exist"), localSrcDir); return new SourceConfigPrompt(console, opts).promptUser(); } console.blankLine(); - console.printfln(Hint, _("includes.question")); - console.printfln(_("includes.usage.1")); - console.printfln(_("includes.usage.2")); - console.printfln(_("includes.usage.3")); - console.printf(Question, _("includes.prompt")); + console.printfln(Hint, get("includes.question")); + console.printfln(get("includes.usage.1")); + console.printfln(get("includes.usage.2")); + console.printfln(get("includes.usage.3")); + console.printf(Question, get("includes.prompt")); includes = console.expectAnyAnswer(); console.blankLine(); - console.printfln(Hint, _("excludes.question")); - console.printfln(_("excludes.usage")); - console.printf(Question, _("excludes.prompt")); + console.printfln(Hint, get("excludes.question")); + console.printfln(get("excludes.usage")); + console.printf(Question, get("excludes.prompt")); excludes = console.expectAnyAnswer(); pushOptions.setSrcDir(srcDir); @@ -122,14 +120,14 @@ SourceConfigPrompt promptUser() throws Exception { console.blankLine(); docNames = findDocNames(); if (docNames.isEmpty()) { - console.printfln(_("no.source.doc.found")); + console.printfln(get("no.source.doc.found")); } else { - console.printfln(_("found.source.docs")); + console.printfln(get("found.source.docs")); for (String docName : docNames) { console.printfln("%s%s", indent(8), docName); } } - console.printf(Question, _("source.doc.confirm.yes.no")); + console.printf(Question, get("source.doc.confirm.yes.no")); String answer = console.expectAnswerWithRetry(YES_NO); if (answer.toLowerCase().startsWith("n")) { hintAdvancedConfigurations(); @@ -152,7 +150,7 @@ private Set findDocNames() throws IOException { } private void hintAdvancedConfigurations() { - console.printfln(Hint, _("more.src.options.hint")); + console.printfln(Hint, get("more.src.options.hint")); console.printfln(Hint, " - %s", getUsageFromOptionAnnotation(PushOptionsImpl.class, diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/TransConfigPrompt.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/TransConfigPrompt.java index 8534d67b..ac32b48d 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/TransConfigPrompt.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/TransConfigPrompt.java @@ -40,7 +40,7 @@ import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Question; import static org.zanata.client.commands.StringUtil.indent; import static org.zanata.client.commands.ConsoleInteractorImpl.AnswerValidatorImpl.*; -import static org.zanata.client.commands.Messages._; +import static org.zanata.client.commands.Messages.get; /** * Prompt for trans dir, @@ -81,7 +81,7 @@ public TransConfigPrompt(ConsoleInteractor console, } TransConfigPrompt promptUser() throws Exception { - console.printf(Question, _("trans.dir.prompt")); + console.printf(Question, get("trans.dir.prompt")); String localTransDir = console.expectAnyNotBlankAnswer(); File transDir = new File(localTransDir); pullOptions.setTransDir(transDir); @@ -92,14 +92,14 @@ TransConfigPrompt promptUser() throws Exception { Iterable transFiles = Iterables.transform(srcFilesSample, new ToTransFileNameFunction(strategy, localeMapping)); - console.printfln(Hint, _("trans.doc.preview"), localeMapping.getLocale()); + console.printfln(Hint, get("trans.doc.preview"), localeMapping.getLocale()); for (String transFile : transFiles) { console.printfln("%s%s", indent(8), transFile); } if (remainingFileNumber > 0) { - console.printfln(_("remaining.files"), remainingFileNumber); + console.printfln(get("remaining.files"), remainingFileNumber); } - console.printf(Question, _("trans.dir.confirm.yes.no")); + console.printf(Question, get("trans.dir.confirm.yes.no")); String answer = console.expectAnswerWithRetry(YES_NO); if (answer.toLowerCase().startsWith("n")) { return new TransConfigPrompt(console, opts, srcFilesSample) diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/UserConfigHandler.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/UserConfigHandler.java index 75d2046c..5b3d515b 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/UserConfigHandler.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/UserConfigHandler.java @@ -38,7 +38,7 @@ import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.*; import static org.zanata.client.commands.ConsoleInteractorImpl.AnswerValidatorImpl.*; -import static org.zanata.client.commands.Messages._; +import static org.zanata.client.commands.Messages.get; /** * @author Patrick Huang @@ -64,7 +64,7 @@ public UserConfigHandler(ConsoleInteractor consoleInteractor, InitOptions opts) protected void verifyUserConfig() throws Exception { File userConfig = opts.getUserConfig(); if (!userConfig.exists()) { - String msg = _("missing.user.config"); + String msg = get("missing.user.config"); log.warn(msg); throw new RuntimeException(msg); } @@ -76,20 +76,20 @@ protected void verifyUserConfig() throws Exception { // apply user config if (serverUrls.isEmpty()) { - String msg = _("missing.server.url"); + String msg = get("missing.server.url"); log.warn(msg); throw new RuntimeException(msg); } if (serverUrls.size() == 1) { opts.setUrl(serverUrls.get(0)); } else { - consoleInteractor.printfln(_("found.servers"), opts.getUserConfig().getName()); + consoleInteractor.printfln(get("found.servers"), opts.getUserConfig().getName()); List answers = listServerUrlsPrefixedWithNumber(serverUrls); - consoleInteractor.printf(Question, _("which.server")); + consoleInteractor.printf(Question, get("which.server")); String chosenNumber = consoleInteractor.expectAnswerWithRetry(expect(answers)); URL url = serverUrls.get(Integer.parseInt(chosenNumber) - 1); - consoleInteractor.printfln(Confirmation, _("server.selection"), url); + consoleInteractor.printfln(Confirmation, get("server.selection"), url); opts.setUrl(url); } OptionsUtil.applyUserConfig(opts, config); diff --git a/zanata-client-commands/src/test/java/org/zanata/client/commands/OptionsUtilTest.java b/zanata-client-commands/src/test/java/org/zanata/client/commands/OptionsUtilTest.java index 7b90eac8..681445d4 100644 --- a/zanata-client-commands/src/test/java/org/zanata/client/commands/OptionsUtilTest.java +++ b/zanata-client-commands/src/test/java/org/zanata/client/commands/OptionsUtilTest.java @@ -5,7 +5,7 @@ import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Question; import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Warning; import static org.zanata.client.commands.FileMappingRuleHandler.Placeholders.allHolders; -import static org.zanata.client.commands.Messages._; +import static org.zanata.client.commands.Messages.get; import java.io.File; @@ -108,7 +108,7 @@ public void willWarnUserIfRuleSeemsWrong() { opts.setFileMappingRules(Lists.newArrayList(new FileMappingRule(rule))); OptionsUtil.checkPotentialMistakesInRules(opts, console); - verify(console).printfln(Warning, _("unrecognized.variables"), + verify(console).printfln(Warning, get("unrecognized.variables"), allHolders(), rule); } @@ -119,9 +119,9 @@ public void willAskUserToConfirmIfRuleSeemsWrongAndInInteractiveMode() { opts.setFileMappingRules(Lists.newArrayList(new FileMappingRule(rule))); OptionsUtil.checkPotentialMistakesInRules(opts, console); - verify(console).printfln(Warning, _("unrecognized.variables"), + verify(console).printfln(Warning, get("unrecognized.variables"), allHolders(), rule); - verify(console).printfln(Question, _("confirm.rule")); + verify(console).printfln(Question, get("confirm.rule")); } @Test @@ -132,6 +132,6 @@ public void willThrowExceptionIfRuleIsInvalid() { OptionsUtil.checkPotentialMistakesInRules(opts, console); - verify(console).printfln(Warning, _("invalid.rule"), rule); + verify(console).printfln(Warning, get("invalid.rule"), rule); } } diff --git a/zanata-client-commands/src/test/java/org/zanata/client/commands/UpdateCheckerTest.java b/zanata-client-commands/src/test/java/org/zanata/client/commands/UpdateCheckerTest.java index 2ea36f3b..16d67c03 100644 --- a/zanata-client-commands/src/test/java/org/zanata/client/commands/UpdateCheckerTest.java +++ b/zanata-client-commands/src/test/java/org/zanata/client/commands/UpdateCheckerTest.java @@ -33,7 +33,7 @@ import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.zanata.client.commands.Messages._; +import static org.zanata.client.commands.Messages.get; public class UpdateCheckerTest { private final DateTimeFormatter dateFormat = @@ -85,7 +85,7 @@ public void noMarkerFileYetWillCreateFileAndCheckUpdate() throws Exception { assertThat(properties.getProperty("frequency"), Matchers.equalTo( "weekly")); assertThat(properties.getComment("frequency"), Matchers.equalTo( - _("valid.frequency"))); + get("valid.frequency"))); } @Test public void willNotCheckIfUserSaysNo() throws Exception { @@ -159,7 +159,7 @@ public void canCheckForUpdates() throws Exception { checker = new UpdateChecker(url, marker, mockConsole, currentVersion); checker.checkNewerVersion(); - String expectedString = Messages._("suggest.update"); + String expectedString = Messages.get("suggest.update"); verify(mockConsole, atLeastOnce()).printfln( outputStringCaptor.capture(), outputArgsCaptor.capture()); diff --git a/zanata-client-commands/src/test/java/org/zanata/client/commands/init/InitCommandTest.java b/zanata-client-commands/src/test/java/org/zanata/client/commands/init/InitCommandTest.java index 3c868406..6fe2be82 100644 --- a/zanata-client-commands/src/test/java/org/zanata/client/commands/init/InitCommandTest.java +++ b/zanata-client-commands/src/test/java/org/zanata/client/commands/init/InitCommandTest.java @@ -100,7 +100,7 @@ public void willQuitIfServerApiVersionDoesNotSupportInit() throws Exception { expectException.expect(RuntimeException.class); expectException.expectMessage(Matchers.equalTo(Messages - ._("server.incompatible"))); + .get("server.incompatible"))); when(clientFactory.getServerVersionInfo()).thenReturn( new VersionInfo("3.3.1", "unknown", "unknown")); diff --git a/zanata-client-commands/src/test/java/org/zanata/client/commands/init/UserConfigHandlerTest.java b/zanata-client-commands/src/test/java/org/zanata/client/commands/init/UserConfigHandlerTest.java index 19b49e0c..069bec21 100644 --- a/zanata-client-commands/src/test/java/org/zanata/client/commands/init/UserConfigHandlerTest.java +++ b/zanata-client-commands/src/test/java/org/zanata/client/commands/init/UserConfigHandlerTest.java @@ -13,14 +13,13 @@ import org.junit.rules.TemporaryFolder; import org.mockito.Mockito; import org.zanata.client.commands.ConsoleInteractor; -import org.zanata.client.commands.Messages; import org.zanata.client.commands.MockConsoleInteractor; import com.google.common.base.Charsets; import com.google.common.io.Files; import static org.hamcrest.MatcherAssert.assertThat; -import static org.zanata.client.commands.Messages._; +import static org.zanata.client.commands.Messages.get; public class UserConfigHandlerTest { @Rule @@ -58,7 +57,7 @@ private void ensureUserConfigExistsWithOneServer() throws IOException { @Test public void exitWhenThereIsNoUserConfig() throws Exception { expectException.expect(RuntimeException.class); - expectException.expectMessage(_("missing.user.config")); + expectException.expectMessage(get("missing.user.config")); opts.setUserConfig(new File("/planet/Mars/zanata.ini")); handler.verifyUserConfig(); @@ -67,7 +66,7 @@ public void exitWhenThereIsNoUserConfig() throws Exception { @Test public void willExitWhenThereIsNoServerUrlInFile() throws Exception { expectException.expect(RuntimeException.class); - expectException.expectMessage(_("missing.server.url")); + expectException.expectMessage(get("missing.server.url")); // wipe contents in the file BufferedWriter writer = From 37d039760c1f782010195df42a92380605267834 Mon Sep 17 00:00:00 2001 From: "Ian Y. Choi" Date: Sat, 30 Jan 2016 01:37:17 +0900 Subject: [PATCH 2/9] docs(index): fix github link error --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index ab1584f9..b7297711 100644 --- a/docs/index.md +++ b/docs/index.md @@ -29,7 +29,7 @@ Contribute ---------- - [Issue Tracker](https://zanata.atlassian.net) -- [Source Code on GitHub](http://github.com/zanata-client) +- [Source Code on GitHub](http://github.com/zanata/zanata-client) Release notes ------- From 6217cdb558c23881bfcd76412b72f93ba84345f2 Mon Sep 17 00:00:00 2001 From: Patrick Huang Date: Wed, 24 Feb 2016 14:04:48 +1000 Subject: [PATCH 3/9] ZNTA-930 - zanata init can handle file type project --- .../commands/init/SourceConfigPrompt.java | 143 ++++++++++++++++-- .../commands/init/TransConfigPrompt.java | 79 ++++++++-- .../client/commands/push/PushOptionsImpl.java | 2 +- .../client/commands/push/RawPushCommand.java | 5 +- .../src/main/resources/prompts.properties | 2 + .../commands/init/SourceConfigPromptTest.java | 75 ++++++--- .../commands/init/TransConfigPromptTest.java | 25 +++ 7 files changed, 282 insertions(+), 49 deletions(-) diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/SourceConfigPrompt.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/SourceConfigPrompt.java index 8e65671e..eae66530 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/SourceConfigPrompt.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/SourceConfigPrompt.java @@ -23,6 +23,8 @@ import java.io.File; import java.io.IOException; import java.lang.reflect.InvocationTargetException; +import java.util.List; +import java.util.Map; import java.util.Set; import org.kohsuke.args4j.Option; @@ -36,13 +38,23 @@ import org.zanata.client.commands.push.PushCommand; import org.zanata.client.commands.push.PushOptions; import org.zanata.client.commands.push.PushOptionsImpl; +import org.zanata.client.commands.push.RawPushCommand; +import org.zanata.client.commands.push.RawPushStrategy; +import org.zanata.common.DocumentType; +import org.zanata.rest.client.FileResourceClient; import org.zanata.rest.client.RestClientFactory; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Throwables; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; + import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Hint; import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Question; import static org.zanata.client.commands.ConsoleInteractor.DisplayMode.Warning; import static org.zanata.client.commands.StringUtil.indent; import static org.zanata.client.commands.ConsoleInteractorImpl.AnswerValidatorImpl.*; +import static org.zanata.common.ProjectType.File; import static org.zanata.client.commands.Messages.get; /** @@ -60,13 +72,15 @@ class SourceConfigPrompt { private final ConsoleInteractor console; private final ConfigurableProjectOptions opts; private final PushOptions pushOptions; + private final SrcDocsFinder + srcDocsFinder; // includes and excludes in ConfigurableProjectOptions do not have symmetric // setter/getter (set method accepts String but get method returns // ImmutableList) therefore we have to keep instance variables here private String includes; private String excludes; - private PushCommand pushCommand; private Set docNames; + private List rawDocumentTypes; public SourceConfigPrompt( ConsoleInteractor console, @@ -83,13 +97,7 @@ public SourceConfigPrompt( pushOptions.setKey(opts.getKey()); pushOptions.setLocaleMapList(opts.getLocaleMapList()); - RestClientFactory clientFactory = - OptionsUtil.createClientFactoryWithoutVersionCheck(pushOptions); - pushCommand = - new PushCommand(pushOptions, - clientFactory.getCopyTransClient(), - clientFactory.getAsyncProcessClient(), - clientFactory); + srcDocsFinder = makeSrcDocFinder(); } SourceConfigPrompt promptUser() throws Exception { @@ -117,6 +125,24 @@ SourceConfigPrompt promptUser() throws Exception { pushOptions.setSrcDir(srcDir); pushOptions.setIncludes(includes); pushOptions.setExcludes(excludes); + + + // if project type is file, we need to ask file type in order to find source documents + if (File.name().equalsIgnoreCase(pushOptions.getProjectType())) { + + console.blankLine(); + console.printfln(Question, get("project.file.type.question")); + RestClientFactory clientFactory = getClientFactory(pushOptions); + FileResourceClient client = + clientFactory.getFileResourceClient(); + rawDocumentTypes = client.acceptedFileTypes(); + // this answer is not persisted in zanata.xml so user will still need to type it when they do the actual push + console.printfln(Hint, PushOptionsImpl.fileTypeHelp); + console.printf(Question, get("file.type.prompt")); + String answer = console.expectAnyNotBlankAnswer(); + ((PushOptionsImpl) pushOptions).setFileTypes(answer); + } + console.blankLine(); docNames = findDocNames(); if (docNames.isEmpty()) { @@ -140,13 +166,14 @@ SourceConfigPrompt promptUser() throws Exception { return this; } + @VisibleForTesting + protected RestClientFactory getClientFactory(PushOptions pushOptions) { + return OptionsUtil + .createClientFactoryWithoutVersionCheck(pushOptions); + } + private Set findDocNames() throws IOException { - AbstractPushStrategy strategy = pushCommand.getStrategy(pushOptions); - return strategy.findDocNames(pushOptions.getSrcDir(), - pushOptions.getIncludes(), pushOptions.getExcludes(), - pushOptions.getDefaultExcludes(), - pushOptions.getCaseSensitive(), - pushOptions.getExcludeLocaleFilenames()); + return srcDocsFinder.findSrcDocNames(); } private void hintAdvancedConfigurations() { @@ -191,4 +218,92 @@ public String getExcludes() { public Set getDocNames() { return docNames; } + + private SrcDocsFinder makeSrcDocFinder() { + String projectType = pushOptions.getProjectType(); + if (projectType.equalsIgnoreCase(File.name())) { + return new RawSrcDocsFinder(pushOptions); + } else { + return new OtherSrcDocsFinder(pushOptions); + } + } + + interface SrcDocsFinder { + Set findSrcDocNames(); + } + + class RawSrcDocsFinder implements SrcDocsFinder { + + private final RawPushStrategy strategy; + + RawSrcDocsFinder(PushOptions pushOptions) { + strategy = new RawPushStrategy(); + strategy.setPushOptions(pushOptions); + } + + @Override + public Set findSrcDocNames() { + PushOptions opts = strategy.getOpts(); + ImmutableList extensions = filteredFileExtensions(opts); + return ImmutableSet.copyOf(strategy.getSrcFiles( + opts.getSrcDir(), opts.getIncludes(), + opts.getExcludes(), extensions, + opts.getDefaultExcludes(), + opts.getCaseSensitive())); + } + + private ImmutableList filteredFileExtensions(PushOptions opts) { + // mostly duplicated in RawPushCommand + RestClientFactory clientFactory = getClientFactory(opts); + RawPushCommand rawPushCommand = + new RawPushCommand(opts, clientFactory, console); + Map> filteredDocTypes = + rawPushCommand.validateFileTypes(rawDocumentTypes, + opts.getFileTypes()); + + if (filteredDocTypes.isEmpty()) { + log.info("no valid types specified; nothing to do"); + return ImmutableList.of(); + } + + ImmutableList.Builder sourceFileExtensionsBuilder = + ImmutableList.builder(); + for (Set filteredSourceExtensions : filteredDocTypes + .values()) { + sourceFileExtensionsBuilder.addAll(filteredSourceExtensions); + } + return sourceFileExtensionsBuilder.build(); + } + } + + class OtherSrcDocsFinder implements SrcDocsFinder { + private final AbstractPushStrategy strategy; + private PushOptions opts; + + OtherSrcDocsFinder(PushOptions pushOptions) { + opts = pushOptions; + RestClientFactory clientFactory = getClientFactory(pushOptions); + PushCommand pushCommand = + new PushCommand(pushOptions, + clientFactory.getCopyTransClient(), + clientFactory.getAsyncProcessClient(), + clientFactory); + strategy = pushCommand.getStrategy(pushOptions); + } + + @Override + public Set findSrcDocNames() { + try { + return strategy + .findDocNames(opts.getSrcDir(), opts.getIncludes(), + opts.getExcludes(), + opts.getDefaultExcludes(), + opts.getCaseSensitive(), + opts.getExcludeLocaleFilenames()); + } catch (IOException e) { + throw Throwables.propagate(e); + } + } + } } + diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/TransConfigPrompt.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/TransConfigPrompt.java index ac32b48d..f38c96a5 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/TransConfigPrompt.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/TransConfigPrompt.java @@ -23,16 +23,20 @@ import java.io.File; import java.util.Set; +import org.apache.commons.io.FilenameUtils; import org.zanata.client.commands.ConfigurableProjectOptions; import org.zanata.client.commands.ConsoleInteractor; import org.zanata.client.commands.OptionsUtil; -import org.zanata.client.commands.pull.PullCommand; +import org.zanata.client.commands.QualifiedSrcDocName; +import org.zanata.client.commands.TransFileResolver; +import org.zanata.client.commands.UnqualifiedSrcDocName; +import org.zanata.client.commands.pull.PullOptions; import org.zanata.client.commands.pull.PullOptionsImpl; -import org.zanata.client.commands.pull.PullStrategy; import org.zanata.client.config.LocaleList; import org.zanata.client.config.LocaleMapping; -import org.zanata.rest.client.RestClientFactory; +import org.zanata.common.ProjectType; import com.google.common.base.Function; +import com.google.common.base.Optional; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; @@ -55,7 +59,8 @@ class TransConfigPrompt { private final ConfigurableProjectOptions opts; private final Set srcFilesSample; private final PullOptionsImpl pullOptions; - private final PullCommand pullCommand; + private final TransFilePathFinder + transFilePathFinder; private int remainingFileNumber; public TransConfigPrompt(ConsoleInteractor console, @@ -74,10 +79,7 @@ public TransConfigPrompt(ConsoleInteractor console, pullOptions.setProjectType(opts.getProjectType()); pullOptions.setLocaleMapList(opts.getLocaleMapList()); - RestClientFactory clientFactory = - OptionsUtil.createClientFactoryWithoutVersionCheck(opts); - pullCommand = new PullCommand(pullOptions, - clientFactory); + transFilePathFinder = makeTransFilePathFinder(pullOptions); } TransConfigPrompt promptUser() throws Exception { @@ -86,12 +88,11 @@ TransConfigPrompt promptUser() throws Exception { File transDir = new File(localTransDir); pullOptions.setTransDir(transDir); - final PullStrategy strategy = pullCommand.createStrategy(pullOptions); LocaleList localeMapList = pullOptions.getLocaleMapList(); LocaleMapping localeMapping = getSampleLocaleMapping(localeMapList); Iterable transFiles = Iterables.transform(srcFilesSample, - new ToTransFileNameFunction(strategy, localeMapping)); + new ToTransFileNameFunction(transFilePathFinder, localeMapping)); console.printfln(Hint, get("trans.doc.preview"), localeMapping.getLocale()); for (String transFile : transFiles) { console.printfln("%s%s", indent(8), transFile); @@ -110,6 +111,14 @@ TransConfigPrompt promptUser() throws Exception { return this; } + private TransFilePathFinder makeTransFilePathFinder(PullOptions opts) { + if (ProjectType.File.name().equalsIgnoreCase(opts.getProjectType())) { + return new RawTransFilePathFinder(opts); + } else { + return new OtherTransFilePathFinder(opts); + } + } + private static LocaleMapping getSampleLocaleMapping(LocaleList localeMapList) { LocaleMapping localeMapping; @@ -123,19 +132,61 @@ TransConfigPrompt promptUser() throws Exception { private static class ToTransFileNameFunction implements Function { - private final PullStrategy strategy; + private final TransFilePathFinder transFilePathFinder; private final LocaleMapping localeMapping; - public ToTransFileNameFunction(PullStrategy strategy, + public ToTransFileNameFunction(TransFilePathFinder transFilePathFinder, LocaleMapping localeMapping) { - this.strategy = strategy; + this.transFilePathFinder = transFilePathFinder; this.localeMapping = localeMapping; } @Override public String apply(String input) { - return strategy.getTransFileToWrite(input, localeMapping).getPath(); + return transFilePathFinder.getTransFileToWrite(input, localeMapping); + + } + } + + interface TransFilePathFinder { + String getTransFileToWrite(String srcDoc, LocaleMapping localeMapping); + } + + static class RawTransFilePathFinder implements TransFilePathFinder { + private final TransFileResolver transFileResolver; + + RawTransFilePathFinder(PullOptions opts) { + transFileResolver = new TransFileResolver(opts); + } + @Override + public String getTransFileToWrite(String srcDoc, + LocaleMapping localeMapping) { + String targetFileExt = FilenameUtils + .getExtension(srcDoc); + + Optional translationFileExtension = + Optional.fromNullable(targetFileExt); + File file = transFileResolver.resolveTransFile( + QualifiedSrcDocName.from(srcDoc), + localeMapping, translationFileExtension); + return file.getPath(); + } + } + + static class OtherTransFilePathFinder implements TransFilePathFinder { + private final TransFileResolver transFileResolver; + + OtherTransFilePathFinder(PullOptions opts) { + this.transFileResolver = new TransFileResolver(opts); + } + + @Override + public String getTransFileToWrite(String srcDoc, + LocaleMapping localeMapping) { + File transFile = transFileResolver.getTransFile( + UnqualifiedSrcDocName.from(srcDoc), localeMapping); + return transFile.getPath(); } } } diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptionsImpl.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptionsImpl.java index 485beb3f..7e4580b6 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptionsImpl.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptionsImpl.java @@ -189,7 +189,7 @@ public ImmutableList getFileTypes() { return fileTypes; } - private static final String fileTypeHelp = "File types to locate and transmit to the server. \n" + + public static final String fileTypeHelp = "File types to locate and transmit to the server. \n" + "Default file extension will be used unless it is being specified. \n" + "Pattern: TYPE[extension;extension],TYPE[extension] \n" + "Supported types: \n" + diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/push/RawPushCommand.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/push/RawPushCommand.java index 5540cc77..971da529 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/push/RawPushCommand.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/push/RawPushCommand.java @@ -103,8 +103,7 @@ public RawPushCommand(PushOptions opts, RestClientFactory clientFactory) { consoleInteractor = new ConsoleInteractorImpl(opts); } - @VisibleForTesting - protected RawPushCommand(PushOptions opts, RestClientFactory clientFactory, + public RawPushCommand(PushOptions opts, RestClientFactory clientFactory, ConsoleInteractor console) { super(opts, clientFactory); client = getClientFactory().getFileResourceClient(); @@ -188,7 +187,7 @@ private void validateInputFileType(String inputFileType, * @param acceptedTypes * @param inputFileTypes */ - private Map> validateFileTypes( + public Map> validateFileTypes( List acceptedTypes, List inputFileTypes) { Map> filteredFileTypes = new HashMap<>(); diff --git a/zanata-client-commands/src/main/resources/prompts.properties b/zanata-client-commands/src/main/resources/prompts.properties index 59283e73..eed06604 100644 --- a/zanata-client-commands/src/main/resources/prompts.properties +++ b/zanata-client-commands/src/main/resources/prompts.properties @@ -43,6 +43,8 @@ includes.prompt=Includes (leave blank if not applicable): excludes.question=Do you want to define any Excludes? excludes.usage= - Wildcard pattern to exclude files and directories. Defined it as "configuration.properties,build.properties". excludes.prompt=Excludes (leave blank if not applicable): +project.file.type.question=What file types do you want to use? +file.type.prompt=Please enter file types in comma separated format (e.g. XML_DOCUMENT_TYPE_DEFINITION,IDML[txt]): no.source.doc.found=No source documents found. found.source.docs=Found source documents: source.doc.confirm.yes.no=Continue with these source document settings (y/n)? diff --git a/zanata-client-commands/src/test/java/org/zanata/client/commands/init/SourceConfigPromptTest.java b/zanata-client-commands/src/test/java/org/zanata/client/commands/init/SourceConfigPromptTest.java index 14c6159e..b4430b01 100644 --- a/zanata-client-commands/src/test/java/org/zanata/client/commands/init/SourceConfigPromptTest.java +++ b/zanata-client-commands/src/test/java/org/zanata/client/commands/init/SourceConfigPromptTest.java @@ -1,6 +1,7 @@ package org.zanata.client.commands.init; import static org.hamcrest.MatcherAssert.assertThat; +import static org.mockito.Mockito.when; import java.io.File; import java.net.URI; @@ -10,41 +11,40 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; import org.zanata.client.commands.ConfigurableProjectOptions; import org.zanata.client.commands.ConfigurableProjectOptionsImpl; import org.zanata.client.commands.ConsoleInteractor; import org.zanata.client.commands.MockConsoleInteractor; import org.zanata.client.commands.ZanataCommand; +import org.zanata.client.commands.push.PushOptions; +import org.zanata.client.commands.push.PushOptionsImpl; import org.zanata.client.config.LocaleList; +import org.zanata.common.DocumentType; +import org.zanata.rest.client.FileResourceClient; +import org.zanata.rest.client.RestClientFactory; +import com.google.common.collect.ImmutableList; public class SourceConfigPromptTest { @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); private SourceConfigPrompt prompt; - private ConfigurableProjectOptions opts; + private PushOptions opts; + @Mock + private RestClientFactory clientFactory; + @Mock + private FileResourceClient fileClient; @Before public void setUp() throws Exception { - opts = new ConfigurableProjectOptionsImpl() { - @Override - public ZanataCommand initCommand() { - return null; - } - - @Override - public String getCommandName() { - return "testCommand"; - } - - @Override - public String getCommandDescription() { - return "test command"; - } - }; + MockitoAnnotations.initMocks(this); + opts = new PushOptionsImpl(); opts.setUrl(new URI("http://localhost:1234").toURL()); opts.setUsername("admin"); opts.setKey("abc"); prompt = null; + when(clientFactory.getFileResourceClient()).thenReturn(fileClient); } @Test @@ -109,4 +109,45 @@ public void allowUserToRetry() throws Exception { Matchers.contains("*.*")); assertThat(opts.getExcludes(), Matchers.contains("a.pot")); } + + @Test + public void canHandleFileProjectType() throws Exception { + when(fileClient.acceptedFileTypes()).thenReturn(ImmutableList.copyOf(DocumentType.values())); + // here we use absolute path because we create temp files in there + String expectedSrcDir = tempFolder.getRoot().getAbsolutePath() + "/resources"; + ConsoleInteractor console = + MockConsoleInteractor.predefineAnswers( + expectedSrcDir, "messages.txt", + "*Excluded.txt", "PLAIN_TEXT[txt]", "y"); + opts.setProj("fileProject"); + opts.setProjectVersion("master"); + opts.setProjectType("file"); + opts.setLocaleMapList(new LocaleList()); + File folder = tempFolder.newFolder("resources"); + + assertThat(new File(folder, "messages.txt").createNewFile(), + Matchers.is(true)); + assertThat( + new File(folder, "shouldBeExcluded.txt").createNewFile(), + Matchers.is(true)); + + prompt = new SourceConfigPrompt(console, opts) { + @Override + protected RestClientFactory getClientFactory(PushOptions pushOptions) { + return clientFactory; + } + }; + + prompt = prompt.promptUser(); + + assertThat(opts.getSrcDir(), + Matchers.equalTo(new File(expectedSrcDir))); + + assertThat(prompt.getIncludes(), + Matchers.equalTo("messages.txt")); + assertThat(prompt.getExcludes(), Matchers.equalTo("*Excluded.txt")); + assertThat(opts.getIncludes(), + Matchers.contains("messages.txt")); + assertThat(opts.getExcludes(), Matchers.contains("*Excluded.txt")); + } } diff --git a/zanata-client-commands/src/test/java/org/zanata/client/commands/init/TransConfigPromptTest.java b/zanata-client-commands/src/test/java/org/zanata/client/commands/init/TransConfigPromptTest.java index b1128abb..de65326c 100644 --- a/zanata-client-commands/src/test/java/org/zanata/client/commands/init/TransConfigPromptTest.java +++ b/zanata-client-commands/src/test/java/org/zanata/client/commands/init/TransConfigPromptTest.java @@ -109,4 +109,29 @@ public void allowUserToRetry() throws Exception { assertThat(opts.getTransDir(), Matchers.equalTo(new File("po"))); } + + @Test + public void canHandleFileTypeProjectAndDisplayTransFiles() throws Exception { + ConsoleInteractor console = + MockConsoleInteractor.predefineAnswers(".", "y"); + opts.setProjectType("file"); + opts.setProj("about-fedora"); + opts.setProjectVersion("master"); + // provides locale list + LocaleList locales = new LocaleList(); + locales.add(new LocaleMapping("de")); + opts.setLocaleMapList(locales); + prompt = + new TransConfigPrompt(console, opts, Sets.newHashSet("a.txt", + "b.txt")); + + prompt = prompt.promptUser(); + + assertThat(opts.getTransDir(), Matchers.equalTo(new File("."))); + List capturedPrompts = + MockConsoleInteractor.getCapturedPrompts(console); + assertThat(capturedPrompts, Matchers.hasItems( + " ./de/a.txt", + " ./de/b.txt")); + } } From 80ebeacdb2de6bf876f7b85c8ce4f0ee95fab68f Mon Sep 17 00:00:00 2001 From: Patrick Huang Date: Wed, 9 Mar 2016 11:55:47 +1000 Subject: [PATCH 4/9] ZNTA-930 - refactor and minor improvements --- .../client/commands/init/SourceConfigPrompt.java | 9 ++++----- .../zanata/client/commands/push/PushOptionsImpl.java | 2 +- .../src/main/resources/prompts.properties | 2 +- .../client/commands/init/SourceConfigPromptTest.java | 10 +++++----- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/SourceConfigPrompt.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/SourceConfigPrompt.java index eae66530..b063fa83 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/init/SourceConfigPrompt.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/init/SourceConfigPrompt.java @@ -80,7 +80,6 @@ class SourceConfigPrompt { private String includes; private String excludes; private Set docNames; - private List rawDocumentTypes; public SourceConfigPrompt( ConsoleInteractor console, @@ -132,10 +131,7 @@ SourceConfigPrompt promptUser() throws Exception { console.blankLine(); console.printfln(Question, get("project.file.type.question")); - RestClientFactory clientFactory = getClientFactory(pushOptions); - FileResourceClient client = - clientFactory.getFileResourceClient(); - rawDocumentTypes = client.acceptedFileTypes(); + // this answer is not persisted in zanata.xml so user will still need to type it when they do the actual push console.printfln(Hint, PushOptionsImpl.fileTypeHelp); console.printf(Question, get("file.type.prompt")); @@ -257,6 +253,9 @@ private ImmutableList filteredFileExtensions(PushOptions opts) { RestClientFactory clientFactory = getClientFactory(opts); RawPushCommand rawPushCommand = new RawPushCommand(opts, clientFactory, console); + FileResourceClient client = + clientFactory.getFileResourceClient(); + List rawDocumentTypes = client.acceptedFileTypes(); Map> filteredDocTypes = rawPushCommand.validateFileTypes(rawDocumentTypes, opts.getFileTypes()); diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptionsImpl.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptionsImpl.java index 7e4580b6..bc0a0b20 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptionsImpl.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptionsImpl.java @@ -206,7 +206,7 @@ public ImmutableList getFileTypes() { "\t PROPERTIES[properties] \n" + "\t PROPERTIES_UTF8[properties] \n" + "\t XLIFF[xml] \n" + - "Usage --file-types \"XML_DOCUMENT_TYPE_DEFINITION,IDML[txt]\""; + "Usage --file-types \"XML_DOCUMENT_TYPE_DEFINITION,PLAIN_TEXT[md;txt]\""; @Option(name = "--file-types", metaVar = "TYPES", usage = fileTypeHelp) diff --git a/zanata-client-commands/src/main/resources/prompts.properties b/zanata-client-commands/src/main/resources/prompts.properties index eed06604..7ce94ff0 100644 --- a/zanata-client-commands/src/main/resources/prompts.properties +++ b/zanata-client-commands/src/main/resources/prompts.properties @@ -44,7 +44,7 @@ excludes.question=Do you want to define any Excludes? excludes.usage= - Wildcard pattern to exclude files and directories. Defined it as "configuration.properties,build.properties". excludes.prompt=Excludes (leave blank if not applicable): project.file.type.question=What file types do you want to use? -file.type.prompt=Please enter file types in comma separated format (e.g. XML_DOCUMENT_TYPE_DEFINITION,IDML[txt]): +file.type.prompt=Please enter file types in comma separated format (e.g. XML_DOCUMENT_TYPE_DEFINITION,PLAIN_TEXT[md;txt]): no.source.doc.found=No source documents found. found.source.docs=Found source documents: source.doc.confirm.yes.no=Continue with these source document settings (y/n)? diff --git a/zanata-client-commands/src/test/java/org/zanata/client/commands/init/SourceConfigPromptTest.java b/zanata-client-commands/src/test/java/org/zanata/client/commands/init/SourceConfigPromptTest.java index b4430b01..48bf9b17 100644 --- a/zanata-client-commands/src/test/java/org/zanata/client/commands/init/SourceConfigPromptTest.java +++ b/zanata-client-commands/src/test/java/org/zanata/client/commands/init/SourceConfigPromptTest.java @@ -117,15 +117,15 @@ public void canHandleFileProjectType() throws Exception { String expectedSrcDir = tempFolder.getRoot().getAbsolutePath() + "/resources"; ConsoleInteractor console = MockConsoleInteractor.predefineAnswers( - expectedSrcDir, "messages.txt", - "*Excluded.txt", "PLAIN_TEXT[txt]", "y"); + expectedSrcDir, "messages.md", + "*Excluded.txt", "PLAIN_TEXT[md;txt]", "y"); opts.setProj("fileProject"); opts.setProjectVersion("master"); opts.setProjectType("file"); opts.setLocaleMapList(new LocaleList()); File folder = tempFolder.newFolder("resources"); - assertThat(new File(folder, "messages.txt").createNewFile(), + assertThat(new File(folder, "messages.md").createNewFile(), Matchers.is(true)); assertThat( new File(folder, "shouldBeExcluded.txt").createNewFile(), @@ -144,10 +144,10 @@ protected RestClientFactory getClientFactory(PushOptions pushOptions) { Matchers.equalTo(new File(expectedSrcDir))); assertThat(prompt.getIncludes(), - Matchers.equalTo("messages.txt")); + Matchers.equalTo("messages.md")); assertThat(prompt.getExcludes(), Matchers.equalTo("*Excluded.txt")); assertThat(opts.getIncludes(), - Matchers.contains("messages.txt")); + Matchers.contains("messages.md")); assertThat(opts.getExcludes(), Matchers.contains("*Excluded.txt")); } } From 58a90c616c616f462a52f7fa101fd8cd4eddd556 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Tue, 15 Mar 2016 16:49:52 +1000 Subject: [PATCH 5/9] chore(dependency): Update zanata-parent to 27-SNAPSHOT, args4j to 2.32 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e94cf8fc..ca867397 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.zanata zanata-parent - 25 + 27-SNAPSHOT ../parent @@ -145,7 +145,7 @@ args4j args4j - 2.0.23 + 2.32 From 8c7320ac3a706ce56dde7b5b30b3ee0edf2996c1 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 16 Mar 2016 16:41:47 +1000 Subject: [PATCH 6/9] fix(staticAnalysis): fix the failed -DstaticAnalysis --- pom.xml | 3 --- zanata-maven-plugin/demo-glossary/compendium/pom.xml | 2 +- zanata-maven-plugin/demo-glossary/csv/pom.xml | 2 +- zanata-maven-plugin/demo-glossary/delete/pom.xml | 2 +- zanata-maven-plugin/demo-glossary/fuel/pom.xml | 2 +- zanata-maven-plugin/demo-props/pom.xml | 2 +- zanata-maven-plugin/demo-publican/pom.xml | 2 +- 7 files changed, 6 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index ca867397..5feca0b8 100644 --- a/pom.xml +++ b/pom.xml @@ -46,9 +46,6 @@ org.apache.maven.plugins maven-javadoc-plugin - - -Xdoclint:none - org.codehaus.mojo diff --git a/zanata-maven-plugin/demo-glossary/compendium/pom.xml b/zanata-maven-plugin/demo-glossary/compendium/pom.xml index 19d74e18..54cfa435 100644 --- a/zanata-maven-plugin/demo-glossary/compendium/pom.xml +++ b/zanata-maven-plugin/demo-glossary/compendium/pom.xml @@ -9,7 +9,7 @@ org.zanata zanata-maven-plugin - 3.8.0 + ${project.version} fr.po pl diff --git a/zanata-maven-plugin/demo-glossary/csv/pom.xml b/zanata-maven-plugin/demo-glossary/csv/pom.xml index bbaebefd..b9708a7f 100644 --- a/zanata-maven-plugin/demo-glossary/csv/pom.xml +++ b/zanata-maven-plugin/demo-glossary/csv/pom.xml @@ -9,7 +9,7 @@ org.zanata zanata-maven-plugin - 3.8.0 + ${project.version} translate1.csv diff --git a/zanata-maven-plugin/demo-glossary/delete/pom.xml b/zanata-maven-plugin/demo-glossary/delete/pom.xml index 48d0ba22..f2d77eb7 100644 --- a/zanata-maven-plugin/demo-glossary/delete/pom.xml +++ b/zanata-maven-plugin/demo-glossary/delete/pom.xml @@ -9,7 +9,7 @@ org.zanata zanata-maven-plugin - 3.8.0 + ${project.version} zh true diff --git a/zanata-maven-plugin/demo-glossary/fuel/pom.xml b/zanata-maven-plugin/demo-glossary/fuel/pom.xml index fd355c5e..49de8bb5 100644 --- a/zanata-maven-plugin/demo-glossary/fuel/pom.xml +++ b/zanata-maven-plugin/demo-glossary/fuel/pom.xml @@ -9,7 +9,7 @@ org.zanata zanata-maven-plugin - 3.8.0 + ${project.version} fuel_hi.po hi diff --git a/zanata-maven-plugin/demo-props/pom.xml b/zanata-maven-plugin/demo-props/pom.xml index c7823a73..9c6b208c 100644 --- a/zanata-maven-plugin/demo-props/pom.xml +++ b/zanata-maven-plugin/demo-props/pom.xml @@ -14,7 +14,7 @@ org.zanata zanata-maven-plugin - 3.8.0 + ${project.version} properties ${zanata.srcDir} diff --git a/zanata-maven-plugin/demo-publican/pom.xml b/zanata-maven-plugin/demo-publican/pom.xml index d1164269..ac9eeeaf 100644 --- a/zanata-maven-plugin/demo-publican/pom.xml +++ b/zanata-maven-plugin/demo-publican/pom.xml @@ -14,7 +14,7 @@ org.zanata zanata-maven-plugin - 3.8.0 + ${project.version} ${zanata.srcDir} ${zanata.transDir} From 2dbe4323bf194ad4125bd970fe6da4450d93f6e7 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Wed, 16 Mar 2016 18:15:49 +1000 Subject: [PATCH 7/9] fix(version): revert the version to 3.8.1 because it is not part of the normal reactor build --- zanata-maven-plugin/demo-props/pom.xml | 2 +- zanata-maven-plugin/demo-publican/pom.xml | 2 +- zanata-maven-plugin/demo-xliff/pom.xml | 2 +- zanata-maven-plugin/demo-xml/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zanata-maven-plugin/demo-props/pom.xml b/zanata-maven-plugin/demo-props/pom.xml index 9c6b208c..c7ea0fa2 100644 --- a/zanata-maven-plugin/demo-props/pom.xml +++ b/zanata-maven-plugin/demo-props/pom.xml @@ -14,7 +14,7 @@ org.zanata zanata-maven-plugin - ${project.version} + 3.8.1 properties ${zanata.srcDir} diff --git a/zanata-maven-plugin/demo-publican/pom.xml b/zanata-maven-plugin/demo-publican/pom.xml index ac9eeeaf..bbf87c44 100644 --- a/zanata-maven-plugin/demo-publican/pom.xml +++ b/zanata-maven-plugin/demo-publican/pom.xml @@ -14,7 +14,7 @@ org.zanata zanata-maven-plugin - ${project.version} + 3.8.1 ${zanata.srcDir} ${zanata.transDir} diff --git a/zanata-maven-plugin/demo-xliff/pom.xml b/zanata-maven-plugin/demo-xliff/pom.xml index f07edde7..8866771d 100644 --- a/zanata-maven-plugin/demo-xliff/pom.xml +++ b/zanata-maven-plugin/demo-xliff/pom.xml @@ -14,7 +14,7 @@ org.zanata zanata-maven-plugin - 3.8.0 + 3.8.1 xliff ${zanata.srcDir} diff --git a/zanata-maven-plugin/demo-xml/pom.xml b/zanata-maven-plugin/demo-xml/pom.xml index b7440ed8..3a0c4936 100644 --- a/zanata-maven-plugin/demo-xml/pom.xml +++ b/zanata-maven-plugin/demo-xml/pom.xml @@ -14,7 +14,7 @@ org.zanata zanata-maven-plugin - 3.8.0 + 3.8.1 xml ${zanata.srcDir} From 9062a61d9ad5e32fa316a9ff8104dd4cd4e8d6aa Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Thu, 17 Mar 2016 10:36:56 +1000 Subject: [PATCH 8/9] fix(demo): Revert back the version --- zanata-maven-plugin/demo-glossary/compendium/pom.xml | 2 +- zanata-maven-plugin/demo-glossary/csv/pom.xml | 2 +- zanata-maven-plugin/demo-glossary/delete/pom.xml | 2 +- zanata-maven-plugin/demo-glossary/fuel/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zanata-maven-plugin/demo-glossary/compendium/pom.xml b/zanata-maven-plugin/demo-glossary/compendium/pom.xml index 54cfa435..0bfc8fd7 100644 --- a/zanata-maven-plugin/demo-glossary/compendium/pom.xml +++ b/zanata-maven-plugin/demo-glossary/compendium/pom.xml @@ -9,7 +9,7 @@ org.zanata zanata-maven-plugin - ${project.version} + 3.8.1 fr.po pl diff --git a/zanata-maven-plugin/demo-glossary/csv/pom.xml b/zanata-maven-plugin/demo-glossary/csv/pom.xml index b9708a7f..06c76dd6 100644 --- a/zanata-maven-plugin/demo-glossary/csv/pom.xml +++ b/zanata-maven-plugin/demo-glossary/csv/pom.xml @@ -9,7 +9,7 @@ org.zanata zanata-maven-plugin - ${project.version} + 3.8.1 translate1.csv diff --git a/zanata-maven-plugin/demo-glossary/delete/pom.xml b/zanata-maven-plugin/demo-glossary/delete/pom.xml index f2d77eb7..413f02b4 100644 --- a/zanata-maven-plugin/demo-glossary/delete/pom.xml +++ b/zanata-maven-plugin/demo-glossary/delete/pom.xml @@ -9,7 +9,7 @@ org.zanata zanata-maven-plugin - ${project.version} + 3.8.1 zh true diff --git a/zanata-maven-plugin/demo-glossary/fuel/pom.xml b/zanata-maven-plugin/demo-glossary/fuel/pom.xml index 49de8bb5..b07b4739 100644 --- a/zanata-maven-plugin/demo-glossary/fuel/pom.xml +++ b/zanata-maven-plugin/demo-glossary/fuel/pom.xml @@ -9,7 +9,7 @@ org.zanata zanata-maven-plugin - ${project.version} + 3.8.1 fuel_hi.po hi From 741abdf537838297f4a5bbf7b16b169fccece4d3 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Sat, 19 Mar 2016 23:54:31 +1000 Subject: [PATCH 9/9] chore(dependency): zanata-parent-27, zanata-api-3.8.4, zanata-common-3.8.2 --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 5feca0b8..9c5476f2 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.zanata zanata-parent - 27-SNAPSHOT + 27 ../parent @@ -35,8 +35,8 @@ - 3.8.3 - 3.8.1 + 3.8.4 + 3.8.2 3.0.11.Final 1.17.1