Ignore:
Timestamp:
2020-08-30T22:19:00+02:00 (4 years ago)
Author:
simon04
Message:

fix #19736 - MapStatus displays non-localized SystemOfMeasurement name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/SystemOfMeasurement.java

    r15661 r16985  
    33
    44import static org.openstreetmap.josm.tools.I18n.marktr;
     5import static org.openstreetmap.josm.tools.I18n.tr;
    56
    67import java.text.NumberFormat;
     
    127128    /**
    128129     * Sets the current global system of measurement.
    129      * @param somKey The system of measurement key. Must be defined in {@link SystemOfMeasurement#ALL_SYSTEMS}.
     130     * @param som The system of measurement to set. Must be defined in {@link SystemOfMeasurement#ALL_SYSTEMS}.
    130131     * @throws IllegalArgumentException if {@code somKey} is not known
    131      * @since 8554
    132      */
    133     public static void setSystemOfMeasurement(String somKey) {
     132     * @since xxx (signature)
     133     */
     134    public static void setSystemOfMeasurement(SystemOfMeasurement som) {
     135        String somKey = som.getName();
    134136        if (!SystemOfMeasurement.ALL_SYSTEMS.containsKey(somKey)) {
    135137            throw new IllegalArgumentException("Invalid system of measurement: "+somKey);
     
    285287
    286288    /**
     289     * Returns the localized name of this system of measurement
     290     * @return the localized name
     291     */
     292    @Override
     293    public String toString() {
     294        return tr(name);
     295    }
     296
     297    /**
    287298     * Returns the default system of measurement for the current country.
    288299     * @return the default system of measurement for the current country
Note: See TracChangeset for help on using the changeset viewer.