Changeset 1583 in josm


Ignore:
Timestamp:
May 7, 2009 8:00:43 PM (4 years ago)
Author:
stoecker
Message:

close #2535 - patch by podolsir - NPE for missing icon, update translations, added et, nb, gl

Location:
trunk
Files:
5 edited

Legend:

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

    r1415 r1583  
    109109                JOptionPane.showMessageDialog(Main.parent, 
    110110                        tr("The projection \"{0}\" is designed for\n" 
    111                         + "latitudes between 46.1° and 57° only.\n" 
     111                        + "latitudes between 46.1\u00b0 and 57\u00b0 only.\n" 
    112112                        + "Use another projection system if you are not using\n" 
    113113                        + "a French WMS server.\n" 
  • trunk/src/org/openstreetmap/josm/data/projection/SwissGrid.java

    r1582 r1583  
    4444        JOptionPane.showMessageDialog(Main.parent, 
    4545                tr("The projection \"{0}\" is designed for\n" 
    46                 + "latitudes between 45.7' and 47.9'\n" 
    47                 + "and longitutes between 5.7' and 10.6' only.\n" 
     46                + "latitudes between 45.7\u00b0 and 47.9\u00b0\n" 
     47                + "and longitutes between 5.7\u00b0 and 10.6\u00b0 only.\n" 
    4848                + "Use another projection system if you are not working\n" 
    4949                + "on a data set of Switzerland or Liechtenstein.\n" 
  • trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java

    r1340 r1583  
    22 
    33import java.awt.Color; 
     4 
     5import javax.swing.ImageIcon; 
    46 
    57import org.openstreetmap.josm.tools.ColorHelper; 
     
    170172            else if (qName.equals("icon")) 
    171173            { 
    172                 hadIcon = inIcon = true; 
     174                inIcon = true; 
    173175                for (int count=0; count<atts.getLength(); count++) 
    174176                { 
    175                     if (atts.getQName(count).equals("src")) 
    176                         rule.icon.icon = MapPaintStyles.getIcon(atts.getValue(count), styleName); 
    177                     else if (atts.getQName(count).equals("annotate")) 
     177                    if (atts.getQName(count).equals("src")) { 
     178                        ImageIcon icon = MapPaintStyles.getIcon(atts.getValue(count), styleName); 
     179                        hadIcon = (icon != null); 
     180                        rule.icon.icon = icon; 
     181                    } else if (atts.getQName(count).equals("annotate")) 
    178182                        rule.icon.annotate = Boolean.parseBoolean (atts.getValue(count)); 
    179183                    else if(atts.getQName(count).equals("priority")) 
  • trunk/src/org/openstreetmap/josm/tools/I18n.java

    r1169 r1583  
    66import java.util.Comparator; 
    77import java.util.Locale; 
     8import java.util.LinkedList; 
    89import java.util.Vector; 
    910 
     
    5859    public static final Locale[] getAvailableTranslations() { 
    5960        Vector<Locale> v = new Vector<Locale>(); 
     61        LinkedList<String>str = new LinkedList<String>(); 
    6062        Locale[] l = Locale.getAvailableLocales(); 
    6163        for (int i = 0; i < l.length; i++) { 
    62             String cn = TR_BASE + l[i]; 
     64            String loc = l[i].toString(); 
     65            String cn = TR_BASE + loc; 
    6366            try { 
    6467                Class.forName(cn); 
    6568                v.add(l[i]); 
     69                str.add(loc); 
    6670            } catch (ClassNotFoundException e) { 
    6771            } 
    6872        } 
     73        /* hmm, don't know why this is necessary */ 
     74        try { 
     75          if(!str.contains("nb")) 
     76            v.add(new Locale("nb")); 
     77        } catch (Exception e) {} 
     78        try { 
     79          if(!str.contains("gl")) 
     80            v.add(new Locale("gl")); 
     81        } catch (Exception e) {} 
    6982        l = new Locale[v.size()]; 
    7083        l = v.toArray(l); 
Note: See TracChangeset for help on using the changeset viewer.