Changeset 8091 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2015-02-21T15:27:40+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r8067 r8091 28 28 import org.openstreetmap.josm.tools.CheckParameterUtil; 29 29 import org.openstreetmap.josm.tools.ImageProvider; 30 import org.openstreetmap.josm.tools.LanguageInfo; 30 31 31 32 /** … … 152 153 /** name of the imagery entry (gets translated by josm usually) */ 153 154 private String name; 154 /** original name of the imagery entry in case of translation call */ 155 /** original name of the imagery entry in case of translation call, for multiple languages English when possible */ 155 156 private String origName; 157 /** (original) language of the translated name entry */ 158 private String langName; 156 159 /** id for this imagery entry, optional at the moment */ 157 160 private String id; … … 166 169 private ImageryBounds bounds = null; 167 170 private List<String> serverProjections; 171 /** description of the imagery entry, should contain notes what type of data it is */ 168 172 private String description; 173 /** language of the description entry, "" for tr() result */ 174 private String langDescription; 169 175 private String attributionText; 170 176 private String attributionLinkURL; … … 686 692 687 693 /** 688 * Sets the entry name and translates it. 694 * Sets the entry name and handle translation. 695 * @param name The used language 689 696 * @param name The entry name 690 * @since 6968 691 */ 692 public void setTranslatedName(String name) { 693 this.name = tr(name); 694 this.origName = name; 697 * @since 8091 698 */ 699 public void setName(String language, String name) { 700 boolean isdefault = LanguageInfo.getJOSMLocaleCode(null).equals(language); 701 if(LanguageInfo.isBetterLanguage(langName, language)) { 702 this.name = isdefault ? tr(name) : name; 703 this.langName = language; 704 } 705 if(origName == null || isdefault) { 706 this.origName = name; 707 } 695 708 } 696 709 … … 791 804 /** 792 805 * Sets the description text when existing. 806 * @param name The used language 793 807 * @param description the imagery description text 794 * @since 8065 795 */ 796 public void setDescription(String description) { 797 this.description = description; 808 * @since 8091 809 */ 810 public void setDescription(String language, String description) { 811 boolean isdefault = LanguageInfo.getJOSMLocaleCode(null).equals(language); 812 if(LanguageInfo.isBetterLanguage(langDescription, language)) { 813 this.description = isdefault ? tr(description) : description; 814 this.langDescription = language; 815 } 798 816 } 799 817
Note:
See TracChangeset
for help on using the changeset viewer.