提交 44a713a9 编写于 作者: K kohsuke

i18n


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@7058 71c3de6d-444a-0410-be80-ed276b4c234a
上级 30ede8e6
......@@ -176,7 +176,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
launcher = node.createLauncher(listener);
if(node instanceof Slave)
listener.getLogger().println("Building remotely on "+node.getNodeName());
listener.getLogger().println(Messages.AbstractBuild_BuildingRemotely(node.getNodeName()));
if(checkout(listener))
return Result.FAILURE;
......@@ -378,7 +378,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
// is there any active build that depends on us?
for (AbstractBuild build : p.getBuilds()) {
if(e.getValue().includes(build.getNumber()))
return "kept because of "+build;
return Messages.AbstractBuild_KeptBecause(build);
}
}
......
......@@ -488,9 +488,9 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
Executor e = build.getExecutor();
String eta="";
if(e!=null)
eta = " (ETA:"+e.getEstimatedRemainingTime()+")";
eta = Messages.AbstractProject_ETA(e.getEstimatedRemainingTime());
int lbn = build.getNumber();
return "Build #"+lbn+" is already in progress"+eta;
return Messages.AbstractProject_BuildInProgress(lbn,eta);
}
public final long getEstimatedDuration() {
......@@ -557,7 +557,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
return scm.checkout(build, launcher, workspace, listener, changelogFile);
} catch (InterruptedException e) {
listener.getLogger().println("SCM check out aborted");
listener.getLogger().println(Messages.AbstractProject_ScmAborted());
LOGGER.log(Level.INFO,build.toString()+" aborted",e);
return false;
}
......@@ -573,11 +573,11 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
public boolean pollSCMChanges( TaskListener listener ) {
SCM scm = getScm();
if(scm==null) {
listener.getLogger().println("No SCM");
listener.getLogger().println(Messages.AbstractProject_NoSCM());
return false;
}
if(isDisabled()) {
listener.getLogger().println("Build disabled");
listener.getLogger().println(Messages.AbstractProject_Disabled());
return false;
}
......@@ -585,26 +585,24 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
FilePath workspace = getWorkspace();
if(workspace==null) {
// workspace offline. build now, or nothing will ever be built
listener.getLogger().println("Workspace is offline.");
listener.getLogger().println("Scheduling a new build to get a workspace.");
listener.getLogger().println(Messages.AbstractProject_WorkspaceOffline());
return true;
}
if(!workspace.exists()) {
// no workspace. build now, or nothing will ever be built
listener.getLogger().println("No workspace is available, so can't check for updates.");
listener.getLogger().println("Scheduling a new build to get a workspace.");
listener.getLogger().println(Messages.AbstractProject_NoWorkspace());
return true;
}
return scm.pollChanges(this, workspace.createLauncher(listener), workspace, listener );
} catch (AbortException e) {
listener.fatalError("Aborted");
listener.fatalError(Messages.AbstractProject_Aborted());
return false;
} catch (IOException e) {
e.printStackTrace(listener.fatalError(e.getMessage()));
return false;
} catch (InterruptedException e) {
e.printStackTrace(listener.fatalError("SCM polling aborted"));
e.printStackTrace(listener.fatalError(Messages.AbstractProject_PollingABorted()));
return false;
}
}
......
......@@ -76,7 +76,7 @@ public class Api extends AbstractModelObject {
if(list.isEmpty()) {
// XPath didn't match
rsp.setStatus(HttpServletResponse.SC_NOT_FOUND);
rsp.getWriter().print("XPath "+xpath+" didn't match");
rsp.getWriter().print(Messages.Api_NoXPathMatch(xpath));
return;
}
if(list.size()>1) {
......@@ -92,7 +92,7 @@ public class Api extends AbstractModelObject {
} else {
// XPath didn't match
rsp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
rsp.getWriter().print(Messages._Api_MultipleMatch(xpath,list.size()));
rsp.getWriter().print(Messages.Api_MultipleMatch(xpath,list.size()));
return;
}
} else
......
package hudson.model;
import org.jvnet.localizer.Localizable;
import java.util.Locale;
/**
......@@ -23,26 +25,26 @@ import java.util.Locale;
* @author Kohsuke Kawaguchi
*/
public enum BallColor {
RED("red","Failed"),
RED_ANIME("red_anime","In progress"),
YELLOW("yellow","Unstable"),
YELLOW_ANIME("yellow_anime","In progress"),
BLUE("blue","Success"),
BLUE_ANIME("blue_anime","In progress"),
RED("red",Messages._BallColor_Failed()),
RED_ANIME("red_anime",Messages._BallColor_InProgress()),
YELLOW("yellow",Messages._BallColor_Unstable()),
YELLOW_ANIME("yellow_anime",Messages._BallColor_InProgress()),
BLUE("blue",Messages._BallColor_Success()),
BLUE_ANIME("blue_anime",Messages._BallColor_InProgress()),
// for historical reasons they are called grey.
GREY("grey","Pending"),
GREY_ANIME("grey_anime","In progress"),
GREY("grey",Messages._BallColor_Pending()),
GREY_ANIME("grey_anime",Messages._BallColor_InProgress()),
DISABLED("grey","Disabled"),
DISABLED_ANIME("grey_anime","In progress"),
ABORTED("grey","Aborted"),
ABORTED_ANIME("grey_anime","In progress"),
DISABLED("grey",Messages._BallColor_Disabled()),
DISABLED_ANIME("grey_anime",Messages._BallColor_InProgress()),
ABORTED("grey",Messages._BallColor_Aborted()),
ABORTED_ANIME("grey_anime",Messages._BallColor_InProgress()),
;
private final String description;
private final Localizable description;
private final String image;
BallColor(String image, String description) {
BallColor(String image, Localizable description) {
// name() is not usable in the constructor, so I have to repeat the name twice
// in the constants definition.
this.image = image+".gif";
......@@ -60,7 +62,7 @@ public enum BallColor {
* Gets the human-readable description used as img/@alt.
*/
public String getDescription() {
return description;
return description.toString();
}
/**
......
AbstractBuild.BuildingRemotely=Building remotely on {0}
AbstractBuild.KeptBecause=kept because of {0}
AbstractProject.Pronoun=Project
AbstractProject.Aborted=Aborted
AbstractProject.BuildInProgress=Build #{0} is already in progress{1}
AbstractProject.Disabled=Build disabled
AbstractProject.ETA=\ (ETA:{0})
AbstractProject.NoSCM=No SCM
AbstractProject.NoWorkspace=No workspace is available, so can''t check for updates.
AbstractProject.PollingABorted=SCM polling aborted
AbstractProject.ScmAborted=SCM check out aborted
AbstractProject.WorkspaceOffline=Workspace is offline.
Api.MultipleMatch=XPath "{0}" matched {1} nodes. \
Create XPath that only matches one, or use the "wrapper" query parameter to wrap them all under a root element.
Api.NoXPathMatch=XPath {0} didn''t match
BallColor.Aborted=Aborted
BallColor.Disabled=Disabled
BallColor.Failed=Failed
BallColor.InProgress=In progress
BallColor.Pending=Pending
BallColor.Success=Success
BallColor.Unstable=Unstable
ExternalJob.DisplayName=Monitor an external job
FreeStyleProject.DisplayName=Build a free-style software project
Hudson.Permissions.Title=Overall
......@@ -10,9 +37,3 @@ Job.minutes=mins
Run.Permissions.Title=Run
View.Permissions.Title=View
FreeStyleProject.DisplayName=Build a free-style software project
ExternalJob.DisplayName=Monitor an external job
AbstractProject.Pronoun=Project
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册