<commit_before>package hudson.model;

import org.jvnet.localizer.Localizable;

import java.util.Locale;

/**
 * Ball color used for the build status indication.
 *
 * <p>
 * There are four basic colors, plus their animated "bouncy" versions.
 * {@link #ordinal()} is the sort order. 
 *
 * <p>
 * Note that mutiple {@link BallColor} instances may map to the same
 * RGB color, to avoid the rainbow effect.
 *
 * <h2>Historical Note</h2>
 * <p>
 * Hudson started to overload colors &mdash; for example grey could mean
 * either disabled, aborted, or not yet built. As a result, {@link BallColor}
 * becomes more like a "logical" color, in the sense that different {@link BallColor}
 * values can map to the same RGB color. See issue #956.
 *
 * @author <NAME>
 */
public enum BallColor {
    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",Messages._BallColor_Pending()),
    GREY_ANIME("grey_anime",Messages._BallColor_InProgress()),

    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 Localizable description;
    private final String image;

    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";
        this.description = description;
    }

    /**
     * String like "red.gif" that represents the file name of the image.
     */
    public String getImage() {
        return image;
    }

    /**
     * Gets the human-readable description used as img/@alt.
     */
    public String getDescription() {
        return description.toString();
    }

    /**
     * Also used as a final name.
     */
    public String toString() {
        return name().toLowerCase(Locale.ENGLISH);
    }<commit_msg>Fix: Tool tips on colored balls are now localized in the browser's preferred locale (instead of using the default locale of the server JVM).<commit_after>package hudson.model;

import org.jvnet.localizer.LocaleProvider;
import org.jvnet.localizer.Localizable;

import java.util.Locale;

/**
 * Ball color used for the build status indication.
 *
 * <p>
 * There are four basic colors, plus their animated "bouncy" versions.
 * {@link #ordinal()} is the sort order. 
 *
 * <p>
 * Note that mutiple {@link BallColor} instances may map to the same
 * RGB color, to avoid the rainbow effect.
 *
 * <h2>Historical Note</h2>
 * <p>
 * Hudson started to overload colors &mdash; for example grey could mean
 * either disabled, aborted, or not yet built. As a result, {@link BallColor}
 * becomes more like a "logical" color, in the sense that different {@link BallColor}
 * values can map to the same RGB color. See issue #956.
 *
 * @author <NAME>
 */
public enum BallColor {
    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",Messages._BallColor_Pending()),
    GREY_ANIME("grey_anime",Messages._BallColor_InProgress()),

    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 Localizable description;
    private final String image;

    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";
        this.description = description;
    }

    /**
     * String like "red.gif" that represents the file name of the image.
     */
    public String getImage() {
        return image;
    }

    /**
     * Gets the human-readable description used as img/@alt.
     */
    public String getDescription() {
        return description.toString(LocaleProvider.getLocale());
    }

    /**
     * Also used as a final name.
     */
    public String toString() {
        return name().toLowerCase(Locale.ENGLISH);
    }
{'fraction_non_alphanumeric': 0.11490939044481055, 'fraction_numerical': 0.002059308072487644, 'mean_word_length': 3.5520149953139644, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1879142', 'n_tokens_mistral': 1466, 'n_tokens_neox': 1383, 'n_words': 421}