Changeset 6968 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2014-04-10T20:59:12+02:00 (11 years ago)
Author:
stoecker
Message:

also store untranslated imagery name

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r6830 r6968  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.imagery;
     3
     4import static org.openstreetmap.josm.tools.I18n.tr;
    35
    46import java.awt.Image;
     
    145147    }
    146148
     149    /** name of the imagery entry (gets translated by josm usually) */
    147150    private String name;
     151    /** original name of the imagery entry in case of translation call */
     152    private String origName;
    148153    private String url = null;
    149154    private boolean defaultEntry = false;
     
    562567
    563568    /**
     569     * Returns the entry name.
     570     * @return The entry name
     571     * @since 6968
     572     */
     573    public String getOriginalName() {
     574        return this.origName != null ? this.origName : this.name;
     575    }
     576
     577    /**
    564578     * Sets the entry name.
    565579     * @param name The entry name
     
    567581    public void setName(String name) {
    568582        this.name = name;
     583    }
     584
     585    /**
     586     * Sets the entry name and translates it.
     587     * @param name The entry name
     588     * @since 6968
     589     */
     590    public void setTranslatedName(String name) {
     591        this.name = tr(name);
     592        this.origName = name;
    569593    }
    570594
  • trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java

    r6690 r6968  
    202202            case ENTRY_ATTRIBUTE:
    203203                if (qName.equals("name")) {
    204                     entry.setName(tr(accumulator.toString()));
     204                    entry.setTranslatedName(accumulator.toString());
    205205                } else if (qName.equals("type")) {
    206206                    boolean found = false;
Note: See TracChangeset for help on using the changeset viewer.