提交 fa5686cd 编写于 作者: K Kohsuke Kawaguchi

Added i18n.

I think we use the word 'description' elsewhere inside Jenkins to refer to human-readable text (like job description), so I'm making description the localized string. I'm assuming Kutzi has some use for all upper-case ID, yet the notion of 'upper case' only makes sense in some locale (for example not in Chinese), so I'm now calling it ID and I'm deriving it from the English localization.
上级 06a95383
......@@ -23,6 +23,8 @@
*/
package hudson.model;
import org.jvnet.localizer.Localizable;
import java.util.Locale;
/**
......@@ -36,60 +38,59 @@ public enum ResultTrend {
* Previous build was {@link Result#FAILURE} or {@link Result#UNSTABLE}
* and is now {@link Result#SUCCESS}.
*/
FIXED,
FIXED(Messages._ResultTrend_Fixed()),
/**
* Build as well as previous build (if it has a previous build) are {@link Result#SUCCESS}
*/
SUCCESS,
SUCCESS(Messages._ResultTrend_Success()),
/**
* Previous build was {@link Result#FAILURE} and is now 'only' {@link Result#UNSTABLE}.
*/
NOW_UNSTABLE("Now unstable"),
NOW_UNSTABLE(Messages._ResultTrend_NowUnstable()),
/**
* Build as well as previous build are {@link Result#UNSTABLE}.
*/
STILL_UNSTABLE("Still unstable"),
STILL_UNSTABLE(Messages._ResultTrend_StillUnstable()),
/**
* Previous build (if there is one) was {@link Result#SUCCESS} and current build is {@link Result#UNSTABLE}.
*/
UNSTABLE,
UNSTABLE(Messages._ResultTrend_Unstable()),
/**
* Build as well as previous build are {@link Result#FAILURE}.
*/
STILL_FAILING("Still failing"),
STILL_FAILING(Messages._ResultTrend_StillFailing()),
/**
* Previous build (if there is one) was {@link Result#SUCCESS} or {@link Result#UNSTABLE}
* and current build is {@link Result#UNSTABLE}.
*/
FAILURE,
FAILURE(Messages._ResultTrend_Failure()),
/**
* Build was aborted.
*/
ABORTED,
ABORTED(Messages._ResultTrend_Aborted()),
/**
* Build didn't run (yet).
*/
NOT_BUILT("Not built");
NOT_BUILT(Messages._ResultTrend_NotBuilt());
private final String description;
private final Localizable description;
private ResultTrend() {
this.description = name().charAt(0) + name().substring(1).toLowerCase(Locale.ENGLISH);
}
private ResultTrend(String description) {
private ResultTrend(Localizable description) {
this.description = description;
}
/**
* Returns a short english description of the result.
* Returns a short human-readable description of the result.
*/
public String getDescription() {
return this.description;
return this.description.toString();
}
public String getUpperCaseDescription() {
return this.description.toUpperCase(Locale.ENGLISH);
/**
* Gets all upper case ID like token of the build status.
*/
public String getID() {
return this.description.toString(Locale.ENGLISH).toUpperCase(Locale.ENGLISH);
}
/**
......
......@@ -166,6 +166,15 @@ Queue.WaitingForNextAvailableExecutor=Waiting for next available executor
Queue.WaitingForNextAvailableExecutorOn=Waiting for next available executor on {0}
Queue.init=Restoring the build queue
ResultTrend.Aborted=Aborted
ResultTrend.Failure=Failure
ResultTrend.Fixed=Fixed
ResultTrend.NotBuilt=Not built
ResultTrend.NowUnstable=Now unstable
ResultTrend.StillFailing=Still failing
ResultTrend.StillUnstable=Still unstable
ResultTrend.Success=Success
ResultTrend.Unstable=Unstable
Run.BuildAborted=Build was aborted
Run.MarkedExplicitly=explicitly marked to keep the record
Run.Permissions.Title=Run
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册